summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ckcapi-key.c27
1 files changed, 26 insertions, 1 deletions
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;
/*