summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-12-08 18:33:10 +0000
committerStef Walter <stef@memberwebs.com>2008-12-08 18:33:10 +0000
commit10ce78813bb38410a13aa7def2b37668490f7530 (patch)
tree9a700bd298a5bd47c4baaf073219e2bffa06306a
parenta4ec22d7c99f9abe749f7ac6891d24091babb764 (diff)
Return data correctly for builtin objects.
-rw-r--r--ckcapi-builtin.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/ckcapi-builtin.c b/ckcapi-builtin.c
index cc1cb78..1be3ccc 100644
--- a/ckcapi-builtin.c
+++ b/ckcapi-builtin.c
@@ -105,22 +105,7 @@ builtin_attribute(CkCapiObjectData* objdata, CK_ATTRIBUTE_PTR attr)
{
if(builtin->ulValueLen == 0)
return CKR_ATTRIBUTE_TYPE_INVALID;
-
- if(attr->pValue)
- {
- attr->ulValueLen = builtin->ulValueLen;
- return CKR_OK;
- }
-
- if(builtin->ulValueLen > attr->ulValueLen)
- {
- attr->ulValueLen = builtin->ulValueLen;
- return CKR_BUFFER_TOO_SMALL;
- }
-
- attr->ulValueLen = builtin->ulValueLen;
- memcpy(attr->pValue, builtin->pValue, builtin->ulValueLen);
- return CKR_OK;
+ return ckcapi_return_data(attr, builtin->pValue, builtin->ulValueLen);
}
builtin++;