diff mbox series

[v5,01/16] openssl_DECRYPT_init: Fix error message on missing iv

Message ID 20250904115704.58413-2-Michael.Glembotzki@iris-sensing.com
State Changes Requested
Delegated to: Stefano Babic
Headers show
Series Add support for asymmetric decryption | expand

Commit Message

Michael Glembotzki Sept. 4, 2025, 11:49 a.m. UTC
Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com>
---
 crypto/swupdate_decrypt_mbedtls.c | 2 +-
 crypto/swupdate_decrypt_openssl.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Babic Sept. 8, 2025, 9:45 a.m. UTC | #1
On 9/4/25 13:49, Michael Glembotzki wrote:
> Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com>
> ---
>   crypto/swupdate_decrypt_mbedtls.c | 2 +-
>   crypto/swupdate_decrypt_openssl.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/crypto/swupdate_decrypt_mbedtls.c b/crypto/swupdate_decrypt_mbedtls.c
> index ce96966d..c87a2c3d 100644
> --- a/crypto/swupdate_decrypt_mbedtls.c
> +++ b/crypto/swupdate_decrypt_mbedtls.c
> @@ -21,7 +21,7 @@ static void *mbedtls_DECRYPT_init(unsigned char *key, char keylen, unsigned char
>   	int error;
>   
>   	if ((key == NULL) || (iv == NULL)) {
> -		ERROR("no key provided for decryption!");
> +		ERROR("no key or iv provided for decryption!");
>   		return NULL;
>   	}
>   
> diff --git a/crypto/swupdate_decrypt_openssl.c b/crypto/swupdate_decrypt_openssl.c
> index 6eb933df..3f632d6d 100644
> --- a/crypto/swupdate_decrypt_openssl.c
> +++ b/crypto/swupdate_decrypt_openssl.c
> @@ -29,7 +29,7 @@ static void *openssl_DECRYPT_init(unsigned char *key, char keylen, unsigned char
>   	int ret;
>   
>   	if ((key == NULL) || (iv == NULL)) {
> -		ERROR("no key provided for decryption!");
> +		ERROR("no key or iv provided for decryption!");
>   		return NULL;
>   	}
>   

Reviewed-by: Stefano Babic <stefano.babic@swupdate.org>
Stefano Babic Sept. 14, 2025, 8:36 a.m. UTC | #2
On 04.09.25 13:49, Michael Glembotzki wrote:
> Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com>
> ---
>   crypto/swupdate_decrypt_mbedtls.c | 2 +-
>   crypto/swupdate_decrypt_openssl.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/crypto/swupdate_decrypt_mbedtls.c b/crypto/swupdate_decrypt_mbedtls.c
> index ce96966d..c87a2c3d 100644
> --- a/crypto/swupdate_decrypt_mbedtls.c
> +++ b/crypto/swupdate_decrypt_mbedtls.c
> @@ -21,7 +21,7 @@ static void *mbedtls_DECRYPT_init(unsigned char *key, char keylen, unsigned char
>   	int error;
>   
>   	if ((key == NULL) || (iv == NULL)) {
> -		ERROR("no key provided for decryption!");
> +		ERROR("no key or iv provided for decryption!");
>   		return NULL;
>   	}
>   
> diff --git a/crypto/swupdate_decrypt_openssl.c b/crypto/swupdate_decrypt_openssl.c
> index 6eb933df..3f632d6d 100644
> --- a/crypto/swupdate_decrypt_openssl.c
> +++ b/crypto/swupdate_decrypt_openssl.c
> @@ -29,7 +29,7 @@ static void *openssl_DECRYPT_init(unsigned char *key, char keylen, unsigned char
>   	int ret;
>   
>   	if ((key == NULL) || (iv == NULL)) {
> -		ERROR("no key provided for decryption!");
> +		ERROR("no key or iv provided for decryption!");
>   		return NULL;
>   	}
>   

This can simply be applied, done.

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/crypto/swupdate_decrypt_mbedtls.c b/crypto/swupdate_decrypt_mbedtls.c
index ce96966d..c87a2c3d 100644
--- a/crypto/swupdate_decrypt_mbedtls.c
+++ b/crypto/swupdate_decrypt_mbedtls.c
@@ -21,7 +21,7 @@  static void *mbedtls_DECRYPT_init(unsigned char *key, char keylen, unsigned char
 	int error;
 
 	if ((key == NULL) || (iv == NULL)) {
-		ERROR("no key provided for decryption!");
+		ERROR("no key or iv provided for decryption!");
 		return NULL;
 	}
 
diff --git a/crypto/swupdate_decrypt_openssl.c b/crypto/swupdate_decrypt_openssl.c
index 6eb933df..3f632d6d 100644
--- a/crypto/swupdate_decrypt_openssl.c
+++ b/crypto/swupdate_decrypt_openssl.c
@@ -29,7 +29,7 @@  static void *openssl_DECRYPT_init(unsigned char *key, char keylen, unsigned char
 	int ret;
 
 	if ((key == NULL) || (iv == NULL)) {
-		ERROR("no key provided for decryption!");
+		ERROR("no key or iv provided for decryption!");
 		return NULL;
 	}