Ejemplo n.º 1
0
    def test_buildSecretInput_bad_EXP(self, mock_exp):
        mock_nts = mock.Mock()
        mock_nts.relay_identity = 'ident'
        mock_nts.relay_ntor_onion_key = 'ntork'
        mock_nts.public_key = 'pk'
        relay_pk = 'relay_pk'

        v, b = ntor._buildSecretInput(mock_nts, relay_pk)
        self.assertTrue(b)
Ejemplo n.º 2
0
    def test_buildSecretInput_bad_EXP(self, mock_exp):
        mock_nts = mock.Mock()
        mock_nts.relay_identity = 'ident'
        mock_nts.relay_ntor_onion_key = 'ntork'
        mock_nts.public_key = 'pk'
        relay_pk = 'relay_pk'

        v, b = ntor._buildSecretInput(mock_nts, relay_pk)
        self.assertTrue(b)
Ejemplo n.º 3
0
    def test_buildAuthInput(self, mock_exp):
        mock_nts = mock.Mock()
        mock_nts.relay_identity = 'ident'
        mock_nts.relay_ntor_onion_key = 'ntork'
        mock_nts.public_key = 'pk'
        relay_pk = 'relay_pk'

        v, b = ntor._buildSecretInput(mock_nts, relay_pk)
        
        self.assertEqual(mock_exp.call_count, 2)
        self.assertFalse(b)
        self.assertEqual(v,
            'expexpidentntorkpkrelay_pkntor-curve25519-sha256-1')
Ejemplo n.º 4
0
    def test_buildAuthInput(self, mock_exp):
        mock_nts = mock.Mock()
        mock_nts.relay_identity = 'ident'
        mock_nts.relay_ntor_onion_key = 'ntork'
        mock_nts.public_key = 'pk'
        relay_pk = 'relay_pk'

        v, b = ntor._buildSecretInput(mock_nts, relay_pk)

        self.assertEqual(mock_exp.call_count, 2)
        self.assertFalse(b)
        self.assertEqual(v,
                         'expexpidentntorkpkrelay_pkntor-curve25519-sha256-1')