Пример #1
0
 def test_sign_validate_method_altered(self):
     data = ['mykey', 'myvalue', 'valuetype']
     sig = XmlStorageBackend.sign(*data)
     sig = _alter_str(sig, 3)
     self.assertTrue(sig)
     r = XmlStorageBackend.validate(sig, *data)
     self.assertFalse(r, 'Signature validated incorrectly after altering')
Пример #2
0
 def test_validate_method(self):
     golden_sig = b'4U+ZV6b63EaA1GEOqlsRJSpFjOc='
     data = ['mykey', 'myvalue', 'valuetype']
     r = XmlStorageBackend.validate(golden_sig, *data)
     self.assertTrue(r, 'Signature check failed')
Пример #3
0
 def test_sign_validate_method(self):
     data = ['mykey', 'myvalue', 'valuetype']
     sig = XmlStorageBackend.sign(*data)
     self.assertTrue(sig)
     r = XmlStorageBackend.validate(sig, *data)
     self.assertTrue(r, 'Signature check failed')