diff options
author | Christian Lamparter <chunkeey@gmail.com> | 2019-05-31 20:13:55 +0200 |
---|---|---|
committer | Christian Lamparter <chunkeey@gmail.com> | 2019-06-02 11:08:38 +0200 |
commit | 06e63aad5776947cbbd500d57d77f925b2f72629 (patch) | |
tree | 8d0b12b5a2a0af9cc756934f34d53494a55ae324 /target/linux/apm821xx/patches-4.19/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch | |
parent | dfa86b01e505a1dacad82ccd60f1133e395a6d17 (diff) | |
download | upstream-06e63aad5776947cbbd500d57d77f925b2f72629.tar.gz upstream-06e63aad5776947cbbd500d57d77f925b2f72629.tar.bz2 upstream-06e63aad5776947cbbd500d57d77f925b2f72629.zip |
apm821xx: backport accepted linux-crypto patches to 4.19
This patch brings the crypto4xx driver up to the latest
upstream changes.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'target/linux/apm821xx/patches-4.19/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch')
-rw-r--r-- | target/linux/apm821xx/patches-4.19/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/target/linux/apm821xx/patches-4.19/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch b/target/linux/apm821xx/patches-4.19/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch new file mode 100644 index 0000000000..a6fa84d962 --- /dev/null +++ b/target/linux/apm821xx/patches-4.19/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch @@ -0,0 +1,60 @@ +From bfa2ba7d9e6b20aca82b99e6842fe18842ae3a0f Mon Sep 17 00:00:00 2001 +From: Christian Lamparter <chunkeey@gmail.com> +Date: Fri, 17 May 2019 23:15:57 +0200 +Subject: [PATCH 13/15] crypto: crypto4xx - fix AES CTR blocksize value + +This patch fixes a issue with crypto4xx's ctr(aes) that was +discovered by libcapi's kcapi-enc-test.sh test. + +The some of the ctr(aes) encryptions test were failing on the +non-power-of-two test: + +kcapi-enc - Error: encryption failed with error 0 +kcapi-enc - Error: decryption failed with error 0 +[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits): +original file (1d100e..cc96184c) and generated file (e3b0c442..1b7852b855) +[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits) +(openssl generated CT): original file (e3b0..5) and generated file (3..8e) +[PASSED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits) +(openssl generated PT) +[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (password): +original file (1d1..84c) and generated file (e3b..852b855) + +But the 16, 32, 512, 65536 tests always worked. + +Thankfully, this isn't a hidden hardware problem like previously, +instead this turned out to be a copy and paste issue. + +With this patch, all the tests are passing with and +kcapi-enc-test.sh gives crypto4xx's a clean bill of health: + "Number of failures: 0" :). + +Cc: stable@vger.kernel.org +Fixes: 98e87e3d933b ("crypto: crypto4xx - add aes-ctr support") +Fixes: f2a13e7cba9e ("crypto: crypto4xx - enable AES RFC3686, ECB, CFB and OFB offloads") +Signed-off-by: Christian Lamparter <chunkeey@gmail.com> +Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> +--- + drivers/crypto/amcc/crypto4xx_core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1257,7 +1257,7 @@ static struct crypto4xx_alg_common crypt + .cra_flags = CRYPTO_ALG_NEED_FALLBACK | + CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, +- .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_blocksize = 1, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_module = THIS_MODULE, + }, +@@ -1277,7 +1277,7 @@ static struct crypto4xx_alg_common crypt + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, + .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, +- .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_blocksize = 1, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_module = THIS_MODULE, + }, |