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