Browse Source

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)
master
Tomas Mraz 5 months ago
parent
commit
ed576acdf5
261 changed files with 1935 additions and 1800 deletions
  1. +2
    -2
      CHANGES.md
  2. +1
    -1
      apps/cms.c
  3. +2
    -1
      apps/crl.c
  4. +4
    -4
      apps/dgst.c
  5. +1
    -1
      apps/dsa.c
  6. +1
    -1
      apps/ec.c
  7. +16
    -16
      apps/enc.c
  8. +2
    -2
      apps/gendsa.c
  9. +1
    -1
      apps/genpkey.c
  10. +7
    -7
      apps/lib/s_cb.c
  11. +81
    -76
      apps/list.c
  12. +3
    -3
      apps/pkeyutl.c
  13. +1
    -1
      apps/rehash.c
  14. +1
    -1
      apps/req.c
  15. +1
    -1
      apps/rsa.c
  16. +1
    -1
      apps/rsautl.c
  17. +3
    -3
      apps/s_client.c
  18. +17
    -17
      apps/speed.c
  19. +3
    -3
      apps/ts.c
  20. +3
    -3
      crypto/asn1/a_digest.c
  21. +5
    -5
      crypto/asn1/a_sign.c
  22. +2
    -2
      crypto/asn1/a_verify.c
  23. +1
    -1
      crypto/asn1/d2i_param.c
  24. +1
    -1
      crypto/asn1/d2i_pr.c
  25. +2
    -2
      crypto/asn1/d2i_pu.c
  26. +1
    -1
      crypto/asn1/i2d_evp.c
  27. +3
    -3
      crypto/asn1/p5_pbev2.c
  28. +6
    -6
      crypto/asn1/p5_scrypt.c
  29. +1
    -1
      crypto/asn1/x_algor.c
  30. +5
    -5
      crypto/cmac/cmac.c
  31. +2
    -2
      crypto/cmp/cmp_ctx.c
  32. +3
    -3
      crypto/cmp/cmp_protect.c
  33. +8
    -7
      crypto/cms/cms_dh.c
  34. +6
    -6
      crypto/cms/cms_ec.c
  35. +8
    -7
      crypto/cms/cms_enc.c
  36. +5
    -5
      crypto/cms/cms_env.c
  37. +7
    -7
      crypto/cms/cms_kari.c
  38. +2
    -2
      crypto/cms/cms_lib.c
  39. +4
    -4
      crypto/cms/cms_pwri.c
  40. +5
    -4
      crypto/cms/cms_sd.c
  41. +1
    -1
      crypto/cms/cms_smime.c
  42. +2
    -2
      crypto/core_namemap.c
  43. +5
    -5
      crypto/crmf/crmf_lib.c
  44. +2
    -2
      crypto/dh/dh_kdf.c
  45. +1
    -1
      crypto/dh/dh_pmeth.c
  46. +17
    -17
      crypto/dsa/dsa_pmeth.c
  47. +1
    -1
      crypto/ec/ec_ameth.c
  48. +13
    -13
      crypto/ec/ec_pmeth.c
  49. +1
    -1
      crypto/ec/ecdh_kdf.c
  50. +10
    -10
      crypto/ec/ecx_meth.c
  51. +1
    -1
      crypto/encode_decode/decoder_lib.c
  52. +7
    -7
      crypto/encode_decode/decoder_meth.c
  53. +3
    -3
      crypto/encode_decode/decoder_pkey.c
  54. +1
    -1
      crypto/encode_decode/encoder_lib.c
  55. +7
    -7
      crypto/encode_decode/encoder_meth.c
  56. +5
    -5
      crypto/encode_decode/encoder_pkey.c
  57. +9
    -9
      crypto/engine/eng_openssl.c
  58. +8
    -8
      crypto/evp/asymcipher.c
  59. +2
    -2
      crypto/evp/bio_enc.c
  60. +1
    -1
      crypto/evp/bio_md.c
  61. +6
    -6
      crypto/evp/bio_ok.c
  62. +14
    -14
      crypto/evp/ctrl_params_translate.c
  63. +6
    -6
      crypto/evp/digest.c
  64. +112
    -102
      crypto/evp/e_aes.c
  65. +5
    -5
      crypto/evp/e_aes_cbc_hmac_sha1.c
  66. +5
    -5
      crypto/evp/e_aes_cbc_hmac_sha256.c
  67. +29
    -24
      crypto/evp/e_aria.c
  68. +1
    -1
      crypto/evp/e_bf.c
  69. +27
    -20
      crypto/evp/e_camellia.c
  70. +1
    -1
      crypto/evp/e_cast.c
  71. +13
    -13
      crypto/evp/e_des.c
  72. +16
    -16
      crypto/evp/e_des3.c
  73. +2
    -2
      crypto/evp/e_idea.c
  74. +4
    -4
      crypto/evp/e_rc2.c
  75. +1
    -1
      crypto/evp/e_rc4.c
  76. +3
    -3
      crypto/evp/e_rc4_hmac_md5.c
  77. +2
    -2
      crypto/evp/e_rc5.c
  78. +1
    -1
      crypto/evp/e_sm4.c
  79. +2
    -2
      crypto/evp/e_xcbc_d.c
  80. +24
    -24
      crypto/evp/evp_enc.c
  81. +3
    -3
      crypto/evp/evp_key.c
  82. +45
    -45
      crypto/evp/evp_lib.c
  83. +1
    -1
      crypto/evp/evp_local.h
  84. +2
    -2
      crypto/evp/evp_pbe.c
  85. +1
    -1
      crypto/evp/evp_pkey.c
  86. +12
    -12
      crypto/evp/evp_rand.c
  87. +8
    -8
      crypto/evp/exchange.c
  88. +4
    -4
      crypto/evp/kdf_lib.c
  89. +5
    -5
      crypto/evp/kdf_meth.c
  90. +7
    -7
      crypto/evp/kem.c
  91. +2
    -2
      crypto/evp/keymgmt_lib.c
  92. +9
    -9
      crypto/evp/keymgmt_meth.c
  93. +1
    -1
      crypto/evp/legacy_md5_sha1.c
  94. +6
    -6
      crypto/evp/legacy_meth.h
  95. +5
    -5
      crypto/evp/legacy_sha.c
  96. +4
    -4
      crypto/evp/m_sigver.c
  97. +4
    -4
      crypto/evp/mac_lib.c
  98. +6
    -6
      crypto/evp/mac_meth.c
  99. +3
    -3
      crypto/evp/p5_crpt.c
  100. +3
    -3
      crypto/evp/p5_crpt2.c

