[openssl/openssl] 0b3867: Fix error propagatation in BN_check_prime()

Kazuki Yamaguchi noreply at github.com
Tue Oct 4 08:06:48 UTC 2022


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 0b3867634f74f6cb7b60b3a0adde396421207214
      https://github.com/openssl/openssl/commit/0b3867634f74f6cb7b60b3a0adde396421207214
  Author: Kazuki Yamaguchi <k at rhe.jp>
  Date:   2022-10-04 (Tue, 04 Oct 2022)

  Changed paths:
    M crypto/bn/bn_prime.c

  Log Message:
  -----------
  Fix error propagatation in BN_check_prime()

BN_check_prime() is supposed to return 0 for a composite number and -1
on error. Properly translate the return value of the internal function
ossl_bn_miller_rabin_is_prime(), where 0 means an error.

The confusion prevented BN_GENCB callbacks from aborting the primality
test or key generation routines utilizing this.

Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Nicola Tuveri <nic.tuv at gmail.com>
Reviewed-by: Paul Dale <pauli at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19314)




More information about the openssl-commits mailing list