diff --git a/src/tools/pkcs11-tool.c b/src/tools/pkcs11-tool.c index 4caa4abe..4890c18c 100644 --- a/src/tools/pkcs11-tool.c +++ b/src/tools/pkcs11-tool.c @@ -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);