From bcd5d3a22d21010cf28c3b7b5f1c79b22be6da7a Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 1 Jun 2021 21:18:04 +1000 Subject: [PATCH] libcrypto: make XXX_get_number() internal Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15564) --- crypto/encode_decode/decoder_meth.c | 2 +- crypto/encode_decode/encoder_meth.c | 2 +- crypto/evp/asymcipher.c | 2 +- crypto/evp/evp_lib.c | 4 ++-- crypto/evp/evp_rand.c | 2 +- crypto/evp/exchange.c | 2 +- crypto/evp/kdf_lib.c | 2 +- crypto/evp/kem.c | 2 +- crypto/evp/keymgmt_meth.c | 2 +- crypto/evp/mac_lib.c | 2 +- crypto/evp/signature.c | 2 +- crypto/store/store_meth.c | 2 +- include/openssl/decoder.h | 1 - include/openssl/encoder.h | 1 - include/openssl/evp.h | 9 --------- include/openssl/kdf.h | 1 - include/openssl/store.h | 1 - util/libcrypto.num | 13 ------------- 18 files changed, 13 insertions(+), 39 deletions(-) diff --git a/crypto/encode_decode/decoder_meth.c b/crypto/encode_decode/decoder_meth.c index 708b319314..7197b9090d 100644 --- a/crypto/encode_decode/decoder_meth.c +++ b/crypto/encode_decode/decoder_meth.c @@ -421,7 +421,7 @@ const char *OSSL_DECODER_get0_properties(const OSSL_DECODER *decoder) return decoder->base.propdef; } -int OSSL_DECODER_get_number(const OSSL_DECODER *decoder) +int ossl_decoder_get_number(const OSSL_DECODER *decoder) { if (!ossl_assert(decoder != NULL)) { ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER); diff --git a/crypto/encode_decode/encoder_meth.c b/crypto/encode_decode/encoder_meth.c index 33655c12a6..81cebb2659 100644 --- a/crypto/encode_decode/encoder_meth.c +++ b/crypto/encode_decode/encoder_meth.c @@ -433,7 +433,7 @@ const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder) return encoder->base.propdef; } -int OSSL_ENCODER_get_number(const OSSL_ENCODER *encoder) +int ossl_encoder_get_number(const OSSL_ENCODER *encoder) { if (!ossl_assert(encoder != NULL)) { ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER); diff --git a/crypto/evp/asymcipher.c b/crypto/evp/asymcipher.c index c70e1e9554..1368f7094e 100644 --- a/crypto/evp/asymcipher.c +++ b/crypto/evp/asymcipher.c @@ -428,7 +428,7 @@ int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name) return evp_is_a(cipher->prov, cipher->name_id, NULL, name); } -int EVP_ASYM_CIPHER_get_number(const EVP_ASYM_CIPHER *cipher) +int evp_asym_cipher_get_number(const EVP_ASYM_CIPHER *cipher) { return cipher->name_id; } diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 8a03c4490b..bb91b22678 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -660,7 +660,7 @@ int EVP_CIPHER_is_a(const EVP_CIPHER *cipher, const char *name) return evp_is_a(NULL, 0, EVP_CIPHER_get0_name(cipher), name); } -int EVP_CIPHER_get_number(const EVP_CIPHER *cipher) +int evp_cipher_get_number(const EVP_CIPHER *cipher) { return cipher->name_id; } @@ -714,7 +714,7 @@ int EVP_MD_is_a(const EVP_MD *md, const char *name) return evp_is_a(NULL, 0, EVP_MD_get0_name(md), name); } -int EVP_MD_get_number(const EVP_MD *md) +int evp_md_get_number(const EVP_MD *md) { return md->name_id; } diff --git a/crypto/evp/evp_rand.c b/crypto/evp/evp_rand.c index 1e41fe0765..a76d746d9a 100644 --- a/crypto/evp/evp_rand.c +++ b/crypto/evp/evp_rand.c @@ -293,7 +293,7 @@ void EVP_RAND_free(EVP_RAND *rand) evp_rand_free(rand); } -int EVP_RAND_get_number(const EVP_RAND *rand) +int evp_rand_get_number(const EVP_RAND *rand) { return rand->name_id; } diff --git a/crypto/evp/exchange.c b/crypto/evp/exchange.c index 6503f479fa..72472aaace 100644 --- a/crypto/evp/exchange.c +++ b/crypto/evp/exchange.c @@ -458,7 +458,7 @@ int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *pkeylen) return ctx->pmeth->derive(ctx, key, pkeylen); } -int EVP_KEYEXCH_get_number(const EVP_KEYEXCH *keyexch) +int evp_keyexch_get_number(const EVP_KEYEXCH *keyexch) { return keyexch->name_id; } diff --git a/crypto/evp/kdf_lib.c b/crypto/evp/kdf_lib.c index 65b1617b81..77080e0b8d 100644 --- a/crypto/evp/kdf_lib.c +++ b/crypto/evp/kdf_lib.c @@ -83,7 +83,7 @@ EVP_KDF_CTX *EVP_KDF_CTX_dup(const EVP_KDF_CTX *src) return dst; } -int EVP_KDF_get_number(const EVP_KDF *kdf) +int evp_kdf_get_number(const EVP_KDF *kdf) { return kdf->name_id; } diff --git a/crypto/evp/kem.c b/crypto/evp/kem.c index 594633cf92..721b840ea5 100644 --- a/crypto/evp/kem.c +++ b/crypto/evp/kem.c @@ -343,7 +343,7 @@ int EVP_KEM_is_a(const EVP_KEM *kem, const char *name) return evp_is_a(kem->prov, kem->name_id, NULL, name); } -int EVP_KEM_get_number(const EVP_KEM *kem) +int evp_kem_get_number(const EVP_KEM *kem) { return kem->name_id; } diff --git a/crypto/evp/keymgmt_meth.c b/crypto/evp/keymgmt_meth.c index 841eae1df8..439b8f035c 100644 --- a/crypto/evp/keymgmt_meth.c +++ b/crypto/evp/keymgmt_meth.c @@ -251,7 +251,7 @@ const OSSL_PROVIDER *EVP_KEYMGMT_get0_provider(const EVP_KEYMGMT *keymgmt) return keymgmt->prov; } -int EVP_KEYMGMT_get_number(const EVP_KEYMGMT *keymgmt) +int evp_keymgmt_get_number(const EVP_KEYMGMT *keymgmt) { return keymgmt->name_id; } diff --git a/crypto/evp/mac_lib.c b/crypto/evp/mac_lib.c index bd8543b2c4..339d10919f 100644 --- a/crypto/evp/mac_lib.c +++ b/crypto/evp/mac_lib.c @@ -203,7 +203,7 @@ int EVP_MAC_CTX_set_params(EVP_MAC_CTX *ctx, const OSSL_PARAM params[]) return 1; } -int EVP_MAC_get_number(const EVP_MAC *mac) +int evp_mac_get_number(const EVP_MAC *mac) { return mac->name_id; } diff --git a/crypto/evp/signature.c b/crypto/evp/signature.c index 9b289d315b..b31f6a4bd0 100644 --- a/crypto/evp/signature.c +++ b/crypto/evp/signature.c @@ -319,7 +319,7 @@ int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name) return evp_is_a(signature->prov, signature->name_id, NULL, name); } -int EVP_SIGNATURE_get_number(const EVP_SIGNATURE *signature) +int evp_signature_get_number(const EVP_SIGNATURE *signature) { return signature->name_id; } diff --git a/crypto/store/store_meth.c b/crypto/store/store_meth.c index 7f11d4fbea..26ad25b5b8 100644 --- a/crypto/store/store_meth.c +++ b/crypto/store/store_meth.c @@ -393,7 +393,7 @@ const char *OSSL_STORE_LOADER_get0_properties(const OSSL_STORE_LOADER *loader) return loader->propdef; } -int OSSL_STORE_LOADER_get_number(const OSSL_STORE_LOADER *loader) +int ossl_store_loader_get_number(const OSSL_STORE_LOADER *loader) { if (!ossl_assert(loader != NULL)) { ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_PASSED_NULL_PARAMETER); diff --git a/include/openssl/decoder.h b/include/openssl/decoder.h index a939d0dcb1..d4ee2cf413 100644 --- a/include/openssl/decoder.h +++ b/include/openssl/decoder.h @@ -33,7 +33,6 @@ void OSSL_DECODER_free(OSSL_DECODER *encoder); const OSSL_PROVIDER *OSSL_DECODER_get0_provider(const OSSL_DECODER *encoder); const char *OSSL_DECODER_get0_properties(const OSSL_DECODER *encoder); -int OSSL_DECODER_get_number(const OSSL_DECODER *encoder); const char *OSSL_DECODER_get0_name(const OSSL_DECODER *decoder); const char *OSSL_DECODER_get0_description(const OSSL_DECODER *decoder); int OSSL_DECODER_is_a(const OSSL_DECODER *encoder, const char *name); diff --git a/include/openssl/encoder.h b/include/openssl/encoder.h index 62560ba3c2..e62e33fc89 100644 --- a/include/openssl/encoder.h +++ b/include/openssl/encoder.h @@ -33,7 +33,6 @@ void OSSL_ENCODER_free(OSSL_ENCODER *encoder); const OSSL_PROVIDER *OSSL_ENCODER_get0_provider(const OSSL_ENCODER *encoder); const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder); -int OSSL_ENCODER_get_number(const OSSL_ENCODER *encoder); const char *OSSL_ENCODER_get0_name(const OSSL_ENCODER *kdf); const char *OSSL_ENCODER_get0_description(const OSSL_ENCODER *kdf); int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name); diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 3f5693824c..c4338dae9c 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -534,7 +534,6 @@ int EVP_MD_get_type(const EVP_MD *md); const char *EVP_MD_get0_name(const EVP_MD *md); # define EVP_MD_name EVP_MD_get0_name const char *EVP_MD_get0_description(const EVP_MD *md); -int EVP_MD_get_number(const EVP_MD *md); int EVP_MD_is_a(const EVP_MD *md, const char *name); int EVP_MD_names_do_all(const EVP_MD *md, void (*fn)(const char *name, void *data), @@ -580,7 +579,6 @@ int EVP_CIPHER_get_nid(const EVP_CIPHER *cipher); const char *EVP_CIPHER_get0_name(const EVP_CIPHER *cipher); # define EVP_CIPHER_name EVP_CIPHER_get0_name const char *EVP_CIPHER_get0_description(const EVP_CIPHER *cipher); -int EVP_CIPHER_get_number(const EVP_CIPHER *cipher); int EVP_CIPHER_is_a(const EVP_CIPHER *cipher, const char *name); int EVP_CIPHER_names_do_all(const EVP_CIPHER *cipher, void (*fn)(const char *name, void *data), @@ -1193,7 +1191,6 @@ EVP_MAC *EVP_MAC_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, const char *properties); int EVP_MAC_up_ref(EVP_MAC *mac); void EVP_MAC_free(EVP_MAC *mac); -int EVP_MAC_get_number(const EVP_MAC *mac); const char *EVP_MAC_get0_name(const EVP_MAC *mac); const char *EVP_MAC_get0_description(const EVP_MAC *mac); int EVP_MAC_is_a(const EVP_MAC *mac, const char *name); @@ -1238,7 +1235,6 @@ EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, const char *properties); int EVP_RAND_up_ref(EVP_RAND *rand); void EVP_RAND_free(EVP_RAND *rand); -int EVP_RAND_get_number(const EVP_RAND *rand); const char *EVP_RAND_get0_name(const EVP_RAND *rand); const char *EVP_RAND_get0_description(const EVP_RAND *md); int EVP_RAND_is_a(const EVP_RAND *rand, const char *name); @@ -1757,7 +1753,6 @@ void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt); const OSSL_PROVIDER *EVP_KEYMGMT_get0_provider(const EVP_KEYMGMT *keymgmt); const char *EVP_KEYMGMT_get0_name(const EVP_KEYMGMT *keymgmt); const char *EVP_KEYMGMT_get0_description(const EVP_KEYMGMT *keymgmt); -int EVP_KEYMGMT_get_number(const EVP_KEYMGMT *keymgmt); int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name); void EVP_KEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_KEYMGMT *keymgmt, void *arg), @@ -1840,7 +1835,6 @@ OSSL_PROVIDER *EVP_SIGNATURE_get0_provider(const EVP_SIGNATURE *signature); EVP_SIGNATURE *EVP_SIGNATURE_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties); int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name); -int EVP_SIGNATURE_get_number(const EVP_SIGNATURE *signature); const char *EVP_SIGNATURE_get0_name(const EVP_SIGNATURE *signature); const char *EVP_SIGNATURE_get0_description(const EVP_SIGNATURE *signature); void EVP_SIGNATURE_do_all_provided(OSSL_LIB_CTX *libctx, @@ -1859,7 +1853,6 @@ OSSL_PROVIDER *EVP_ASYM_CIPHER_get0_provider(const EVP_ASYM_CIPHER *cipher); EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties); int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name); -int EVP_ASYM_CIPHER_get_number(const EVP_ASYM_CIPHER *cipher); const char *EVP_ASYM_CIPHER_get0_name(const EVP_ASYM_CIPHER *cipher); const char *EVP_ASYM_CIPHER_get0_description(const EVP_ASYM_CIPHER *cipher); void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx, @@ -1878,7 +1871,6 @@ OSSL_PROVIDER *EVP_KEM_get0_provider(const EVP_KEM *wrap); EVP_KEM *EVP_KEM_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties); int EVP_KEM_is_a(const EVP_KEM *wrap, const char *name); -int EVP_KEM_get_number(const EVP_KEM *wrap); const char *EVP_KEM_get0_name(const EVP_KEM *wrap); const char *EVP_KEM_get0_description(const EVP_KEM *wrap); void EVP_KEM_do_all_provided(OSSL_LIB_CTX *libctx, @@ -2143,7 +2135,6 @@ EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties); OSSL_PROVIDER *EVP_KEYEXCH_get0_provider(const EVP_KEYEXCH *exchange); int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *keyexch, const char *name); -int EVP_KEYEXCH_get_number(const EVP_KEYEXCH *keyexch); const char *EVP_KEYEXCH_get0_name(const EVP_KEYEXCH *keyexch); const char *EVP_KEYEXCH_get0_description(const EVP_KEYEXCH *keyexch); void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx, diff --git a/include/openssl/kdf.h b/include/openssl/kdf.h index 2cc4fc4ad2..0983230a48 100644 --- a/include/openssl/kdf.h +++ b/include/openssl/kdf.h @@ -33,7 +33,6 @@ EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, EVP_KDF_CTX *EVP_KDF_CTX_new(EVP_KDF *kdf); void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx); EVP_KDF_CTX *EVP_KDF_CTX_dup(const EVP_KDF_CTX *src); -int EVP_KDF_get_number(const EVP_KDF *kdf); const char *EVP_KDF_get0_description(const EVP_KDF *kdf); int EVP_KDF_is_a(const EVP_KDF *kdf, const char *name); const char *EVP_KDF_get0_name(const EVP_KDF *kdf); diff --git a/include/openssl/store.h b/include/openssl/store.h index 746bb0321e..c3e9beeff6 100644 --- a/include/openssl/store.h +++ b/include/openssl/store.h @@ -261,7 +261,6 @@ void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader); const OSSL_PROVIDER *OSSL_STORE_LOADER_get0_provider(const OSSL_STORE_LOADER * loader); const char *OSSL_STORE_LOADER_get0_properties(const OSSL_STORE_LOADER *loader); -int OSSL_STORE_LOADER_get_number(const OSSL_STORE_LOADER *loader); const char *OSSL_STORE_LOADER_get0_description(const OSSL_STORE_LOADER *loader); int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader, const char *scheme); diff --git a/util/libcrypto.num b/util/libcrypto.num index f53092a0a4..5b1a67dec0 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -4783,13 +4783,6 @@ EVP_KEYMGMT_names_do_all 4910 3_0_0 EXIST::FUNCTION: EVP_KEYEXCH_names_do_all 4911 3_0_0 EXIST::FUNCTION: EVP_KDF_names_do_all 4912 3_0_0 EXIST::FUNCTION: EVP_SIGNATURE_names_do_all 4913 3_0_0 EXIST::FUNCTION: -EVP_MD_get_number 4914 3_0_0 EXIST::FUNCTION: -EVP_CIPHER_get_number 4915 3_0_0 EXIST::FUNCTION: -EVP_MAC_get_number 4916 3_0_0 EXIST::FUNCTION: -EVP_KEYMGMT_get_number 4917 3_0_0 EXIST::FUNCTION: -EVP_KEYEXCH_get_number 4918 3_0_0 EXIST::FUNCTION: -EVP_KDF_get_number 4919 3_0_0 EXIST::FUNCTION: -EVP_SIGNATURE_get_number 4920 3_0_0 EXIST::FUNCTION: OSSL_CMP_CTX_snprint_PKIStatus 4921 3_0_0 EXIST::FUNCTION:CMP OSSL_CMP_HDR_get0_transactionID 4922 3_0_0 EXIST::FUNCTION:CMP OSSL_CMP_HDR_get0_recipNonce 4923 3_0_0 EXIST::FUNCTION:CMP @@ -4805,7 +4798,6 @@ EVP_ASYM_CIPHER_up_ref 4932 3_0_0 EXIST::FUNCTION: EVP_ASYM_CIPHER_get0_provider 4933 3_0_0 EXIST::FUNCTION: EVP_ASYM_CIPHER_fetch 4934 3_0_0 EXIST::FUNCTION: EVP_ASYM_CIPHER_is_a 4935 3_0_0 EXIST::FUNCTION: -EVP_ASYM_CIPHER_get_number 4936 3_0_0 EXIST::FUNCTION: EVP_ASYM_CIPHER_do_all_provided 4937 3_0_0 EXIST::FUNCTION: EVP_ASYM_CIPHER_names_do_all 4938 3_0_0 EXIST::FUNCTION: EVP_PKEY_CTX_set_rsa_padding 4939 3_0_0 EXIST::FUNCTION: @@ -4827,7 +4819,6 @@ EVP_PKEY_meth_get_digestverify 4954 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_ OSSL_ENCODER_up_ref 4955 3_0_0 EXIST::FUNCTION: OSSL_ENCODER_free 4956 3_0_0 EXIST::FUNCTION: OSSL_ENCODER_fetch 4957 3_0_0 EXIST::FUNCTION: -OSSL_ENCODER_get_number 4958 3_0_0 EXIST::FUNCTION: OSSL_ENCODER_is_a 4959 3_0_0 EXIST::FUNCTION: OSSL_ENCODER_get0_provider 4960 3_0_0 EXIST::FUNCTION: OSSL_ENCODER_do_all_provided 4961 3_0_0 EXIST::FUNCTION: @@ -5043,7 +5034,6 @@ OSSL_PARAM_set_all_unmodified 5170 3_0_0 EXIST::FUNCTION: EVP_RAND_fetch 5171 3_0_0 EXIST::FUNCTION: EVP_RAND_up_ref 5172 3_0_0 EXIST::FUNCTION: EVP_RAND_free 5173 3_0_0 EXIST::FUNCTION: -EVP_RAND_get_number 5174 3_0_0 EXIST::FUNCTION: EVP_RAND_get0_name 5175 3_0_0 EXIST::FUNCTION: EVP_RAND_is_a 5176 3_0_0 EXIST::FUNCTION: EVP_RAND_get0_provider 5177 3_0_0 EXIST::FUNCTION: @@ -5115,7 +5105,6 @@ OSSL_DECODER_up_ref 5242 3_0_0 EXIST::FUNCTION: OSSL_DECODER_free 5243 3_0_0 EXIST::FUNCTION: OSSL_DECODER_get0_provider 5244 3_0_0 EXIST::FUNCTION: OSSL_DECODER_get0_properties 5245 3_0_0 EXIST::FUNCTION: -OSSL_DECODER_get_number 5246 3_0_0 EXIST::FUNCTION: OSSL_DECODER_is_a 5247 3_0_0 EXIST::FUNCTION: OSSL_DECODER_do_all_provided 5248 3_0_0 EXIST::FUNCTION: OSSL_DECODER_names_do_all 5249 3_0_0 EXIST::FUNCTION: @@ -5219,7 +5208,6 @@ OSSL_STORE_LOADER_fetch 5346 3_0_0 EXIST::FUNCTION: OSSL_STORE_LOADER_up_ref 5347 3_0_0 EXIST::FUNCTION: OSSL_STORE_LOADER_get0_provider 5348 3_0_0 EXIST::FUNCTION: OSSL_STORE_LOADER_get0_properties 5349 3_0_0 EXIST::FUNCTION: -OSSL_STORE_LOADER_get_number 5350 3_0_0 EXIST::FUNCTION: OSSL_STORE_LOADER_is_a 5351 3_0_0 EXIST::FUNCTION: OSSL_STORE_LOADER_do_all_provided 5352 3_0_0 EXIST::FUNCTION: OSSL_STORE_LOADER_names_do_all 5353 3_0_0 EXIST::FUNCTION: @@ -5245,7 +5233,6 @@ EVP_KEM_up_ref 5372 3_0_0 EXIST::FUNCTION: EVP_KEM_get0_provider 5373 3_0_0 EXIST::FUNCTION: EVP_KEM_fetch 5374 3_0_0 EXIST::FUNCTION: EVP_KEM_is_a 5375 3_0_0 EXIST::FUNCTION: -EVP_KEM_get_number 5376 3_0_0 EXIST::FUNCTION: EVP_KEM_do_all_provided 5377 3_0_0 EXIST::FUNCTION: EVP_KEM_names_do_all 5378 3_0_0 EXIST::FUNCTION: EVP_PKEY_encapsulate_init 5379 3_0_0 EXIST::FUNCTION: