]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
crypto: keywrap - Add missing ULL suffixes for 64-bit constants
authorGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 15 Nov 2017 10:44:28 +0000 (11:44 +0100)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 19 Mar 2018 23:41:12 +0000 (20:41 -0300)
BugLink: http://bugs.launchpad.net/bugs/1756978
[ Upstream commit c9683276dd89906ca9b65696d09104d542171421 ]

On 32-bit (e.g. with m68k-linux-gnu-gcc-4.1):

    crypto/keywrap.c: In function ‘crypto_kw_decrypt’:
    crypto/keywrap.c:191: warning: integer constant is too large for ‘long’ type
    crypto/keywrap.c: In function ‘crypto_kw_encrypt’:
    crypto/keywrap.c:224: warning: integer constant is too large for ‘long’ type

Fixes: 9e49451d7a15365d ("crypto: keywrap - simplify code")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
crypto/keywrap.c

index 744e35134c45f30005b32063d776d09d3a29c5f7..ec5c6a087c90150175a107805efaa4a1b36f3cf3 100644 (file)
@@ -188,7 +188,7 @@ static int crypto_kw_decrypt(struct blkcipher_desc *desc,
        }
 
        /* Perform authentication check */
-       if (block.A != cpu_to_be64(0xa6a6a6a6a6a6a6a6))
+       if (block.A != cpu_to_be64(0xa6a6a6a6a6a6a6a6ULL))
                ret = -EBADMSG;
 
        memzero_explicit(&block, sizeof(struct crypto_kw_block));
@@ -221,7 +221,7 @@ static int crypto_kw_encrypt(struct blkcipher_desc *desc,
         * Place the predefined IV into block A -- for encrypt, the caller
         * does not need to provide an IV, but he needs to fetch the final IV.
         */
-       block.A = cpu_to_be64(0xa6a6a6a6a6a6a6a6);
+       block.A = cpu_to_be64(0xa6a6a6a6a6a6a6a6ULL);
 
        /*
         * src scatterlist is read-only. dst scatterlist is r/w. During the