[PATCH] crypto: Followup to crypto symbol renaming for algo registration

Sascha Hauer sha at pengutronix.de
Mon Mar 28 03:03:02 PDT 2022


On Tue, Mar 22, 2022 at 10:00:07AM +0100, Uwe Kleine-König wrote:
> The symbols were renamed to a nicer and consistent naming scheme, but I
> missed to adapt a few usages.
> 
> This was done using:
> 
> 	perl -p -i -e 's/\bCONFIG_(?:DIGEST_)?(MD5|SHA1|SHA224|SHA256|SHA384|SHA512|HMAC)\b/CONFIG_HAVE_DIGEST_$1/;' crypto/hmac.c crypto/sha2.c crypto/sha4.c
> 
> Now there don't seem to be any old names left:
> 
> Reported-by: Renaud Barbier <Renaud.Barbier at ametek.com>
> Fixes: 03fb5524b064 ("crypto: consistently name the algo digest symbols HAVE_DIGEST_...")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
>  crypto/hmac.c | 12 ++++++------
>  crypto/sha2.c |  4 ++--
>  crypto/sha4.c |  4 ++--
>  3 files changed, 10 insertions(+), 10 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/crypto/hmac.c b/crypto/hmac.c
> index 37b270df7a95..20fc470d9059 100644
> --- a/crypto/hmac.c
> +++ b/crypto/hmac.c
> @@ -181,17 +181,17 @@ static int digest_hmac_register(char *name, unsigned int pad_length)
>  
>  static int digest_hmac_initcall(void)
>  {
> -	if (IS_ENABLED(CONFIG_MD5))
> +	if (IS_ENABLED(CONFIG_HAVE_DIGEST_MD5))
>  		digest_hmac_register("md5", 64);
> -	if (IS_ENABLED(CONFIG_SHA1))
> +	if (IS_ENABLED(CONFIG_HAVE_DIGEST_SHA1))
>  		digest_hmac_register("sha1", 64);
> -	if (IS_ENABLED(CONFIG_SHA224))
> +	if (IS_ENABLED(CONFIG_HAVE_DIGEST_SHA224))
>  		digest_hmac_register("sha224", 64);
> -	if (IS_ENABLED(CONFIG_SHA256))
> +	if (IS_ENABLED(CONFIG_HAVE_DIGEST_SHA256))
>  		digest_hmac_register("sha256", 64);
> -	if (IS_ENABLED(CONFIG_SHA384))
> +	if (IS_ENABLED(CONFIG_HAVE_DIGEST_SHA384))
>  		digest_hmac_register("sha384", 128);
> -	if (IS_ENABLED(CONFIG_SHA512))
> +	if (IS_ENABLED(CONFIG_HAVE_DIGEST_SHA512))
>  		digest_hmac_register("sha512", 128);
>  
>  	return 0;
> diff --git a/crypto/sha2.c b/crypto/sha2.c
> index 013f5bb3b248..cac509564814 100644
> --- a/crypto/sha2.c
> +++ b/crypto/sha2.c
> @@ -338,7 +338,7 @@ static struct digest_algo m224 = {
>  
>  static int sha224_digest_register(void)
>  {
> -	if (!IS_ENABLED(CONFIG_SHA224))
> +	if (!IS_ENABLED(CONFIG_HAVE_DIGEST_SHA224))
>  		return 0;
>  
>  	return digest_algo_register(&m224);
> @@ -365,7 +365,7 @@ struct digest_algo m256 = {
>  #ifndef __PBL__
>  static int sha256_digest_register(void)
>  {
> -	if (!IS_ENABLED(CONFIG_SHA256))
> +	if (!IS_ENABLED(CONFIG_HAVE_DIGEST_SHA256))
>  		return 0;
>  
>  	return digest_algo_register(&m256);
> diff --git a/crypto/sha4.c b/crypto/sha4.c
> index a2e90c0a2cae..8c94f5011dc2 100644
> --- a/crypto/sha4.c
> +++ b/crypto/sha4.c
> @@ -258,7 +258,7 @@ static struct digest_algo m384 = {
>  
>  static int sha384_digest_register(void)
>  {
> -	if (!IS_ENABLED(CONFIG_SHA384))
> +	if (!IS_ENABLED(CONFIG_HAVE_DIGEST_SHA384))
>  		return 0;
>  
>  	return digest_algo_register(&m384);
> @@ -284,7 +284,7 @@ static struct digest_algo m512 = {
>  
>  static int sha512_digest_register(void)
>  {
> -	if (!IS_ENABLED(CONFIG_SHA512))
> +	if (!IS_ENABLED(CONFIG_HAVE_DIGEST_SHA512))
>  		return 0;
>  
>  	return digest_algo_register(&m512);
> -- 
> 2.35.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list