diff mbox

[6/6] crypto: fix transposed arguments in cipher error message

Message ID 1450714014-16849-7-git-send-email-berrange@redhat.com
State New
Headers show

Commit Message

Daniel P. Berrangé Dec. 21, 2015, 4:06 p.m. UTC
When reporting an incorrect key length for a cipher, we
mixed up the actual vs expected arguments.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 crypto/cipher.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Blake Dec. 21, 2015, 4:33 p.m. UTC | #1
On 12/21/2015 09:06 AM, Daniel P. Berrange wrote:
> When reporting an incorrect key length for a cipher, we
> mixed up the actual vs expected arguments.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  crypto/cipher.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/crypto/cipher.c b/crypto/cipher.c
> index e92d49a..a69ff5e 100644
> --- a/crypto/cipher.c
> +++ b/crypto/cipher.c
> @@ -89,7 +89,7 @@ qcrypto_cipher_validate_key_length(QCryptoCipherAlgorithm alg,
>  
>      if (alg_key_len[alg] != nkey) {
>          error_setg(errp, "Cipher key length %zu should be %zu",
> -                   alg_key_len[alg], nkey);
> +                   nkey, alg_key_len[alg]);
>          return false;
>      }
>      return true;
>
diff mbox

Patch

diff --git a/crypto/cipher.c b/crypto/cipher.c
index e92d49a..a69ff5e 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -89,7 +89,7 @@  qcrypto_cipher_validate_key_length(QCryptoCipherAlgorithm alg,
 
     if (alg_key_len[alg] != nkey) {
         error_setg(errp, "Cipher key length %zu should be %zu",
-                   alg_key_len[alg], nkey);
+                   nkey, alg_key_len[alg]);
         return false;
     }
     return true;