- fix sc_pkcs11_signature_size to return modulus size in bytes, not bits (Stef)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@869 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
69f8588f47
commit
4867251671
|
@ -389,9 +389,16 @@ sc_pkcs11_signature_size(sc_pkcs11_operation_t *operation, CK_ULONG_PTR pLength)
|
|||
{
|
||||
struct sc_pkcs11_object *key;
|
||||
CK_ATTRIBUTE attr = { CKA_MODULUS_BITS, pLength, sizeof(*pLength) };
|
||||
CK_RV rc;
|
||||
|
||||
key = ((struct signature_data *) operation->priv_data)->key;
|
||||
return key->ops->get_attribute(operation->session, key, &attr);
|
||||
rv = key->ops->get_attribute(operation->session, key, &attr);
|
||||
|
||||
/* convert bits to bytes */
|
||||
if (rv == CKR_OK)
|
||||
*pLength = (*pLength + 7) / 8;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue