[Cryptech-Commits] [sw/pkcs11] 01/03: Better test for keypair object class.

git at cryptech.is git at cryptech.is
Tue Sep 22 17:26:13 UTC 2015

This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch ecdsa
in repository sw/pkcs11.

commit 6c9f61a27667843f245630c67f332cad7630e876
Author: Rob Austein <sra at hactrn.net>
Date:   Mon Sep 21 23:40:19 2015 -0400

    Better test for keypair object class.
 unit_tests.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/unit_tests.py b/unit_tests.py
index b82a479..cd47886 100644
--- a/unit_tests.py
+++ b/unit_tests.py
@@ -126,8 +126,8 @@ class TestKeys(unittest.TestCase):
   def assertIsKeypair(self, public_handle, private_handle = None):
     if isinstance(public_handle, tuple) and private_handle is None:
       public_handle, private_handle = public_handle
-    self.assertEqual(p11.C_GetAttributeValue(self.session, public_handle,  CKA_CLASS)[CKA_CLASS], CKO_PUBLIC_KEY)
-    self.assertEqual(p11.C_GetAttributeValue(self.session, private_handle, CKA_CLASS)[CKA_CLASS], CKO_PRIVATE_KEY)
+    self.assertEqual(p11.C_GetAttributeValue(self.session, public_handle,  CKA_CLASS), {CKA_CLASS: CKO_PUBLIC_KEY})
+    self.assertEqual(p11.C_GetAttributeValue(self.session, private_handle, CKA_CLASS), {CKA_CLASS: CKO_PRIVATE_KEY})
   def test_keygen_token_vs_session(self):

More information about the Commits mailing list