If we want to test signing, first see if the key can do this
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2409 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
be65c3804e
commit
7939f0b010
|
@ -2345,7 +2345,7 @@ test_signature(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
|
||||||
modLenBits = get_private_key_length(sess, privKeyObject);
|
modLenBits = get_private_key_length(sess, privKeyObject);
|
||||||
modLenBytes = (modLenBits + 7) / 8;
|
modLenBytes = (modLenBits + 7) / 8;
|
||||||
|
|
||||||
printf(" testing key %d (%u bits%s%s) with 1 signature mechanism\n",
|
printf(" testing key %d (%u bits%s%s) with 1 signature mechanism",
|
||||||
(int) (j-1),
|
(int) (j-1),
|
||||||
(int) modLenBits,
|
(int) modLenBits,
|
||||||
label? ", label=" : "",
|
label? ", label=" : "",
|
||||||
|
@ -2353,6 +2353,13 @@ test_signature(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
|
||||||
if (label)
|
if (label)
|
||||||
free(label);
|
free(label);
|
||||||
|
|
||||||
|
if (!getSIGN(sess, privKeyObject)) {
|
||||||
|
printf(" -- can't be used to sign/verify, skipping\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
errors += sign_verify_openssl(slot, sess, &ck_mech, privKeyObject,
|
errors += sign_verify_openssl(slot, sess, &ck_mech, privKeyObject,
|
||||||
datas[i], dataLens[i], verifyData, sizeof(verifyData),
|
datas[i], dataLens[i], verifyData, sizeof(verifyData),
|
||||||
modLenBytes, i);
|
modLenBytes, i);
|
||||||
|
|
Loading…
Reference in New Issue