def test_createOnionSkin(self): mock_nts = mock.Mock() mock_nts.relay_identity = 'ident' mock_nts.relay_ntor_onion_key = 'ntork' mock_nts.public_key = 'pk' self.assertEqual(ntor.createOnionSkin(mock_nts), 'identntorkpk')
def _sendExtend2Cell(self, _, path_node): lspecs = [LinkSpecifier(path_node), LinkSpecifier(path_node, legacy=True)] self._hs_state = ntor.NTorState(path_node.microdescriptor) onion_skin = ntor.createOnionSkin(self._hs_state) extend2 = RelayExtend2Cell.make(self.circuit_id, nspec=len(lspecs), lspecs=lspecs, hdata=onion_skin) crypt_cell = crypto.encryptCell(extend2, self._crypt_path, early=True) self._conn.send(crypt_cell)
def _sendExtend2Cell(self, _, path_node): lspecs = [ LinkSpecifier(path_node), LinkSpecifier(path_node, legacy=True) ] self._hs_state = ntor.NTorState(path_node.microdescriptor) onion_skin = ntor.createOnionSkin(self._hs_state) extend2 = RelayExtend2Cell.make(self.circuit_id, nspec=len(lspecs), lspecs=lspecs, hdata=onion_skin) crypt_cell = crypto.encryptCell(extend2, self._crypt_path, early=True) self._conn.send(crypt_cell)
def _sendCreate2Cell(self, _, path_node): self._hs_state = ntor.NTorState(path_node.microdescriptor) onion_skin = ntor.createOnionSkin(self._hs_state) create2 = Create2Cell.make(self.circuit_id, hdata=onion_skin) self._conn.send(create2)