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:
sth 2005-07-15 13:37:38 +00:00
parent be65c3804e
commit 7939f0b010
1 changed files with 8 additions and 1 deletions

View File

@ -2345,7 +2345,7 @@ test_signature(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
modLenBits = get_private_key_length(sess, privKeyObject);
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) modLenBits,
label? ", label=" : "",
@ -2353,6 +2353,13 @@ test_signature(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
if (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,
datas[i], dataLens[i], verifyData, sizeof(verifyData),
modLenBytes, i);