Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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('')
Ejemplo n.º 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("")