- 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:
okir 2003-01-20 09:52:05 +00:00
parent 69f8588f47
commit 4867251671
1 changed files with 8 additions and 1 deletions

View File

@ -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