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 /apps | |
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 'apps')
-rwxr-xr-x | apps/ca.c | 2 | ||||
-rw-r--r-- | apps/crl.c | 3 | ||||
-rw-r--r-- | apps/enc.c | 2 | ||||
-rw-r--r-- | apps/speed.c | 8 | ||||
-rw-r--r-- | apps/x509.c | 2 |
5 files changed, 8 insertions, 9 deletions
@@ -821,7 +821,7 @@ end_of_options: } if (verbose) BIO_printf(bio_err, "message digest is %s\n", - OBJ_nid2ln(EVP_MD_type(dgst))); + EVP_MD_name(dgst)); if (policy == NULL && (policy = lookup_conf(conf, section, ENV_POLICY)) == NULL) goto end; diff --git a/apps/crl.c b/apps/crl.c index e2ed9588e6..e8b501a8af 100644 --- a/apps/crl.c +++ b/apps/crl.c @@ -347,8 +347,7 @@ int crl_main(int argc, char **argv) BIO_printf(bio_err, "out of memory\n"); goto end; } - BIO_printf(bio_out, "%s Fingerprint=", - OBJ_nid2sn(EVP_MD_type(digest))); + BIO_printf(bio_out, "%s Fingerprint=", EVP_MD_name(digest)); for (j = 0; j < (int)n; j++) { BIO_printf(bio_out, "%02X%c", md[j], (j + 1 == (int)n) ? '\n' : ':'); diff --git a/apps/enc.c b/apps/enc.c index c5766f05e8..498d0d500b 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -360,7 +360,7 @@ int enc_main(int argc, char **argv) char prompt[200]; BIO_snprintf(prompt, sizeof(prompt), "enter %s %s password:", - OBJ_nid2ln(EVP_CIPHER_nid(cipher)), + EVP_CIPHER_name(cipher), (enc) ? "encryption" : "decryption"); strbuf[0] = '\0'; i = EVP_read_pw_string((char *)strbuf, SIZE, prompt, enc); diff --git a/apps/speed.c b/apps/speed.c index 727341a1e6..25c384d775 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -1758,7 +1758,7 @@ int speed_main(int argc, char **argv) } else if (!(EVP_CIPHER_flags(evp_cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { BIO_printf(bio_err, "%s is not an AEAD cipher\n", - OBJ_nid2ln(EVP_CIPHER_nid(evp_cipher))); + EVP_CIPHER_name(evp_cipher)); goto end; } } @@ -1770,7 +1770,7 @@ int speed_main(int argc, char **argv) } else if (!(EVP_CIPHER_flags(evp_cipher) & EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)) { BIO_printf(bio_err, "%s is not a multi-block capable\n", - OBJ_nid2ln(EVP_CIPHER_nid(evp_cipher))); + EVP_CIPHER_name(evp_cipher)); goto end; } else if (async_jobs > 0) { BIO_printf(bio_err, "Async mode is not supported with -mb"); @@ -2219,7 +2219,7 @@ int speed_main(int argc, char **argv) goto end; } - names[D_EVP] = OBJ_nid2ln(EVP_CIPHER_nid(evp_cipher)); + names[D_EVP] = EVP_CIPHER_name(evp_cipher); if (EVP_CIPHER_mode(evp_cipher) == EVP_CIPH_CCM_MODE) { loopfunc = EVP_Update_loop_ccm; @@ -3633,7 +3633,7 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single, if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_MAC_KEY, sizeof(no_key), no_key)) app_bail_out("failed to set AEAD key\n"); - if ((alg_name = OBJ_nid2ln(EVP_CIPHER_nid(evp_cipher))) == NULL) + if ((alg_name = EVP_CIPHER_name(evp_cipher)) == NULL) app_bail_out("failed to get cipher name\n"); for (j = 0; j < num; j++) { diff --git a/apps/x509.c b/apps/x509.c index 163c1c8a67..abbffe37ab 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -978,7 +978,7 @@ int x509_main(int argc, char **argv) BIO_printf(bio_err, "Out of memory\n"); goto end; } - BIO_printf(out, "%s Fingerprint=", OBJ_nid2sn(EVP_MD_type(fdig))); + BIO_printf(out, "%s Fingerprint=", EVP_MD_name(fdig)); for (j = 0; j < (int)n; j++) BIO_printf(out, "%02X%c", md[j], (j + 1 == (int)n) ? '\n' : ':'); } else if (i == ocspid) { |