+ 2
- 2
CHANGES.md View File

@ -641,8 +641,8 @@ breaking changes, and mappings for the large list of deprecated functions.
*Richard Levitte*
* Enhanced the documentation of EVP_PKEY_size(), EVP_PKEY_bits()
and EVP_PKEY_security_bits(). Especially EVP_PKEY_size() needed
* Enhanced the documentation of EVP_PKEY_get_size(), EVP_PKEY_get_bits()
and EVP_PKEY_get_security_bits(). Especially EVP_PKEY_get_size() needed
a new formulation to include all the things it can be used for,
as well as words of caution.


+ 1
- 1
apps/cms.c View File

@ -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;


+ 2
- 1
apps/crl.c View File

@ -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' : ':');


+ 4
- 4
apps/dgst.c View File

@ -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;
}


+ 1
- 1
apps/dsa.c View File

@ -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) {


+ 1
- 1
apps/ec.c View File

@ -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)


+ 16
- 16
apps/enc.c View File

@ -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);


+ 2
- 2
apps/gendsa.c View File

@ -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) {


+ 1
- 1
apps/genpkey.c View File

@ -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);


+ 7
- 7
apps/lib/s_cb.c View File

@ -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;
}


+ 81
- 76
apps/list.c View File

@ -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);
}


+ 3
- 3
apps/pkeyutl.c View File

@ -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");


+ 1
- 1
apps/rehash.c View File

