]> 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:17:14 +0000 (11:17 +0200)
commit170620675dfd74f34bdcf8aba71dffeb07f3d533
tree1b5b02052fb896b07c93ee5c53ab90a3882b5a21
parentf6e469808501f52c7e8f8679d6c3290cf1c258b3
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)
crypto/sm2/sm2_crypt.c