예제 #1
0
파일: test_ntor.py 프로젝트: nskinkel/oppy
    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)
예제 #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)
예제 #3
0
파일: test_ntor.py 프로젝트: nskinkel/oppy
    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')
예제 #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')