Re: [PATCH v2 05/19] rsatoc: rename rsa_err() to openssl_error()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Sascha,

On 01.08.24 07:57, Sascha Hauer wrote:
> There's nothing rsa_err() specific in this function, rename to
> openssl_error().
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

Reviewed-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>

Just one nit below, which can follow separately though.

> ---
>  scripts/rsatoc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/rsatoc.c b/scripts/rsatoc.c
> index 462963424a..1d2eb48d08 100644
> --- a/scripts/rsatoc.c
> +++ b/scripts/rsatoc.c
> @@ -21,7 +21,7 @@
>  
>  static int dts, standalone;
>  
> -static int rsa_err(const char *msg)
> +static int openssl_error(const char *msg)
>  {
>  	unsigned long sslErr = ERR_get_error();
>  
> @@ -61,7 +61,7 @@ static int pem_get_pub_key(const char *path, EVP_PKEY **pkey)
>  		rewind(f);
>  		key = PEM_read_PUBKEY(f, NULL, NULL, NULL);
>  		if (!key) {
> -			rsa_err("Couldn't read certificate");
> +			openssl_error("Couldn't read certificate");
>  			ret = -EINVAL;
>  			goto err_cert;
>  		}
> @@ -69,7 +69,7 @@ static int pem_get_pub_key(const char *path, EVP_PKEY **pkey)
>  		/* Get the public key from the certificate. */
>  		key = X509_get_pubkey(cert);
>  		if (!key) {
> -			rsa_err("Couldn't read public key\n");
> +			openssl_error("Couldn't read public key\n");

No fault of this patch, but this trailing line feed should be dropped,
so the error message doesn't span two lines.

>  			ret = -EINVAL;
>  			goto err_pubkey;
>  		}
> @@ -103,7 +103,7 @@ static int engine_get_pub_key(const char *key_id,
>  {
>  	*key = ENGINE_load_public_key(engine, key_id, NULL, NULL);
>  	if (!*key)
> -		return rsa_err("Failure loading public key from engine");
> +		return openssl_error("Failure loading public key from engine");
>  
>  	return 0;
>  }
> @@ -173,7 +173,7 @@ static int rsa_get_params(EVP_PKEY *key, uint64_t *exponent, uint32_t *n0_invp,
>  	/* Convert to a RSA_style key. */
>  	rsa = EVP_PKEY_get1_RSA(key);
>  	if (!rsa) {
> -		rsa_err("Couldn't convert to a RSA style key");
> +		openssl_error("Couldn't convert to a RSA style key");
>  		return -EINVAL;
>  	}
>  

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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux