From c2c73dfc3ff6c94aa5615c1c8047ed8b862f7b6f Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 18 Nov 2011 13:22:40 +0100 Subject: gcr: Implement functions for loading and using SubjectPublicKeyInfo * Move key calculation routines into gcr-subject-public-key.c * Move creation of SPK from gcr-fingerprint.c into here * Implement loading of SPK from PKCS#11 certificates, public keys, private keys * Add support for parsing SubjectPublicKeyInfo to parser. Generates attributes for a CKO_PUBLIC_KEY * Fix bugs in DER encoding related to this. * More tweaks on testing infrastructure --- gck/gck-mock.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gck') diff --git a/gck/gck-mock.c b/gck/gck-mock.c index a1fdba9..716b149 100644 --- a/gck/gck-mock.c +++ b/gck/gck-mock.c @@ -913,13 +913,12 @@ gck_mock_C_GetAttributeValue (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObje CK_ULONG i; session = g_hash_table_lookup (the_sessions, GUINT_TO_POINTER (hSession)); - g_return_val_if_fail (session, CKR_SESSION_HANDLE_INVALID); + if (session == NULL) + return CKR_SESSION_HANDLE_INVALID; attrs = lookup_object (session, hObject); - if (!attrs) { - g_assert_not_reached (); /* "invalid object handle passed" */ + if (!attrs) return CKR_OBJECT_HANDLE_INVALID; - } for (i = 0; i < ulCount; ++i) { result = pTemplate + i; -- cgit v1.2.3