[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/master] Add unittest for crypto.removePKCS1Padding() when identifier is missing.



commit f6d33af50ed6031ead7be7149902e92a507d31de
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Fri Mar 20 04:53:02 2015 +0000

    Add unittest for crypto.removePKCS1Padding() when identifier is missing.
---
 lib/bridgedb/test/test_crypto.py |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/bridgedb/test/test_crypto.py b/lib/bridgedb/test/test_crypto.py
index da93f07..c2010ca 100644
--- a/lib/bridgedb/test/test_crypto.py
+++ b/lib/bridgedb/test/test_crypto.py
@@ -283,6 +283,14 @@ class RemovePKCS1PaddingTests(unittest.TestCase):
                           crypto.removePKCS1Padding,
                           self.blob)
 
+    def test_crypto_removePKCS1Padding_missing_padding(self):
+        """removePKCS1Padding() with a blob with a missing PKCS#1 identifier
+        mark should raise PKCS1PaddingError.
+        """
+        self.assertRaises(crypto.PKCS1PaddingError,
+                          crypto.removePKCS1Padding,
+                          b'\x99' + self.blob)
+
 
 class SSLVerifyingContextFactoryTests(unittest.TestCase,
                                       txtagent.FakeReactorAndConnectMixin):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits