diff --git a/npa/src/opensc b/npa/src/opensc index 622b719..db60f8d 160000 --- a/npa/src/opensc +++ b/npa/src/opensc @@ -1 +1 @@ -Subproject commit 622b71970f3ab3e42341b3655aa59e5420369d28 +Subproject commit db60f8da59ef05fa987decfc5a6b5abb9bc93f42 diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/tests/CryptoUtils_test.py b/virtualsmartcard/src/vpicc/virtualsmartcard/tests/CryptoUtils_test.py index d0743fa..e73a779 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/tests/CryptoUtils_test.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/tests/CryptoUtils_test.py @@ -25,6 +25,12 @@ class TestCryptoUtils(unittest.TestCase): def setUp(self): self.teststring = "DEADBEEFistatsyksdvhwohfwoehcowc8hw8rogfq8whv75tsgohsav8wress" self.testpass = "SomeRandomPassphrase" + # The following string was generated using the proteced string method and + # is used as regression test. + # The data generated by protect_string should actually consist of + # printable characters only but that would break backwards + # compatibility with the (buggy) legacy implementation + self.protectedTestString = "2470356b322424504f63775949487224ffa330e33b2d76b82e91a4c88ff722414d3522bcbdb8a4a45cd7c61963b52825e1361354d5b5efbcfeabfb66fa3f97dfecd5e57617b8e0172017785f4001e9653366363763323639363965313261386363623738326435326639653563633339".decode('hex') def test_padding(self): padded = append_padding(16, self.teststring) @@ -36,6 +42,9 @@ class TestCryptoUtils(unittest.TestCase): unprotectedString = read_protected_string(protectedString, self.testpass) self.assertEqual(self.teststring, unprotectedString) + def test_unprotect_string(self): + unprotectedString = read_protected_string(self.protectedTestString, self.testpass) + self.assertEqual(unprotectedString, self.teststring) if __name__ == "__main__": unittest.main()