@ -534,7 +534,7 @@ int rehash_main(int argc, char **argv)
argv = opt_rest();
evpmd = EVP_sha1();
evpmdsize = EVP_MD_size(evpmd);
evpmdsize = EVP_MD_get_size(evpmd);
if (*argv != NULL) {
while (*argv != NULL)


+ 1
- 1
apps/req.c View File

@ -1601,7 +1601,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
else
gctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(),
param, app_get0_propq());
*pkeylen = EVP_PKEY_bits(param);
*pkeylen = EVP_PKEY_get_bits(param);
EVP_PKEY_free(param);
} else {
if (keygen_engine != NULL) {


+ 1
- 1
apps/rsa.c View File

@ -337,7 +337,7 @@ int rsa_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) {


+ 1
- 1
apps/rsautl.c View File

@ -214,7 +214,7 @@ int rsautl_main(int argc, char **argv)
if (out == NULL)
goto end;
keysize = EVP_PKEY_size(pkey);
keysize = EVP_PKEY_get_size(pkey);
rsa_in = app_malloc(keysize * 2, "hold rsa key");
rsa_out = app_malloc(keysize, "output rsa key");


+ 3
- 3
apps/s_client.c View File

@ -3099,8 +3099,8 @@ static void print_stuff(BIO *bio, SSL *s, int full)
public_key = X509_get_pubkey(sk_X509_value(sk, i));
if (public_key != NULL) {
BIO_printf(bio, " a:PKEY: %s, %d (bit); sigalg: %s\n",
OBJ_nid2sn(EVP_PKEY_base_id(public_key)),
EVP_PKEY_bits(public_key),
OBJ_nid2sn(EVP_PKEY_get_base_id(public_key)),
EVP_PKEY_get_bits(public_key),
OBJ_nid2sn(X509_get_signature_nid(sk_X509_value(sk, i))));
EVP_PKEY_free(public_key);
}
@ -3180,7 +3180,7 @@ static void print_stuff(BIO *bio, SSL *s, int full)
pktmp = X509_get0_pubkey(peer);
BIO_printf(bio, "Server public key is %d bit\n",
EVP_PKEY_bits(pktmp));
EVP_PKEY_get_bits(pktmp));
}
BIO_printf(bio, "Secure Renegotiation IS%s supported\n",
SSL_get_secure_renegotiation_support(s) ? "" : " NOT");


+ 17
- 17
apps/speed.c View File

