diff options
author | Richard Levitte <levitte@openssl.org> | 2020-08-29 10:46:24 +0300 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-09-13 21:52:48 +0300 |
commit | ec0ce188f44b7ab261b1d691e34913b338479b1f (patch) | |
tree | 46b93af67b4dc2340b3ebe2a199bcfb8ed8dbfaf /crypto/evp/evp_enc.c | |
parent | 225c9660a5a3435d9bcfc9166b9f79f132996249 (diff) |
EVP: Centralise fetching error reporting
Instead of sometimes, and sometimes not reporting an error in the
caller of EVP_XXX_fetch(), where the error may or may not be very
accurate, it's now centralised to the inner EVP fetch functionality.
It's made in such a way that it can determine if an error occured
because the algorithm in question is not there, or if something else
went wrong, and will report EVP_R_UNSUPPORTED_ALGORITHM for the
former, and EVP_R_FETCH_FAILED for the latter.
This helps our own test/evp_test.c when it tries to figure out why an
EVP_PKEY it tried to load failed to do so.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12857)
Diffstat (limited to 'crypto/evp/evp_enc.c')
-rw-r--r-- | crypto/evp/evp_enc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 71b5386232..62c0966409 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -174,10 +174,8 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, : OBJ_nid2sn(cipher->nid), ""); - if (provciph == NULL) { - EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR); + if (provciph == NULL) return 0; - } cipher = provciph; EVP_CIPHER_free(ctx->fetched_cipher); ctx->fetched_cipher = provciph; |