[openssl/openssl] fa0308: fix sm2 encryption implementation bug.

Liu-ErMeng noreply at github.com
Wed May 15 09:23:04 UTC 2024


  Branch: refs/heads/openssl-3.1
  Home:   https://github.com/openssl/openssl
  Commit: fa03085f26f4c08164f1eea21d0cdc1beb89b38c
      https://github.com/openssl/openssl/commit/fa03085f26f4c08164f1eea21d0cdc1beb89b38c
  Author: Liu-Ermeng <liuermeng2 at huawei.com>
  Date:   2024-05-15 (Wed, 15 May 2024)

  Changed paths:
    M crypto/sm2/sm2_crypt.c

  Log Message:
  -----------
  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 at huawei.com>

Reviewed-by: Neil Horman <nhorman at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23210)

(cherry picked from commit 170620675dfd74f34bdcf8aba71dffeb07f3d533)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications


More information about the openssl-commits mailing list