[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Proposal: Use CK_UNAVAILABLE_INFORMATION with C_GetAttributeValue
So here we go again. This is simplified down just using CK_UNAVAILABLE_INFORMATION as the value set on attributes by C_GetAttributeValue when an attribute cannot be returned. This is based on the assumption that ~0UL == (CK_ULONG)-1. If anyone knows that the above is not true in some strange situation, then please speak up. Although note that we already make many assumptions about CK_ULONG size, bits, and so on. Hopefully this is now ready for vote and inclusion in v2.40. Cheers, Stef 9.4 Object Types o CK_ATTRIBUTE; CK_ATTRIBUTE_PTR ... *** Paragraph to be added | The constant CK_UNAVAILABLE_INFORMATION is used in the ulValueLen | field to denote an invalid or unavailable value. See | C_GetAttributeValue for further details. 11.7 Object management functions o C_GetAttributeValue ... *** Paragraph to be modified 1. If the specified attribute (i.e., the attribute specified by the type field) for the object cannot be revealed because the object is sensitive or unextractable, then the ulValueLen field in that | triple is modified to hold the value CK_UNAVAILABLE_INFORMATION. *** Paragraph to be modified 2. Otherwise, if the specified value for the object is invalid (the object does not possess such an attribute), then the ulValueLen field in that triple is modified to hold the value | CK_UNAVAILABLE_INFORMATION. *** Paragraph to be modified 5. Otherwise, the ulValueLen field is modified to hold the value | CK_UNAVAILABLE_INFORMATION. *** Paragraph to be modified In the special case of an attribute whose value is an array of attributes, for example CKA_WRAP_TEMPLATE, where it is passed in with pValue not NULL, then if the pValue of elements within the array is NULL_PTR then the ulValueLen of elements within the array will be set to the required length. If the pValue of elements within the array is not NULL_PTR, then the ulValueLen element of attributes within the array must reflect the space that the corresponding pValue points to, and pValue is filled in if there is sufficient room. Therefore it is important to initialize the contents of a buffer before calling C_GetAttributeValue to get such an array value. If any ulValueLen within the array isn't large enough, it will | be set to CK_UNAVAILABLE_INFORMATION and the function will return CKR_BUFFER_TOO_SMALL, as it does if an attribute in the pTemplate argument has ulValueLen too small. Note that any attribute whose value is an array of attributes is identifiable by virtue of the attribute type having the CKF_ARRAY_ATTRIBUTE bit set.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]