From ad57a13bb86949a9e9adc7a2960e3f39e3e5b284 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 10 Mar 2021 12:58:53 +0100 Subject: 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 (Merged from https://github.com/openssl/openssl/pull/14498) --- crypto/crmf/crmf_lib.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'crypto/crmf/crmf_lib.c') 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; } -- cgit v1.2.3