The ret argument is freed on failure which might be
surprising to callers.
Reported by: Minkyung Park (UNIST)
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
MergeDate: Mon Aug 10 15:09:34 2026
(Merged from https://github.com/openssl/openssl/pull/32099)
-1 on error.
BN_generate_prime() returns the prime number on success, B<NULL> otherwise.
+Please note that the B<ret> BIGNUM is freed on failure and must not be
+used or freed by the caller in such case.
BN_GENCB_new returns a pointer to a BN_GENCB structure on success, or B<NULL>
otherwise.