diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-03-26 17:57:16 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-04-01 14:39:54 +0200 |
commit | 5050fd5b3b7d18eec966469726180efb6c72c594 (patch) | |
tree | e053f3428efc6a235a8a5aadea37cb4a1dade30a /crypto/pem/pem_info.c | |
parent | b064eebb5080178de9641a0520e2f22b5846e0f3 (diff) |
Avoid going through NID when unnecessary
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14703)
Diffstat (limited to 'crypto/pem/pem_info.c')
-rw-r--r-- | crypto/pem/pem_info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/pem/pem_info.c b/crypto/pem/pem_info.c index c615d24ed0..54e29ab41f 100644 --- a/crypto/pem/pem_info.c +++ b/crypto/pem/pem_info.c @@ -282,7 +282,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, const X509_INFO *xi, EVP_CIPHER *enc, const unsigned char *iv = NULL; if (enc != NULL) { - objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); + objstr = EVP_CIPHER_name(enc); if (objstr == NULL /* * Check "Proc-Type: 4,Encrypted\nDEK-Info: objstr,hex-iv\n" @@ -317,7 +317,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, const X509_INFO *xi, EVP_CIPHER *enc, * than what the user has passed us ... as we have to match * exactly for some strange reason */ - objstr = OBJ_nid2sn(EVP_CIPHER_nid(xi->enc_cipher.cipher)); + objstr = EVP_CIPHER_name(xi->enc_cipher.cipher); if (objstr == NULL) { ERR_raise(ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER); goto err; |