@ -1038,7 +1038,7 @@ static int SM2_sign_loop(void *args)
size_t sm2sigsize;
int ret, count;
EVP_PKEY **sm2_pkey = tempargs->sm2_pkey;
const size_t max_size = EVP_PKEY_size(sm2_pkey[testnum]);
const size_t max_size = EVP_PKEY_get_size(sm2_pkey[testnum]);
for (count = 0; COND(sm2_c[testnum][0]); count++) {
sm2sigsize = max_size;
@ -1715,10 +1715,10 @@ int speed_main(int argc, char **argv)
if (evp_cipher == NULL) {
BIO_printf(bio_err, "-aead can be used only with an AEAD cipher\n");
goto end;
} else if (!(EVP_CIPHER_flags(evp_cipher) &
} else if (!(EVP_CIPHER_get_flags(evp_cipher) &
EVP_CIPH_FLAG_AEAD_CIPHER)) {
BIO_printf(bio_err, "%s is not an AEAD cipher\n",
EVP_CIPHER_name(evp_cipher));
EVP_CIPHER_get0_name(evp_cipher));
goto end;
}
}
@ -1727,10 +1727,10 @@ int speed_main(int argc, char **argv)
BIO_printf(bio_err, "-mb can be used only with a multi-block"
" capable cipher\n");
goto end;
} else if (!(EVP_CIPHER_flags(evp_cipher) &
} else if (!(EVP_CIPHER_get_flags(evp_cipher) &
EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)) {
BIO_printf(bio_err, "%s is not a multi-block capable\n",
EVP_CIPHER_name(evp_cipher));
EVP_CIPHER_get0_name(evp_cipher));
goto end;
} else if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with -mb");
@ -2172,18 +2172,18 @@ int speed_main(int argc, char **argv)
if (evp_cipher != NULL) {
int (*loopfunc) (void *) = EVP_Update_loop;
if (multiblock && (EVP_CIPHER_flags(evp_cipher) &
if (multiblock && (EVP_CIPHER_get_flags(evp_cipher) &
EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)) {
multiblock_speed(evp_cipher, lengths_single, &seconds);
ret = 0;
goto end;
}
names[D_EVP] = EVP_CIPHER_name(evp_cipher);
names[D_EVP] = EVP_CIPHER_get0_name(evp_cipher);
if (EVP_CIPHER_mode(evp_cipher) == EVP_CIPH_CCM_MODE) {
if (EVP_CIPHER_get_mode(evp_cipher) == EVP_CIPH_CCM_MODE) {
loopfunc = EVP_Update_loop_ccm;
} else if (aead && (EVP_CIPHER_flags(evp_cipher) &
} else if (aead && (EVP_CIPHER_get_flags(evp_cipher) &
EVP_CIPH_FLAG_AEAD_CIPHER)) {
loopfunc = EVP_Update_loop_aead;
if (lengths == lengths_list) {
@ -2211,7 +2211,7 @@ int speed_main(int argc, char **argv)
EVP_CIPHER_CTX_set_padding(loopargs[k].ctx, 0);
keylen = EVP_CIPHER_CTX_key_length(loopargs[k].ctx);
keylen = EVP_CIPHER_CTX_get_key_length(loopargs[k].ctx);
loopargs[k].key = app_malloc(keylen, "evp_cipher key");
EVP_CIPHER_CTX_rand_key(loopargs[k].ctx, loopargs[k].key);
if (!EVP_CipherInit_ex(loopargs[k].ctx, NULL, NULL,
@ -2223,7 +2223,7 @@ int speed_main(int argc, char **argv)
OPENSSL_clear_free(loopargs[k].key, keylen);
/* SIV mode only allows for a single Update operation */
if (EVP_CIPHER_mode(evp_cipher) == EVP_CIPH_SIV_MODE)
if (EVP_CIPHER_get_mode(evp_cipher) == EVP_CIPH_SIV_MODE)
EVP_CIPHER_CTX_ctrl(loopargs[k].ctx, EVP_CTRL_SET_SPEED,
1, NULL);
}
@ -2261,7 +2261,7 @@ int speed_main(int argc, char **argv)
if (!opt_cipher(evp_mac_ciphername, &cipher))
goto end;
keylen = EVP_CIPHER_key_length(cipher);
keylen = EVP_CIPHER_get_key_length(cipher);
EVP_CIPHER_free(cipher);
if (keylen <= 0 || keylen > (int)sizeof(key32)) {
BIO_printf(bio_err, "\nRequested CMAC cipher with unsupported key length.\n");
@ -2795,7 +2795,7 @@ int speed_main(int argc, char **argv)
st = 0; /* set back to zero */
/* attach it sooner to rely on main final cleanup */
loopargs[i].sm2_pkey[testnum] = sm2_pkey;
loopargs[i].sigsize = EVP_PKEY_size(sm2_pkey);
loopargs[i].sigsize = EVP_PKEY_get_size(sm2_pkey);
sm2_pctx = EVP_PKEY_CTX_new(sm2_pkey, NULL);
sm2_vfy_pctx = EVP_PKEY_CTX_new(sm2_pkey, NULL);
@ -3290,12 +3290,12 @@ int speed_main(int argc, char **argv)
/* free signing ctx */
if (loopargs[i].sm2_ctx[k] != NULL
&& (pctx = EVP_MD_CTX_pkey_ctx(loopargs[i].sm2_ctx[k])) != NULL)
&& (pctx = EVP_MD_CTX_get_pkey_ctx(loopargs[i].sm2_ctx[k])) != NULL)
EVP_PKEY_CTX_free(pctx);
EVP_MD_CTX_free(loopargs[i].sm2_ctx[k]);
/* free verification ctx */
if (loopargs[i].sm2_vfy_ctx[k] != NULL
&& (pctx = EVP_MD_CTX_pkey_ctx(loopargs[i].sm2_vfy_ctx[k])) != NULL)
&& (pctx = EVP_MD_CTX_get_pkey_ctx(loopargs[i].sm2_vfy_ctx[k])) != NULL)
EVP_PKEY_CTX_free(pctx);
EVP_MD_CTX_free(loopargs[i].sm2_vfy_ctx[k]);
/* free pkey */
@ -3575,7 +3575,7 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single,
if (!EVP_EncryptInit_ex(ctx, evp_cipher, NULL, NULL, no_iv))
app_bail_out("failed to initialise cipher context\n");
if ((keylen = EVP_CIPHER_CTX_key_length(ctx)) < 0) {
if ((keylen = EVP_CIPHER_CTX_get_key_length(ctx)) < 0) {
BIO_printf(bio_err, "Impossible negative key length: %d\n", keylen);
goto err;
}
@ -3589,7 +3589,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 = EVP_CIPHER_name(evp_cipher)) == NULL)
if ((alg_name = EVP_CIPHER_get0_name(evp_cipher)) == NULL)
app_bail_out("failed to get cipher name\n");
for (j = 0; j < num; j++) {


+ 3
- 3
apps/ts.c View File

@ -460,7 +460,7 @@ static TS_REQ *create_query(BIO *data_bio, const char *digest, const EVP_MD *md,
goto err;
if ((algo = X509_ALGOR_new()) == NULL)
goto err;
if ((algo->algorithm = OBJ_nid2obj(EVP_MD_type(md))) == NULL)
if ((algo->algorithm = OBJ_nid2obj(EVP_MD_get_type(md))) == NULL)
goto err;
if ((algo->parameter = ASN1_TYPE_new()) == NULL)
goto err;
@ -509,7 +509,7 @@ static int create_digest(BIO *input, const char *digest, const EVP_MD *md,
int rv = 0;
EVP_MD_CTX *md_ctx = NULL;
md_value_len = EVP_MD_size(md);
md_value_len = EVP_MD_get_size(md);
if (md_value_len < 0)
return 0;
@ -529,7 +529,7 @@ static int create_digest(BIO *input, const char *digest, const EVP_MD *md,
}
if (!EVP_DigestFinal(md_ctx, *md_value, NULL))
goto err;
md_value_len = EVP_MD_size(md);
md_value_len = EVP_MD_get_size(md);
} else {
long digest_len;


+ 3
- 3
crypto/asn1/a_digest.c View File

@ -65,15 +65,15 @@ int ossl_asn1_item_digest_ex(const ASN1_ITEM *it, const EVP_MD *md, void *asn,
if (i < 0 || str == NULL)
return 0;
if (EVP_MD_provider(md) == NULL) {
if (EVP_MD_get0_provider(md) == NULL) {
#if !defined(OPENSSL_NO_ENGINE)
ENGINE *tmpeng = ENGINE_get_digest_engine(EVP_MD_type(md));
ENGINE *tmpeng = ENGINE_get_digest_engine(EVP_MD_get_type(md));
if (tmpeng != NULL)
ENGINE_finish(tmpeng);
else
#endif
fetched_md = EVP_MD_fetch(libctx, EVP_MD_name(md), propq);
fetched_md = EVP_MD_fetch(libctx, EVP_MD_get0_name(md), propq);
}
if (fetched_md == NULL)
goto err;


+ 5
- 5
crypto/asn1/a_sign.c View File

@ -78,7 +78,7 @@ int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2,
}
inll = (size_t)inl;
buf_in = OPENSSL_malloc(inll);
outll = outl = EVP_PKEY_size(pkey);
outll = outl = EVP_PKEY_get_size(pkey);
buf_out = OPENSSL_malloc(outll);
if (buf_in == NULL || buf_out == NULL) {
outl = 0;
@ -143,7 +143,7 @@ int ASN1_item_sign_ex(const ASN1_ITEM *it, X509_ALGOR *algor1,
rv = ASN1_item_sign_ctx(it, algor1, algor2, signature, data, ctx);
err:
EVP_PKEY_CTX_free(EVP_MD_CTX_pkey_ctx(ctx));
EVP_PKEY_CTX_free(EVP_MD_CTX_get_pkey_ctx(ctx));
EVP_MD_CTX_free(ctx);
return rv;
}
@ -160,7 +160,7 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
int rv, pkey_id;
md = EVP_MD_CTX_get0_md(ctx);
pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_pkey_ctx(ctx));
pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_get_pkey_ctx(ctx));
if (pkey == NULL) {
ERR_raise(ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED);
@ -168,7 +168,7 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
}
if (pkey->ameth == NULL) {
EVP_PKEY_CTX *pctx = EVP_MD_CTX_pkey_ctx(ctx);
EVP_PKEY_CTX *pctx = EVP_MD_CTX_get_pkey_ctx(ctx);
OSSL_PARAM params[2];
unsigned char aid[128];
size_t aid_len = 0;
@ -238,7 +238,7 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
pkey_id =
#ifndef OPENSSL_NO_SM2
EVP_PKEY_id(pkey) == NID_sm2 ? NID_sm2 :
EVP_PKEY_get_id(pkey) == NID_sm2 ? NID_sm2 :
#endif
pkey->ameth->pkey_id;


+ 2
- 2
crypto/asn1/a_verify.c View File

@ -102,7 +102,7 @@ int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg,
if ((ctx = evp_md_ctx_new_ex(pkey, id, libctx, propq)) != NULL) {
rv = ASN1_item_verify_ctx(it, alg, signature, data, ctx);
EVP_PKEY_CTX_free(EVP_MD_CTX_pkey_ctx(ctx));
EVP_PKEY_CTX_free(EVP_MD_CTX_get_pkey_ctx(ctx));
EVP_MD_CTX_free(ctx);
}
return rv;
@ -118,7 +118,7 @@ int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
int mdnid, pknid;
size_t inll = 0;
pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_pkey_ctx(ctx));
pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_get_pkey_ctx(ctx));
if (pkey == NULL) {
ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);


+ 1
- 1
crypto/asn1/d2i_param.c View File

@ -26,7 +26,7 @@ EVP_PKEY *d2i_KeyParams(int type, EVP_PKEY **a, const unsigned char **pp,
} else
ret = *a;
if (type != EVP_PKEY_id(ret) && !EVP_PKEY_set_type(ret, type))
if (type != EVP_PKEY_get_id(ret) && !EVP_PKEY_set_type(ret, type))
goto err;
if (ret->ameth == NULL || ret->ameth->param_decode == NULL) {


+ 1
- 1
crypto/asn1/d2i_pr.c View File

@ -120,7 +120,7 @@ d2i_PrivateKey_legacy(int keytype, EVP_PKEY **a, const unsigned char **pp,
EVP_PKEY_free(ret);
ret = tmp;
ERR_pop_to_mark();
if (EVP_PKEY_type(keytype) != EVP_PKEY_base_id(ret))
if (EVP_PKEY_type(keytype) != EVP_PKEY_get_base_id(ret))
goto err;
} else {
ERR_clear_last_mark();


+ 2
- 2
crypto/asn1/d2i_pu.c View File

@ -38,12 +38,12 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
} else
ret = *a;
if (type != EVP_PKEY_id(ret) && !EVP_PKEY_set_type(ret, type)) {
if (type != EVP_PKEY_get_id(ret) && !EVP_PKEY_set_type(ret, type)) {
ERR_raise(ERR_LIB_ASN1, ERR_R_EVP_LIB);
goto err;
}
switch (EVP_PKEY_id(ret)) {
switch (EVP_PKEY_get_id(ret)) {
case EVP_PKEY_RSA:
if ((ret->pkey.rsa = d2i_RSAPublicKey(NULL, pp, length)) == NULL) {
ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);


+ 1
- 1
crypto/asn1/i2d_evp.c View File

@ -131,7 +131,7 @@ int i2d_PublicKey(const EVP_PKEY *a, unsigned char **pp)
return i2d_provided(a, EVP_PKEY_PUBLIC_KEY, output_info, pp);
}
switch (EVP_PKEY_id(a)) {
switch (EVP_PKEY_get_id(a)) {
case EVP_PKEY_RSA:
return i2d_RSAPublicKey(EVP_PKEY_get0_RSA(a), pp);
#ifndef OPENSSL_NO_DSA


+ 3
- 3
crypto/asn1/p5_pbev2.c View File

@ -50,7 +50,7 @@ X509_ALGOR *PKCS5_pbe2_set_iv_ex(const EVP_CIPHER *cipher, int iter,
unsigned char iv[EVP_MAX_IV_LENGTH];
PBE2PARAM *pbe2 = NULL;
alg_nid = EVP_CIPHER_type(cipher);
alg_nid = EVP_CIPHER_get_type(cipher);
if (alg_nid == NID_undef) {
ERR_raise(ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
goto err;
@ -66,7 +66,7 @@ X509_ALGOR *PKCS5_pbe2_set_iv_ex(const EVP_CIPHER *cipher, int iter,
goto merr;
/* Create random IV */
ivlen = EVP_CIPHER_iv_length(cipher);
ivlen = EVP_CIPHER_get_iv_length(cipher);
if (ivlen > 0) {
if (aiv)
memcpy(iv, aiv, ivlen);
@ -101,7 +101,7 @@ X509_ALGOR *PKCS5_pbe2_set_iv_ex(const EVP_CIPHER *cipher, int iter,
/* If its RC2 then we'd better setup the key length */
if (alg_nid == NID_rc2_cbc)
keylen = EVP_CIPHER_key_length(cipher);
keylen = EVP_CIPHER_get_key_length(cipher);
else
keylen = -1;


+ 6
- 6
crypto/asn1/p5_scrypt.c View File

@ -60,7 +60,7 @@ X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher,
goto err;
}
alg_nid = EVP_CIPHER_type(cipher);
alg_nid = EVP_CIPHER_get_type(cipher);
if (alg_nid == NID_undef) {
ERR_raise(ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
goto err;
@ -79,10 +79,10 @@ X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher,
goto merr;
/* Create random IV */
if (EVP_CIPHER_iv_length(cipher)) {
if (EVP_CIPHER_get_iv_length(cipher)) {
if (aiv)
memcpy(iv, aiv, EVP_CIPHER_iv_length(cipher));
else if (RAND_bytes(iv, EVP_CIPHER_iv_length(cipher)) <= 0)
memcpy(iv, aiv, EVP_CIPHER_get_iv_length(cipher));
else if (RAND_bytes(iv, EVP_CIPHER_get_iv_length(cipher)) <= 0)
goto err;
}
@ -103,7 +103,7 @@ X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher,
/* If its RC2 then we'd better setup the key length */
if (alg_nid == NID_rc2_cbc)
keylen = EVP_CIPHER_key_length(cipher);
keylen = EVP_CIPHER_get_key_length(cipher);
/* Setup keyfunc */
@ -234,7 +234,7 @@ int PKCS5_v2_scrypt_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass,
goto err;
}
t = EVP_CIPHER_CTX_key_length(ctx);
t = EVP_CIPHER_CTX_get_key_length(ctx);
if (t < 0) {
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH);
goto err;


+ 1
- 1
crypto/asn1/x_algor.c View File

@ -80,7 +80,7 @@ void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md)
else
param_type = V_ASN1_NULL;
X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL);
X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_get_type(md)), param_type, NULL);
}


+ 5
- 5
crypto/cmac/cmac.c View File

@ -96,7 +96,7 @@ int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in)
if (in->nlast_block == -1)
return 0;
if ((bl = EVP_CIPHER_CTX_block_size(in->cctx)) < 0)
if ((bl = EVP_CIPHER_CTX_get_block_size(in->cctx)) < 0)
return 0;
if (!EVP_CIPHER_CTX_copy(out->cctx, in->cctx))
return 0;
@ -120,7 +120,7 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
return 0;
if (!EVP_EncryptInit_ex(ctx->cctx, NULL, NULL, NULL, zero_iv))
return 0;
memset(ctx->tbl, 0, EVP_CIPHER_CTX_block_size(ctx->cctx));
memset(ctx->tbl, 0, EVP_CIPHER_CTX_get_block_size(ctx->cctx));
ctx->nlast_block = 0;
return 1;
}