From: Richard Levitte Date: Thu, 19 Sep 2019 13:04:53 +0000 (+0200) Subject: Remove name string from PROV_CIPHER and PROV_DIGEST X-Git-Tag: openssl-3.0.0-alpha1~1306 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6061cd541332b0917e7001814533c01f895200a8;p=oweals%2Fopenssl.git Remove name string from PROV_CIPHER and PROV_DIGEST It was short lived, as it's not necessary any more. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/9946) --- diff --git a/providers/common/include/internal/provider_util.h b/providers/common/include/internal/provider_util.h index ad7e72293b..9925ac2b09 100644 --- a/providers/common/include/internal/provider_util.h +++ b/providers/common/include/internal/provider_util.h @@ -21,9 +21,6 @@ typedef struct { /* Conditions for legacy EVP_CIPHER uses */ ENGINE *engine; /* cipher engine */ - - /* Name this was fetched by */ - char name[51]; /* A longer name would be unexpected */ } PROV_CIPHER; typedef struct { @@ -37,9 +34,6 @@ typedef struct { /* Conditions for legacy EVP_MD uses */ ENGINE *engine; /* digest engine */ - - /* Name this was fetched by */ - char name[51]; /* A longer name would be unexpected */ } PROV_DIGEST; /* Cipher functions */ @@ -62,7 +56,6 @@ int ossl_prov_cipher_copy(PROV_CIPHER *dst, const PROV_CIPHER *src); /* Query the cipher and associated engine (if any) */ const EVP_CIPHER *ossl_prov_cipher_cipher(const PROV_CIPHER *pc); ENGINE *ossl_prov_cipher_engine(const PROV_CIPHER *pc); -const char *ossl_prov_cipher_name(const PROV_CIPHER *pc); /* Digest functions */ /* @@ -84,7 +77,6 @@ int ossl_prov_digest_copy(PROV_DIGEST *dst, const PROV_DIGEST *src); /* Query the digest and associated engine (if any) */ const EVP_MD *ossl_prov_digest_md(const PROV_DIGEST *pd); ENGINE *ossl_prov_digest_engine(const PROV_DIGEST *pd); -const char *ossl_prov_digest_name(const PROV_DIGEST *pd); /* MAC functions */ /* diff --git a/providers/common/provider_util.c b/providers/common/provider_util.c index 4056878498..796d00d376 100644 --- a/providers/common/provider_util.c +++ b/providers/common/provider_util.c @@ -17,7 +17,6 @@ void ossl_prov_cipher_reset(PROV_CIPHER *pc) pc->alloc_cipher = NULL; pc->cipher = NULL; pc->engine = NULL; - pc->name[0] = '\0'; } int ossl_prov_cipher_copy(PROV_CIPHER *dst, const PROV_CIPHER *src) @@ -27,7 +26,6 @@ int ossl_prov_cipher_copy(PROV_CIPHER *dst, const PROV_CIPHER *src) dst->engine = src->engine; dst->cipher = src->cipher; dst->alloc_cipher = src->alloc_cipher; - OPENSSL_strlcpy(dst->name, src->name, sizeof(dst->name)); return 1; } @@ -79,7 +77,6 @@ int ossl_prov_cipher_load_from_params(PROV_CIPHER *pc, EVP_CIPHER_free(pc->alloc_cipher); pc->cipher = pc->alloc_cipher = EVP_CIPHER_fetch(ctx, p->data, propquery); - OPENSSL_strlcpy(pc->name, p->data, sizeof(pc->name)); /* TODO legacy stuff, to be removed */ #ifndef FIPS_MODE /* Inside the FIPS module, we don't support legacy ciphers */ if (pc->cipher == NULL) @@ -98,18 +95,12 @@ ENGINE *ossl_prov_cipher_engine(const PROV_CIPHER *pc) return pc->engine; } -const char *ossl_prov_cipher_name(const PROV_CIPHER *pc) -{ - return pc->name; -} - void ossl_prov_digest_reset(PROV_DIGEST *pd) { EVP_MD_free(pd->alloc_md); pd->alloc_md = NULL; pd->md = NULL; pd->engine = NULL; - pd->name[0] = '\0'; } int ossl_prov_digest_copy(PROV_DIGEST *dst, const PROV_DIGEST *src) @@ -119,7 +110,6 @@ int ossl_prov_digest_copy(PROV_DIGEST *dst, const PROV_DIGEST *src) dst->engine = src->engine; dst->md = src->md; dst->alloc_md = src->alloc_md; - OPENSSL_strlcpy(dst->name, src->name, sizeof(dst->name)); return 1; } @@ -142,7 +132,6 @@ int ossl_prov_digest_load_from_params(PROV_DIGEST *pd, EVP_MD_free(pd->alloc_md); pd->md = pd->alloc_md = EVP_MD_fetch(ctx, p->data, propquery); - OPENSSL_strlcpy(pd->name, p->data, sizeof(pd->name)); /* TODO legacy stuff, to be removed */ #ifndef FIPS_MODE /* Inside the FIPS module, we don't support legacy digests */ if (pd->md == NULL) @@ -161,11 +150,6 @@ ENGINE *ossl_prov_digest_engine(const PROV_DIGEST *pd) return pd->engine; } -const char *ossl_prov_digest_name(const PROV_DIGEST *pd) -{ - return pd->name; -} - int ossl_prov_macctx_load_from_params(EVP_MAC_CTX **macctx, const OSSL_PARAM params[], const char *macname,