]> git.ipfire.org Git - thirdparty/openssl.git/commit
fix sm2 encryption implementation bug.
authorLiu-Ermeng <liuermeng2@huawei.com>
Mon, 8 Jan 2024 04:01:29 +0000 (20:01 -0800)
committerTomas Mraz <tomas@openssl.org>
Wed, 15 May 2024 09:20:26 +0000 (11:20 +0200)
commitfa03085f26f4c08164f1eea21d0cdc1beb89b38c
tree4c16d9c2f750742e3aa2277b940e441802f1cd1d
parent2ae3b0b22cc58eb41da8a1d362bfbc39cfb6ad67
fix sm2 encryption implementation bug.

According to the "GB/T 32918.4-2016"
section 6.1 encryption, step A5:
If result of the "KDF" is all zeros, we should go back to
the begin(step A1).

section 7.1 decryption, step B4:
If result of the "KDF" is all zeros, we should raise error and exit.

Signed-off-by: Liu-Ermeng <liuermeng2@huawei.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23210)

(cherry picked from commit 170620675dfd74f34bdcf8aba71dffeb07f3d533)
crypto/sm2/sm2_crypt.c