From a04400fc74bc2ee9ef396c1619d190b48c072a8c Mon Sep 17 00:00:00 2001 From: Shane Lontis Date: Wed, 11 Nov 2020 15:04:56 +1000 Subject: [PATCH] Remove unused helper functions EVP_str2ctrl() & EVP_hex2ctrl(). These were added when the EVP_MAC work was being done. I dont think these lightweight wrappers are required, and it seems better to remove them, rather than adding documentation. Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/13372) --- crypto/evp/evp_lib.c | 27 --------------------------- include/openssl/evp.h | 9 --------- util/libcrypto.num | 2 -- 3 files changed, 38 deletions(-) diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 81151e4f01d..8da5b2290be 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -991,33 +991,6 @@ int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags) return (ctx->flags & flags); } -int EVP_str2ctrl(int (*cb)(void *ctx, int cmd, void *buf, size_t buflen), - void *ctx, int cmd, const char *value) -{ - size_t len; - - len = strlen(value); - if (len > INT_MAX) - return -1; - return cb(ctx, cmd, (void *)value, len); -} - -int EVP_hex2ctrl(int (*cb)(void *ctx, int cmd, void *buf, size_t buflen), - void *ctx, int cmd, const char *hex) -{ - unsigned char *bin; - long binlen; - int rv = -1; - - bin = OPENSSL_hexstr2buf(hex, &binlen); - if (bin == NULL) - return 0; - if (binlen <= INT_MAX) - rv = cb(ctx, cmd, bin, binlen); - OPENSSL_free(bin); - return rv; -} - int EVP_PKEY_CTX_set_group_name(EVP_PKEY_CTX *ctx, const char *name) { OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END }; diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 7a3da03a890..0dcb56e0789 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -1978,15 +1978,6 @@ const OSSL_PARAM *EVP_KEYEXCH_settable_ctx_params(const EVP_KEYEXCH *keyexch); void EVP_add_alg_module(void); -/* - * Convenient helper functions to transfer string based controls. - * The callback gets called with the parsed value. - */ -int EVP_str2ctrl(int (*cb)(void *ctx, int cmd, void *buf, size_t buflen), - void *ctx, int cmd, const char *value); -int EVP_hex2ctrl(int (*cb)(void *ctx, int cmd, void *buf, size_t buflen), - void *ctx, int cmd, const char *hex); - int EVP_PKEY_CTX_set_group_name(EVP_PKEY_CTX *ctx, const char *name); int EVP_PKEY_CTX_get_group_name(EVP_PKEY_CTX *ctx, char *name, size_t namelen); diff --git a/util/libcrypto.num b/util/libcrypto.num index 5bd793efbcb..0f7dcb2b26d 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -4414,8 +4414,6 @@ EVP_MAC_CTX_get_mac_size ? 3_0_0 EXIST::FUNCTION: EVP_MAC_init ? 3_0_0 EXIST::FUNCTION: EVP_MAC_update ? 3_0_0 EXIST::FUNCTION: EVP_MAC_final ? 3_0_0 EXIST::FUNCTION: -EVP_str2ctrl ? 3_0_0 EXIST::FUNCTION: -EVP_hex2ctrl ? 3_0_0 EXIST::FUNCTION: EVP_PKEY_supports_digest_nid ? 3_0_0 EXIST::FUNCTION: SRP_VBASE_add0_user ? 3_0_0 EXIST::FUNCTION:SRP SRP_user_pwd_new ? 3_0_0 EXIST::FUNCTION:SRP -- 2.47.2