diff options
author | Richard Levitte <levitte@openssl.org> | 2021-03-10 12:58:53 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-04-18 10:10:24 +0200 |
commit | ad57a13bb86949a9e9adc7a2960e3f39e3e5b284 (patch) | |
tree | 67bfce29a5498715b5979c7b8f19baa3f313ddd8 /crypto/crmf/crmf_lib.c | |
parent | 42423ac9611e0cbb02c93b3c5661328f324f9d08 (diff) |
Modify OBJ_nid2sn(OBJ_obj2nid(...)) occurences to use OBJ_obj2txt()
The intention is to allow for OIDs for which libcrypto has no
information, but are still fetchable for OSSL_ALGORITHM
implementations that specify an OID amongst their names.
Fixes #14278
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14498)
Diffstat (limited to 'crypto/crmf/crmf_lib.c')
-rw-r--r-- | crypto/crmf/crmf_lib.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/crypto/crmf/crmf_lib.c b/crypto/crmf/crmf_lib.c index cb443ff850..4a4c30c386 100644 --- a/crypto/crmf/crmf_lib.c +++ b/crypto/crmf/crmf_lib.c @@ -594,7 +594,6 @@ X509 unsigned char *iv = NULL; /* initial vector for symmetric encryption */ unsigned char *outbuf = NULL; /* decryption output buffer */ const unsigned char *p = NULL; /* needed for decoding ASN1 */ - int symmAlg = 0; /* NIDs for symmetric algorithm */ int n, outlen = 0; EVP_PKEY_CTX *pkctx = NULL; /* private key context */ @@ -603,12 +602,8 @@ X509 ERR_raise(ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT); return NULL; } - if ((symmAlg = OBJ_obj2nid(ecert->symmAlg->algorithm)) == 0) { - ERR_raise(ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_CIPHER); - return NULL; - } /* select symmetric cipher based on algorithm given in message */ - if ((cipher = EVP_get_cipherbynid(symmAlg)) == NULL) { + if ((cipher = EVP_get_cipherbyobj(ecert->symmAlg->algorithm)) == NULL) { ERR_raise(ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_CIPHER); goto end; } |