diff options
-rw-r--r-- | ckcapi-builtin.c | 17 |
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++; |