diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-05-21 16:58:08 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-06-01 12:40:00 +0200 |
commit | ed576acdf591d4164905ab98e89ca5a3b99d90ab (patch) | |
tree | c0f36ca1b3d42f34c0c502e700ad09b69b713d3c /apps | |
parent | 5e2d22d53ed322a7124e26a4fbd116a8210eb77a (diff) |
Rename all getters to use get/get0 in name
For functions that exist in 1.1.1 provide a simple aliases via #define.
Fixes #15236
Functions with OSSL_DECODER_, OSSL_ENCODER_, OSSL_STORE_LOADER_,
EVP_KEYEXCH_, EVP_KEM_, EVP_ASYM_CIPHER_, EVP_SIGNATURE_,
EVP_KEYMGMT_, EVP_RAND_, EVP_MAC_, EVP_KDF_, EVP_PKEY_,
EVP_MD_, and EVP_CIPHER_ prefixes are renamed.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15405)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/cms.c | 2 | ||||
-rw-r--r-- | apps/crl.c | 3 | ||||
-rw-r--r-- | apps/dgst.c | 8 | ||||
-rw-r--r-- | apps/dsa.c | 2 | ||||
-rw-r--r-- | apps/ec.c | 2 | ||||
-rw-r--r-- | apps/enc.c | 32 | ||||
-rw-r--r-- | apps/gendsa.c | 4 | ||||
-rw-r--r-- | apps/genpkey.c | 2 | ||||
-rw-r--r-- | apps/lib/s_cb.c | 14 | ||||
-rw-r--r-- | apps/list.c | 157 | ||||
-rw-r--r-- | apps/pkeyutl.c | 6 | ||||
-rw-r--r-- | apps/rehash.c | 2 | ||||
-rw-r--r-- | apps/req.c | 2 | ||||
-rw-r--r-- | apps/rsa.c | 2 | ||||
-rw-r--r-- | apps/rsautl.c | 2 | ||||
-rw-r--r-- | apps/s_client.c | 6 | ||||
-rw-r--r-- | apps/speed.c | 34 | ||||
-rw-r--r-- | apps/ts.c | 6 |
18 files changed, 146 insertions, 140 deletions
diff --git a/apps/cms.c b/apps/cms.c index da00ece93b..81112c5a38 100644 --- a/apps/cms.c +++ b/apps/cms.c @@ -1013,7 +1013,7 @@ int cms_main(int argc, char **argv) res = EVP_PKEY_CTX_ctrl(pctx, -1, -1, EVP_PKEY_CTRL_CIPHER, - EVP_CIPHER_nid(cipher), NULL); + EVP_CIPHER_get_nid(cipher), NULL); if (res <= 0 && res != -2) goto end; diff --git a/apps/crl.c b/apps/crl.c index 8904cc08c7..ff7c314717 100644 --- a/apps/crl.c +++ b/apps/crl.c @@ -347,7 +347,8 @@ int crl_main(int argc, char **argv) BIO_printf(bio_err, "out of memory\n"); goto end; } - BIO_printf(bio_out, "%s Fingerprint=", EVP_MD_name(digest)); + BIO_printf(bio_out, "%s Fingerprint=", + EVP_MD_get0_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/dgst.c b/apps/dgst.c index e39d645cb8..36a8c6fb08 100644 --- a/apps/dgst.c +++ b/apps/dgst.c @@ -287,7 +287,7 @@ int dgst_main(int argc, char **argv) */ goto end; } - type = EVP_PKEY_id(sigkey); + type = EVP_PKEY_get_id(sigkey); if (type == EVP_PKEY_ED25519 || type == EVP_PKEY_ED448) { /* * We implement PureEdDSA for these which doesn't have a separate @@ -381,7 +381,7 @@ int dgst_main(int argc, char **argv) BIO_printf(bio_err, "Error opening signature file %s\n", sigfile); goto end; } - siglen = EVP_PKEY_size(sigkey); + siglen = EVP_PKEY_get_size(sigkey); sigbuf = app_malloc(siglen, "signature buffer"); siglen = BIO_read(sigbio, sigbuf, siglen); BIO_free(sigbio); @@ -399,10 +399,10 @@ int dgst_main(int argc, char **argv) md = EVP_MD_CTX_get1_md(tctx); } if (md != NULL) - md_name = EVP_MD_name(md); + md_name = EVP_MD_get0_name(md); if (xoflen > 0) { - if (!(EVP_MD_flags(md) & EVP_MD_FLAG_XOF)) { + if (!(EVP_MD_get_flags(md) & EVP_MD_FLAG_XOF)) { BIO_printf(bio_err, "Length can only be specified for XOF\n"); goto end; } diff --git a/apps/dsa.c b/apps/dsa.c index abb422132a..51c0284353 100644 --- a/apps/dsa.c +++ b/apps/dsa.c @@ -269,7 +269,7 @@ int dsa_main(int argc, char **argv) /* Passphrase setup */ if (enc != NULL) - OSSL_ENCODER_CTX_set_cipher(ectx, EVP_CIPHER_name(enc), NULL); + OSSL_ENCODER_CTX_set_cipher(ectx, EVP_CIPHER_get0_name(enc), NULL); /* Default passphrase prompter */ if (enc != NULL || outformat == FORMAT_PVK) { @@ -260,7 +260,7 @@ int ec_main(int argc, char **argv) output_type, output_structure, NULL); if (enc != NULL) { - OSSL_ENCODER_CTX_set_cipher(ectx, EVP_CIPHER_name(enc), NULL); + OSSL_ENCODER_CTX_set_cipher(ectx, EVP_CIPHER_get0_name(enc), NULL); /* Default passphrase prompter */ OSSL_ENCODER_CTX_set_passphrase_ui(ectx, get_ui_method(), NULL); if (passout != NULL) diff --git a/apps/enc.c b/apps/enc.c index cda0022ebb..f136c3f8df 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -300,11 +300,11 @@ int enc_main(int argc, char **argv) if (!opt_cipher(ciphername, &cipher)) goto opthelp; } - if (cipher && EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) { + if (cipher && EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) { BIO_printf(bio_err, "%s: AEAD ciphers not supported\n", prog); goto end; } - if (cipher && (EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE)) { + if (cipher && (EVP_CIPHER_get_mode(cipher) == EVP_CIPH_XTS_MODE)) { BIO_printf(bio_err, "%s XTS ciphers not supported\n", prog); goto end; } @@ -360,7 +360,7 @@ int enc_main(int argc, char **argv) char prompt[200]; BIO_snprintf(prompt, sizeof(prompt), "enter %s %s password:", - EVP_CIPHER_name(cipher), + EVP_CIPHER_get0_name(cipher), (enc) ? "encryption" : "decryption"); strbuf[0] = '\0'; i = EVP_read_pw_string((char *)strbuf, SIZE, prompt, enc); @@ -492,8 +492,8 @@ int enc_main(int argc, char **argv) * concatenated into a temporary buffer */ unsigned char tmpkeyiv[EVP_MAX_KEY_LENGTH + EVP_MAX_IV_LENGTH]; - int iklen = EVP_CIPHER_key_length(cipher); - int ivlen = EVP_CIPHER_iv_length(cipher); + int iklen = EVP_CIPHER_get_key_length(cipher); + int ivlen = EVP_CIPHER_get_iv_length(cipher); /* not needed if HASH_UPDATE() is fixed : */ int islen = (sptr != NULL ? sizeof(salt) : 0); if (!PKCS5_PBKDF2_HMAC(str, str_len, sptr, islen, @@ -525,7 +525,7 @@ int enc_main(int argc, char **argv) OPENSSL_cleanse(str, str_len); } if (hiv != NULL) { - int siz = EVP_CIPHER_iv_length(cipher); + int siz = EVP_CIPHER_get_iv_length(cipher); if (siz == 0) { BIO_printf(bio_err, "warning: iv not used by this cipher\n"); } else if (!set_hex(hiv, iv, siz)) { @@ -534,7 +534,7 @@ int enc_main(int argc, char **argv) } } if ((hiv == NULL) && (str == NULL) - && EVP_CIPHER_iv_length(cipher) != 0) { + && EVP_CIPHER_get_iv_length(cipher) != 0) { /* * No IV was explicitly set and no IV was generated. * Hence the IV is undefined, making correct decryption impossible. @@ -543,7 +543,7 @@ int enc_main(int argc, char **argv) goto end; } if (hkey != NULL) { - if (!set_hex(hkey, key, EVP_CIPHER_key_length(cipher))) { + if (!set_hex(hkey, key, EVP_CIPHER_get_key_length(cipher))) { BIO_printf(bio_err, "invalid hex key value\n"); goto end; } @@ -563,7 +563,7 @@ int enc_main(int argc, char **argv) if (!EVP_CipherInit_ex(ctx, cipher, e, NULL, NULL, enc)) { BIO_printf(bio_err, "Error setting cipher %s\n", - EVP_CIPHER_name(cipher)); + EVP_CIPHER_get0_name(cipher)); ERR_print_errors(bio_err); goto end; } @@ -573,7 +573,7 @@ int enc_main(int argc, char **argv) if (!EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, enc)) { BIO_printf(bio_err, "Error setting cipher %s\n", - EVP_CIPHER_name(cipher)); + EVP_CIPHER_get0_name(cipher)); ERR_print_errors(bio_err); goto end; } @@ -590,15 +590,15 @@ int enc_main(int argc, char **argv) printf("%02X", salt[i]); printf("\n"); } - if (EVP_CIPHER_key_length(cipher) > 0) { + if (EVP_CIPHER_get_key_length(cipher) > 0) { printf("key="); - for (i = 0; i < EVP_CIPHER_key_length(cipher); i++) + for (i = 0; i < EVP_CIPHER_get_key_length(cipher); i++) printf("%02X", key[i]); printf("\n"); } - if (EVP_CIPHER_iv_length(cipher) > 0) { + if (EVP_CIPHER_get_iv_length(cipher) > 0) { printf("iv ="); - for (i = 0; i < EVP_CIPHER_iv_length(cipher); i++) + for (i = 0; i < EVP_CIPHER_get_iv_length(cipher); i++) printf("%02X", iv[i]); printf("\n"); } @@ -661,8 +661,8 @@ static void show_ciphers(const OBJ_NAME *name, void *arg) /* Filter out ciphers that we cannot use */ cipher = EVP_get_cipherbyname(name->name); if (cipher == NULL || - (EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) != 0 || - EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE) + (EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) != 0 || + EVP_CIPHER_get_mode(cipher) == EVP_CIPH_XTS_MODE) return; BIO_printf(dec->bio, "-%-25s", name->name); diff --git a/apps/gendsa.c b/apps/gendsa.c index a7857c478c..e5c9bc22ad 100644 --- a/apps/gendsa.c +++ b/apps/gendsa.c @@ -127,12 +127,12 @@ int gendsa_main(int argc, char **argv) if (out == NULL) goto end2; - nbits = EVP_PKEY_bits(pkey); + nbits = EVP_PKEY_get_bits(pkey); if (nbits > OPENSSL_DSA_MAX_MODULUS_BITS) BIO_printf(bio_err, "Warning: It is not recommended to use more than %d bit for DSA keys.\n" " Your key size is %d! Larger key size may behave not as expected.\n", - OPENSSL_DSA_MAX_MODULUS_BITS, EVP_PKEY_bits(pkey)); + OPENSSL_DSA_MAX_MODULUS_BITS, EVP_PKEY_get_bits(pkey)); ctx = EVP_PKEY_CTX_new(pkey, NULL); if (ctx == NULL) { diff --git a/apps/genpkey.c b/apps/genpkey.c index 38b1100658..5cde41b98b 100644 --- a/apps/genpkey.c +++ b/apps/genpkey.c @@ -166,7 +166,7 @@ int genpkey_main(int argc, char **argv) if (ciphername != NULL) { if (!opt_cipher(ciphername, &cipher) || do_param == 1) goto opthelp; - m = EVP_CIPHER_mode(cipher); + m = EVP_CIPHER_get_mode(cipher); if (m == EVP_CIPH_GCM_MODE || m == EVP_CIPH_CCM_MODE || m == EVP_CIPH_XTS_MODE || m == EVP_CIPH_OCB_MODE) { BIO_printf(bio_err, "%s: cipher mode not supported\n", prog); diff --git a/apps/lib/s_cb.c b/apps/lib/s_cb.c index ba883996ba..ef431c98ea 100644 --- a/apps/lib/s_cb.c +++ b/apps/lib/s_cb.c @@ -386,13 +386,13 @@ int ssl_print_tmp_key(BIO *out, SSL *s) if (!SSL_get_peer_tmp_key(s, &key)) return 1; BIO_puts(out, "Server Temp Key: "); - switch (EVP_PKEY_id(key)) { + switch (EVP_PKEY_get_id(key)) { case EVP_PKEY_RSA: - BIO_printf(out, "RSA, %d bits\n", EVP_PKEY_bits(key)); + BIO_printf(out, "RSA, %d bits\n", EVP_PKEY_get_bits(key)); break; case EVP_PKEY_DH: - BIO_printf(out, "DH, %d bits\n", EVP_PKEY_bits(key)); + BIO_printf(out, "DH, %d bits\n", EVP_PKEY_get_bits(key)); break; #ifndef OPENSSL_NO_EC case EVP_PKEY_EC: @@ -403,13 +403,13 @@ int ssl_print_tmp_key(BIO *out, SSL *s) if (!EVP_PKEY_get_utf8_string_param(key, OSSL_PKEY_PARAM_GROUP_NAME, name, sizeof(name), &name_len)) strcpy(name, "?"); - BIO_printf(out, "ECDH, %s, %d bits\n", name, EVP_PKEY_bits(key)); + BIO_printf(out, "ECDH, %s, %d bits\n", name, EVP_PKEY_get_bits(key)); } break; #endif default: - BIO_printf(out, "%s, %d bits\n", OBJ_nid2sn(EVP_PKEY_id(key)), - EVP_PKEY_bits(key)); + BIO_printf(out, "%s, %d bits\n", OBJ_nid2sn(EVP_PKEY_get_id(key)), + EVP_PKEY_get_bits(key)); } EVP_PKEY_free(key); return 1; @@ -1426,7 +1426,7 @@ static int security_callback_debug(const SSL *s, const SSL_CTX *ctx, EVP_PKEY_asn1_get0_info(NULL, NULL, NULL, NULL, &algname, EVP_PKEY_get0_asn1(pkey)); BIO_printf(sdb->out, "%s, bits=%d", - algname, EVP_PKEY_bits(pkey)); + algname, EVP_PKEY_get_bits(pkey)); } break; } diff --git a/apps/list.c b/apps/list.c index 6ffc36b9e2..bc21c7f18a 100644 --- a/apps/list.c +++ b/apps/list.c @@ -36,7 +36,7 @@ static const char *select_name = NULL; { \ TYPE *impl; \ const char *propq = app_get0_propq(); \ - const char *name = TYPE ## _name(alg); \ + const char *name = TYPE ## _get0_name(alg); \ \ ERR_set_mark(); \ impl = TYPE ## _fetch(NULL, name, propq); \ @@ -70,10 +70,10 @@ static void legacy_cipher_fn(const EVP_CIPHER *c, { if (select_name != NULL && (c == NULL - || strcasecmp(select_name, EVP_CIPHER_name(c)) != 0)) + || strcasecmp(select_name, EVP_CIPHER_get0_name(c)) != 0)) return; if (c != NULL) { - BIO_printf(arg, " %s\n", EVP_CIPHER_name(c)); + BIO_printf(arg, " %s\n", EVP_CIPHER_get0_name(c)); } else { if (from == NULL) from = "<undefined>"; @@ -88,11 +88,11 @@ DEFINE_STACK_OF(EVP_CIPHER) static int cipher_cmp(const EVP_CIPHER * const *a, const EVP_CIPHER * const *b) { - int ret = EVP_CIPHER_number(*a) - EVP_CIPHER_number(*b); + int ret = EVP_CIPHER_get_number(*a) - EVP_CIPHER_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_CIPHER_provider(*a)), - OSSL_PROVIDER_name(EVP_CIPHER_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_CIPHER_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_CIPHER_get0_provider(*b))); return ret; } @@ -138,10 +138,10 @@ static void list_ciphers(void) print_names(bio_out, names); BIO_printf(bio_out, " @ %s\n", - OSSL_PROVIDER_name(EVP_CIPHER_provider(c))); + OSSL_PROVIDER_name(EVP_CIPHER_get0_provider(c))); if (verbose) { - const char *desc = EVP_CIPHER_description(c); + const char *desc = EVP_CIPHER_get0_description(c); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -163,7 +163,7 @@ static void legacy_md_fn(const EVP_MD *m, const char *from, const char *to, void *arg) { if (m != NULL) { - BIO_printf(arg, " %s\n", EVP_MD_name(m)); + BIO_printf(arg, " %s\n", EVP_MD_get0_name(m)); } else { if (from == NULL) from = "<undefined>"; @@ -177,11 +177,11 @@ static void legacy_md_fn(const EVP_MD *m, DEFINE_STACK_OF(EVP_MD) static int md_cmp(const EVP_MD * const *a, const EVP_MD * const *b) { - int ret = EVP_MD_number(*a) - EVP_MD_number(*b); + int ret = EVP_MD_get_number(*a) - EVP_MD_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_MD_provider(*a)), - OSSL_PROVIDER_name(EVP_MD_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_MD_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_MD_get0_provider(*b))); return ret; } @@ -226,10 +226,11 @@ static void list_digests(void) BIO_printf(bio_out, " "); print_names(bio_out, names); - BIO_printf(bio_out, " @ %s\n", OSSL_PROVIDER_name(EVP_MD_provider(m))); + BIO_printf(bio_out, " @ %s\n", + OSSL_PROVIDER_name(EVP_MD_get0_provider(m))); if (verbose) { - const char *desc = EVP_MD_description(m); + const char *desc = EVP_MD_get0_description(m); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -249,11 +250,11 @@ static void list_digests(void) DEFINE_STACK_OF(EVP_MAC) static int mac_cmp(const EVP_MAC * const *a, const EVP_MAC * const *b) { - int ret = EVP_MAC_number(*a) - EVP_MAC_number(*b); + int ret = EVP_MAC_get_number(*a) - EVP_MAC_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_MAC_provider(*a)), - OSSL_PROVIDER_name(EVP_MAC_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_MAC_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_MAC_get0_provider(*b))); return ret; } @@ -291,10 +292,11 @@ static void list_macs(void) BIO_printf(bio_out, " "); print_names(bio_out, names); - BIO_printf(bio_out, " @ %s\n", OSSL_PROVIDER_name(EVP_MAC_provider(m))); + BIO_printf(bio_out, " @ %s\n", + OSSL_PROVIDER_name(EVP_MAC_get0_provider(m))); if (verbose) { - const char *desc = EVP_MAC_description(m); + const char *desc = EVP_MAC_get0_description(m); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -317,11 +319,11 @@ static void list_macs(void) DEFINE_STACK_OF(EVP_KDF) static int kdf_cmp(const EVP_KDF * const *a, const EVP_KDF * const *b) { - int ret = EVP_KDF_number(*a) - EVP_KDF_number(*b); + int ret = EVP_KDF_get_number(*a) - EVP_KDF_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_KDF_provider(*a)), - OSSL_PROVIDER_name(EVP_KDF_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_KDF_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_KDF_get0_provider(*b))); return ret; } @@ -359,10 +361,11 @@ static void list_kdfs(void) BIO_printf(bio_out, " "); print_names(bio_out, names); - BIO_printf(bio_out, " @ %s\n", OSSL_PROVIDER_name(EVP_KDF_provider(k))); + BIO_printf(bio_out, " @ %s\n", + OSSL_PROVIDER_name(EVP_KDF_get0_provider(k))); if (verbose) { - const char *desc = EVP_KDF_description(k); + const char *desc = EVP_KDF_get0_description(k); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -386,11 +389,11 @@ DEFINE_STACK_OF(EVP_RAND) static int rand_cmp(const EVP_RAND * const *a, const EVP_RAND * const *b) { - int ret = strcasecmp(EVP_RAND_name(*a), EVP_RAND_name(*b)); + int ret = strcasecmp(EVP_RAND_get0_name(*a), EVP_RAND_get0_name(*b)); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_RAND_provider(*a)), - OSSL_PROVIDER_name(EVP_RAND_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_RAND_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_RAND_get0_provider(*b))); return ret; } @@ -420,13 +423,14 @@ static void list_random_generators(void) const EVP_RAND *m = sk_EVP_RAND_value(rands, i); if (select_name != NULL - && strcasecmp(EVP_RAND_name(m), select_name) != 0) + && strcasecmp(EVP_RAND_get0_name(m), select_name) != 0) continue; - BIO_printf(bio_out, " %s", EVP_RAND_name(m)); - BIO_printf(bio_out, " @ %s\n", OSSL_PROVIDER_name(EVP_RAND_provider(m))); + BIO_printf(bio_out, " %s", EVP_RAND_get0_name(m)); + BIO_printf(bio_out, " @ %s\n", + OSSL_PROVIDER_name(EVP_RAND_get0_provider(m))); if (verbose) { - const char *desc = EVP_RAND_description(m); + const char *desc = EVP_RAND_get0_description(m); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -452,13 +456,13 @@ static void display_random(const char *name, EVP_RAND_CTX *drbg) BIO_printf(bio_out, "%s:\n", name); if (drbg != NULL) { - rand = EVP_RAND_CTX_rand(drbg); + rand = EVP_RAND_CTX_get0_rand(drbg); - BIO_printf(bio_out, " %s", EVP_RAND_name(rand)); + BIO_printf(bio_out, " %s", EVP_RAND_get0_name(rand)); BIO_printf(bio_out, " @ %s\n", - OSSL_PROVIDER_name(EVP_RAND_provider(rand))); + OSSL_PROVIDER_name(EVP_RAND_get0_provider(rand))); - switch (EVP_RAND_state(drbg)) { + switch (EVP_RAND_get_state(drbg)) { case EVP_RAND_STATE_UNINITIALISED: p = "uninitialised"; break; @@ -516,11 +520,11 @@ DEFINE_STACK_OF(OSSL_ENCODER) static int encoder_cmp(const OSSL_ENCODER * const *a, const OSSL_ENCODER * const *b) { - int ret = OSSL_ENCODER_number(*a) - OSSL_ENCODER_number(*b); + int ret = OSSL_ENCODER_get_number(*a) - OSSL_ENCODER_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(OSSL_ENCODER_provider(*a)), - OSSL_PROVIDER_name(OSSL_ENCODER_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(OSSL_ENCODER_get0_provider(*a)), + OSSL_PROVIDER_name(OSSL_ENCODER_get0_provider(*b))); return ret; } @@ -560,11 +564,11 @@ static void list_encoders(void) print_names(bio_out, names); BIO_printf(bio_out, " @ %s (%s)\n", - OSSL_PROVIDER_name(OSSL_ENCODER_provider(k)), - OSSL_ENCODER_properties(k)); + OSSL_PROVIDER_name(OSSL_ENCODER_get0_provider(k)), + OSSL_ENCODER_get0_properties(k)); if (verbose) { - const char *desc = OSSL_ENCODER_description(k); + const char *desc = OSSL_ENCODER_get0_description(k); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -584,11 +588,11 @@ DEFINE_STACK_OF(OSSL_DECODER) static int decoder_cmp(const OSSL_DECODER * const *a, const OSSL_DECODER * const *b) { - int ret = OSSL_DECODER_number(*a) - OSSL_DECODER_number(*b); + int ret = OSSL_DECODER_get_number(*a) - OSSL_DECODER_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(OSSL_DECODER_provider(*a)), - OSSL_PROVIDER_name(OSSL_DECODER_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(OSSL_DECODER_get0_provider(*a)), + OSSL_PROVIDER_name(OSSL_DECODER_get0_provider(*b))); return ret; } @@ -629,11 +633,11 @@ static void list_decoders(void) print_names(bio_out, names); BIO_printf(bio_out, " @ %s (%s)\n", - OSSL_PROVIDER_name(OSSL_DECODER_provider(k)), - OSSL_DECODER_properties(k)); + OSSL_PROVIDER_name(OSSL_DECODER_get0_provider(k)), + OSSL_DECODER_get0_properties(k)); if (verbose) { - const char *desc = OSSL_DECODER_description(k); + const char *desc = OSSL_DECODER_get0_description(k); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -650,11 +654,11 @@ DEFINE_STACK_OF(EVP_KEYMGMT) static int keymanager_cmp(const EVP_KEYMGMT * const *a, const EVP_KEYMGMT * const *b) { - int ret = EVP_KEYMGMT_number(*a) - EVP_KEYMGMT_number(*b); + int ret = EVP_KEYMGMT_get_number(*a) - EVP_KEYMGMT_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_KEYMGMT_provider(*a)), - OSSL_PROVIDER_name(EVP_KEYMGMT_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_KEYMGMT_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_KEYMGMT_get0_provider(*b))); return ret; } @@ -684,7 +688,7 @@ static void list_keymanagers(void) names = sk_OPENSSL_CSTRING_new(name_cmp); if (names != NULL && EVP_KEYMGMT_names_do_all(k, collect_names, names)) { - const char *desc = EVP_KEYMGMT_description(k); + const char *desc = EVP_KEYMGMT_get0_description(k); BIO_printf(bio_out, " Name: "); if (desc != NULL) @@ -696,7 +700,7 @@ static void list_keymanagers(void) BIO_printf(bio_out, " IDs: "); print_names(bio_out, names); BIO_printf(bio_out, " @ %s\n", - OSSL_PROVIDER_name(EVP_KEYMGMT_provider(k))); + OSSL_PROVIDER_name(EVP_KEYMGMT_get0_provider(k))); if (verbose) { print_param_types("settable key generation parameters", @@ -716,11 +720,11 @@ DEFINE_STACK_OF(EVP_SIGNATURE) static int signature_cmp(const EVP_SIGNATURE * const *a, const EVP_SIGNATURE * const *b) { - int ret = EVP_SIGNATURE_number(*a) - EVP_SIGNATURE_number(*b); + int ret = EVP_SIGNATURE_get_number(*a) - EVP_SIGNATURE_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_SIGNATURE_provider(*a)), - OSSL_PROVIDER_name(EVP_SIGNATURE_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_SIGNATURE_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_SIGNATURE_get0_provider(*b))); return ret; } @@ -755,10 +759,10 @@ static void list_signatures(void) print_names(bio_out, names); BIO_printf(bio_out, " @ %s\n", - OSSL_PROVIDER_name(EVP_SIGNATURE_provider(k))); + OSSL_PROVIDER_name(EVP_SIGNATURE_get0_provider(k))); if (verbose) { - const char *desc = EVP_SIGNATURE_description(k); + const char *desc = EVP_SIGNATURE_get0_description(k); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -779,11 +783,11 @@ DEFINE_STACK_OF(EVP_KEM) static int kem_cmp(const EVP_KEM * const *a, const EVP_KEM * const *b) { - int ret = EVP_KEM_number(*a) - EVP_KEM_number(*b); + int ret = EVP_KEM_get_number(*a) - EVP_KEM_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_KEM_provider(*a)), - OSSL_PROVIDER_name(EVP_KEM_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_KEM_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_KEM_get0_provider(*b))); return ret; } @@ -817,10 +821,11 @@ static void list_kems(void) BIO_printf(bio_out, " "); print_names(bio_out, names); - BIO_printf(bio_out, " @ %s\n", OSSL_PROVIDER_name(EVP_KEM_provider(k))); + BIO_printf(bio_out, " @ %s\n", + OSSL_PROVIDER_name(EVP_KEM_get0_provider(k))); if (verbose) { - const char *desc = EVP_KEM_description(k); + const char *desc = EVP_KEM_get0_description(k); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -841,11 +846,11 @@ DEFINE_STACK_OF(EVP_ASYM_CIPHER) static int asymcipher_cmp(const EVP_ASYM_CIPHER * const *a, const EVP_ASYM_CIPHER * const *b) { - int ret = EVP_ASYM_CIPHER_number(*a) - EVP_ASYM_CIPHER_number(*b); + int ret = EVP_ASYM_CIPHER_get_number(*a) - EVP_ASYM_CIPHER_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_ASYM_CIPHER_provider(*a)), - OSSL_PROVIDER_name(EVP_ASYM_CIPHER_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_ASYM_CIPHER_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_ASYM_CIPHER_get0_provider(*b))); return ret; } @@ -882,10 +887,10 @@ static void list_asymciphers(void) print_names(bio_out, names); BIO_printf(bio_out, " @ %s\n", - OSSL_PROVIDER_name(EVP_ASYM_CIPHER_provider(k))); + OSSL_PROVIDER_name(EVP_ASYM_CIPHER_get0_provider(k))); if (verbose) { - const char *desc = EVP_ASYM_CIPHER_description(k); + const char *desc = EVP_ASYM_CIPHER_get0_description(k); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -906,11 +911,11 @@ DEFINE_STACK_OF(EVP_KEYEXCH) static int kex_cmp(const EVP_KEYEXCH * const *a, const EVP_KEYEXCH * const *b) { - int ret = EVP_KEYEXCH_number(*a) - EVP_KEYEXCH_number(*b); + int ret = EVP_KEYEXCH_get_number(*a) - EVP_KEYEXCH_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(EVP_KEYEXCH_provider(*a)), - OSSL_PROVIDER_name(EVP_KEYEXCH_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(EVP_KEYEXCH_get0_provider(*a)), + OSSL_PROVIDER_name(EVP_KEYEXCH_get0_provider(*b))); return ret; } @@ -945,10 +950,10 @@ static void list_keyexchanges(void) print_names(bio_out, names); BIO_printf(bio_out, " @ %s\n", - OSSL_PROVIDER_name(EVP_KEYEXCH_provider(k))); + OSSL_PROVIDER_name(EVP_KEYEXCH_get0_provider(k))); if (verbose) { - const char *desc = EVP_KEYEXCH_description(k); + const char *desc = EVP_KEYEXCH_get0_description(k); if (desc != NULL) BIO_printf(bio_out, " description: %s\n", desc); @@ -1191,11 +1196,11 @@ DEFINE_STACK_OF(OSSL_STORE_LOADER) static int store_cmp(const OSSL_STORE_LOADER * const *a, const OSSL_STORE_LOADER * const *b) { - int ret = OSSL_STORE_LOADER_number(*a) - OSSL_STORE_LOADER_number(*b); + int ret = OSSL_STORE_LOADER_get_number(*a) - OSSL_STORE_LOADER_get_number(*b); if (ret == 0) - ret = strcmp(OSSL_PROVIDER_name(OSSL_STORE_LOADER_provider(*a)), - OSSL_PROVIDER_name(OSSL_STORE_LOADER_provider(*b))); + ret = strcmp(OSSL_PROVIDER_name(OSSL_STORE_LOADER_get0_provider(*a)), + OSSL_PROVIDER_name(OSSL_STORE_LOADER_get0_provider(*b))); return ret; } @@ -1234,7 +1239,7 @@ static void list_store_loaders(void) print_names(bio_out, names); BIO_printf(bio_out, " @ %s\n", - OSSL_PROVIDER_name(OSSL_STORE_LOADER_provider(m))); + OSSL_PROVIDER_name(OSSL_STORE_LOADER_get0_provider(m))); } sk_OPENSSL_CSTRING_free(names); } diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c index 0424e556c1..bf9db2fa5a 100644 --- a/apps/pkeyutl.c +++ b/apps/pkeyutl.c @@ -592,7 +592,7 @@ static EVP_PKEY_CTX *init_ctx(const char *kdfalg, int *pkeysize, if (pkey == NULL) goto end; - *pkeysize = EVP_PKEY_size(pkey); + *pkeysize = EVP_PKEY_get_size(pkey); if (impl != NULL) ctx = EVP_PKEY_CTX_new(pkey, impl); else @@ -726,8 +726,8 @@ static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx, int buf_len = 0; /* Some algorithms only support oneshot digests */ - if (EVP_PKEY_id(pkey) == EVP_PKEY_ED25519 - || EVP_PKEY_id(pkey) == EVP_PKEY_ED448) { + if (EVP_PKEY_get_id(pkey) == EVP_PKEY_ED25519 + || EVP_PKEY_get_id(pkey) == EVP_PKEY_ED448) { if (filesize < 0) { BIO_printf(bio_err, "Error: unable to determine file size for oneshot operation\n"); diff --git a/apps/rehash.c b/apps/rehash.c index 65ccacc0a8..7fe01de11c 100644 --- a/apps/rehash.c +++ b/apps/rehash.c @@ -534,7 +534,7 @@ int rehash_main(int argc, char **argv) argv = opt_rest(); evpmd = EVP_sha1(); - evpmdsize = EVP_MD_size(evpmd); |