diff options
author | Daniel Axtens <[email protected]> | 2019-03-15 13:09:01 +1100 |
---|---|---|
committer | Herbert Xu <[email protected]> | 2019-03-22 20:57:28 +0800 |
commit | dcf7b48212c0fab7df69e84fab22d6cb7c8c0fb9 (patch) | |
tree | a670b1274696717035b1ad7582ffc2ec4a8a2098 | |
parent | 5db46ac29a6797541943d3c4081821747e342732 (diff) |
crypto: vmx - fix copy-paste error in CTR mode
The original assembly imported from OpenSSL has two copy-paste
errors in handling CTR mode. When dealing with a 2 or 3 block tail,
the code branches to the CBC decryption exit path, rather than to
the CTR exit path.
This leads to corruption of the IV, which leads to subsequent blocks
being corrupted.
This can be detected with libkcapi test suite, which is available at
https://github.com/smuellerDD/libkcapi
Reported-by: Ondrej Mosnáček <[email protected]>
Fixes: 5c380d623ed3 ("crypto: vmx - Add support for VMS instructions by ASM")
Cc: [email protected]
Signed-off-by: Daniel Axtens <[email protected]>
Tested-by: Michael Ellerman <[email protected]>
Tested-by: Ondrej Mosnacek <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
-rw-r--r-- | drivers/crypto/vmx/aesp8-ppc.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/vmx/aesp8-ppc.pl b/drivers/crypto/vmx/aesp8-ppc.pl index d6a9f63d65ba..de78282b8f44 100644 --- a/drivers/crypto/vmx/aesp8-ppc.pl +++ b/drivers/crypto/vmx/aesp8-ppc.pl @@ -1854,7 +1854,7 @@ Lctr32_enc8x_three: stvx_u $out1,$x10,$out stvx_u $out2,$x20,$out addi $out,$out,0x30 - b Lcbc_dec8x_done + b Lctr32_enc8x_done .align 5 Lctr32_enc8x_two: @@ -1866,7 +1866,7 @@ Lctr32_enc8x_two: stvx_u $out0,$x00,$out stvx_u $out1,$x10,$out addi $out,$out,0x20 - b Lcbc_dec8x_done + b Lctr32_enc8x_done .align 5 Lctr32_enc8x_one: |