If a PKCS11 get attrribute failes for some reason, pkcs11-tool may return
garbage along with the error message. The attached patch to pkcs11-tool.c initializes the type to 0 so the attribute will be 0 in case of an error. by Douglas E. Engert git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3172 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
f065546ccd
commit
6c324049e7
|
@ -1535,7 +1535,7 @@ find_mechanism(CK_SLOT_ID slot, CK_FLAGS flags, int stop_if_not_found)
|
|||
static TYPE \
|
||||
get##ATTR(CK_SESSION_HANDLE sess, CK_OBJECT_HANDLE obj) \
|
||||
{ \
|
||||
TYPE type; \
|
||||
TYPE type = 0; \
|
||||
CK_ATTRIBUTE attr = { CKA_##ATTR, &type, sizeof(type) }; \
|
||||
CK_RV rv; \
|
||||
\
|
||||
|
|
Loading…
Reference in New Issue