From e89d0fa8e27a6ffce016228ff10bb14b77fad577 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 9 Dec 2008 19:04:44 +0000 Subject: Add some remaining attributes. --- ckcapi-key.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/ckcapi-key.c b/ckcapi-key.c index 69c845d..34a6ae1 100644 --- a/ckcapi-key.c +++ b/ckcapi-key.c @@ -313,6 +313,32 @@ key_bool_attribute(CkCapiObjectData* objdata, CK_ATTRIBUTE_PTR attr) val = CK_TRUE; break; + /* + * Is this key trusted? + * - A nebulous question. + */ + case CKA_TRUSTED: + val = CK_FALSE; + break; + + /* + * Key wrapping with public keys. + */ + case CKA_WRAP: + if(is_private) + return CKR_ATTRIBUTE_TYPE_INVALID; + val = CK_FALSE; + break; + + /* + * Key wrapping on private keys. + */ + case CKA_WRAP_WITH_TRUSTED: + if(!is_private) + return CKR_ATTRIBUTE_TYPE_INVALID; + val = CK_FALSE; + break; + /* * Can do a unwrap operation? * - We don't implement this. @@ -326,7 +352,6 @@ key_bool_attribute(CkCapiObjectData* objdata, CK_ATTRIBUTE_PTR attr) * - We don't implement this. */ case CKA_UNWRAP_TEMPLATE: - case CKA_WRAP_WITH_TRUSTED: return CKR_ATTRIBUTE_TYPE_INVALID; /* -- cgit v1.2.3