Print well formated report from decryption stage and do not fail with OAEP mechanisms
This commit is contained in:
parent
0a8213f3d4
commit
41b55b93d4
|
@ -4864,7 +4864,7 @@ static int encrypt_decrypt(CK_SESSION_HANDLE session,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (EVP_PKEY_size(pkey) > (int)sizeof(encrypted)) {
|
if (EVP_PKEY_size(pkey) > (int)sizeof(encrypted)) {
|
||||||
fprintf(stderr, "Ciphertext buffer too small\n");
|
printf("Ciphertext buffer too small\n");
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -4875,14 +4875,14 @@ static int encrypt_decrypt(CK_SESSION_HANDLE session,
|
||||||
#endif
|
#endif
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
if (((int) encrypted_len) <= 0) {
|
if (((int) encrypted_len) <= 0) {
|
||||||
fprintf(stderr, "Encryption failed, returning\n");
|
printf("Encryption failed, returning\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mech.mechanism = mech_type;
|
mech.mechanism = mech_type;
|
||||||
rv = p11->C_DecryptInit(session, &mech, privKeyObject);
|
rv = p11->C_DecryptInit(session, &mech, privKeyObject);
|
||||||
if (rv == CKR_MECHANISM_INVALID) {
|
if (rv == CKR_MECHANISM_INVALID || rv == CKR_MECHANISM_PARAM_INVALID) {
|
||||||
fprintf(stderr, "Mechanism not supported\n");
|
printf("Mechanism not supported\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (rv != CKR_OK)
|
if (rv != CKR_OK)
|
||||||
|
|
Loading…
Reference in New Issue