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)
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)
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('')
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("")