コード例 #1
0
ファイル: test_ntor.py プロジェクト: nskinkel/oppy
    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')
コード例 #2
0
ファイル: circuitbuildtask.py プロジェクト: nskinkel/oppy
 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)
コード例 #3
0
    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')
コード例 #4
0
ファイル: circuitbuildtask.py プロジェクト: zyk2290/oppy
 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)
コード例 #5
0
ファイル: circuitbuildtask.py プロジェクト: nskinkel/oppy
 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)
コード例 #6
0
ファイル: circuitbuildtask.py プロジェクト: zyk2290/oppy
 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)