android_kernel_oneplus_msm8998/arch/arm64
Elena Petrova e3730353f1 crypto: arm64/sha2-ce - correct digest for empty data in finup
commit 6bd934de1e393466b319d29c4427598fda096c57 upstream.

The sha256-ce finup implementation for ARM64 produces wrong digest
for empty input (len=0). Expected: the actual digest, result: initial
value of SHA internal state. The error is in sha256_ce_finup:
for empty data `finalize` will be 1, so the code is relying on
sha2_ce_transform to make the final round. However, in
sha256_base_do_update, the block function will not be called when
len == 0.

Fix it by setting finalize to 0 if data is empty.

Fixes: 03802f6a80 ("crypto: arm64/sha2-ce - move SHA-224/256 ARMv8 implementation to base layer")
Cc: stable@vger.kernel.org
Signed-off-by: Elena Petrova <lenaptr@google.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-04 09:34:49 +02:00
..
boot arm64: dts: stratix10: Correct System Manager register size 2018-11-21 09:27:37 +01:00
configs arm64 fixes and clean-ups: 2015-11-12 15:33:11 -08:00
crypto crypto: arm64/sha2-ce - correct digest for empty data in finup 2019-08-04 09:34:49 +02:00
include arm64: futex: Restore oldval initialization to work around buggy compilers 2019-04-27 09:34:01 +02:00
kernel acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 2019-08-04 09:34:47 +02:00
kvm arm64/kvm: consistently handle host HCR_EL2 flags 2019-01-26 09:42:49 +01:00
lib arm64: add KASAN support 2015-10-12 17:46:36 +01:00
mm arm64: debug: Don't propagate UNKNOWN FAR into si_code for debug signals 2019-04-27 09:33:47 +02:00
net bpf, arm64: fix jit branch offset related to ldimm64 2017-05-14 13:32:58 +02:00
xen
Kconfig arm64: support keyctl() system call in 32-bit mode 2019-04-03 06:23:29 +02:00
Kconfig.debug arm64: remove redundant FRAME_POINTER kconfig option and force to select it 2015-11-10 10:36:00 +00:00
Kconfig.platforms ARM: tegra: select USB_ULPI from EHCI rather than platform 2018-02-25 11:03:51 +01:00
Makefile arm64: remove no-op -p linker flag 2018-12-01 09:46:36 +01:00