summaryrefslogtreecommitdiff
path: root/ckcapi-object.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2007-05-06 02:02:09 +0000
committerStef Walter <stef@memberwebs.com>2007-05-06 02:02:09 +0000
commit16be360038c56328695f1dd8133718f82cd0c36c (patch)
tree9428cd853b4561b4590d4102ee81bd57261826b9 /ckcapi-object.c
parent856a057fc0a0807e9c0dd2b11c04e1f1312bdb12 (diff)
A bunch of trust work on the plugin.
Diffstat (limited to 'ckcapi-object.c')
-rw-r--r--ckcapi-object.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ckcapi-object.c b/ckcapi-object.c
index 49da8eb..4bc0ce1 100644
--- a/ckcapi-object.c
+++ b/ckcapi-object.c
@@ -1,6 +1,8 @@
#include "ckcapi.h"
+#include "pkcs11/pkcs11n.h"
+
#include <memory.h>
#include <wtypes.h>
@@ -208,6 +210,14 @@ attribute_data_type(CK_ATTRIBUTE_TYPE type)
case CKA_BITS_PER_PIXEL:
case CKA_MECHANISM_TYPE:
case CKA_JAVA_MIDP_SECURITY_DOMAIN:
+ case CKA_TRUST_SERVER_AUTH:
+ case CKA_TRUST_CLIENT_AUTH:
+ case CKA_TRUST_CODE_SIGNING:
+ case CKA_TRUST_EMAIL_PROTECTION:
+ case CKA_TRUST_IPSEC_END_SYSTEM:
+ case CKA_TRUST_IPSEC_TUNNEL:
+ case CKA_TRUST_IPSEC_USER:
+ case CKA_TRUST_TIME_STAMPING:
return DATA_ULONG;
// CK_BBOOL attribute types
@@ -234,6 +244,7 @@ attribute_data_type(CK_ATTRIBUTE_TYPE type)
case CKA_RESET_ON_INIT:
case CKA_HAS_RESET:
case CKA_COLOR:
+ case CKA_TRUST_STEP_UP_APPROVED:
return DATA_BOOL;
// Raw or string data
@@ -272,6 +283,8 @@ attribute_data_type(CK_ATTRIBUTE_TYPE type)
case CKA_REQUIRED_CMS_ATTRIBUTES:
case CKA_DEFAULT_CMS_ATTRIBUTES:
case CKA_SUPPORTED_CMS_ATTRIBUTES:
+ case CKA_CERT_SHA1_HASH:
+ case CKA_CERT_MD5_HASH:
return DATA_BYTES;
// CK_DATE data
@@ -284,6 +297,7 @@ attribute_data_type(CK_ATTRIBUTE_TYPE type)
case CKA_ALLOWED_MECHANISMS:
case CKA_UNWRAP_TEMPLATE:
default:
+ DBG(("unknown attribute type: %x\n", type));
return DATA_UNKNOWN;
};
}
@@ -331,9 +345,15 @@ ckcapi_object_data_match_attr(CkCapiObjectData* objdata, CK_ATTRIBUTE_PTR match)
break;
};
+ /* Unrecognized attribute */
+ if(rv == CKR_ATTRIBUTE_TYPE_INVALID)
+ return CK_FALSE;
+
/* Value is longer than this one */
if(rv == CKR_BUFFER_TOO_SMALL)
return CK_FALSE;
+
+ /* All other errors */
if(rv != CKR_OK)
return CK_FALSE;
@@ -413,6 +433,7 @@ ckcapi_object_data_get_attrs(CkCapiObjectData* objdata, CK_ATTRIBUTE_PTR attrs,
/* Attribute doesn't exist */
else if(rv == CKR_ATTRIBUTE_TYPE_INVALID)
{
+ DBG(("O%d: attribute not found: 0x%08x", objdata->object, attrs[i].type));
attrs[i].ulValueLen = (CK_ULONG)-1;
}