Beispiel #1
0
def handshake(conn):
  ekeypair=createEphemeralKeypair()

  epub=yield conn.read(KEY_SIZE)
  esession=makeEphemeralSession(ekeypair, epub).bytes
  print('esssion: '+encode(esession))
  coder=lite_socket(esession.bytes)
  yield conn.write(ekeypair.public.bytes)

  yield Return(coder)
Beispiel #2
0
def handshake(conn):
    ekeypair = createEphemeralKeypair()

    epub = yield conn.read(KEY_SIZE)
    esession = makeEphemeralSession(ekeypair, epub).bytes
    print('esssion: ' + encode(esession))
    coder = lite_socket(esession.bytes)
    yield conn.write(ekeypair.public.bytes)

    yield Return(coder)
Beispiel #3
0
    def __init__(self, circuit):
        """
        Initializes the daemon with a downstream and upstream socket.
        This also sets the protocol state to HANDSHAKE_WRITE and generates an ephemeral keypair.
        """

        BaseDaemon.__init__(self, circuit)

        self.state = HANDSHAKE_WRITE
        self.ekeypair = createEphemeralKeypair()
        self.epub = bytes('')
Beispiel #4
0
    def __init__(self, circuit):
        """
        Initializes the daemon with a downstream and upstream socket.
        This also sets the protocol state to HANDSHAKE_WRITE and generates an ephemeral keypair.
        """

        BaseDaemon.__init__(self, circuit)

        self.state = HANDSHAKE_WRITE
        self.ekeypair = createEphemeralKeypair()
        self.epub = bytes("")