From f22ca594d066f305c5c289dc522b2a13917234d0 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 9 Dec 2008 18:49:32 +0000 Subject: Fix a particularly nasty bug in the hash tables, where an old would continue to get used when the value was replaced. Also a bunch of memory allocation tuning. --- ckcapi-key.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ckcapi-key.c') diff --git a/ckcapi-key.c b/ckcapi-key.c index 5cf60ba..abf37de 100644 --- a/ckcapi-key.c +++ b/ckcapi-key.c @@ -533,7 +533,7 @@ key_date_attribute(CkCapiObjectData* objdata, CK_ATTRIBUTE_PTR attr) */ case CKA_END_DATE: case CKA_START_DATE: - return CKR_ATTRIBUTE_TYPE_INVALID; + return ckcapi_return_data(attr, "", 0); default: return CKR_ATTRIBUTE_TYPE_INVALID; @@ -774,7 +774,7 @@ register_key_object(CkCapiSession* sess, CK_OBJECT_CLASS cls, ASSERT(key_identifier); ASSERT(cls == CKO_PRIVATE_KEY || cls == CKO_PUBLIC_KEY); - kobj = calloc(sizeof(KeyObject) + key_identifier->cbData, 1); + kobj = calloc(1, sizeof(KeyObject) + key_identifier->cbData); if(!kobj) return CKR_HOST_MEMORY; -- cgit v1.2.3