From: kovan Date: Tue, 27 Jan 2026 05:16:06 +0000 (+0100) Subject: doc: Clarify that BN_CTX must not be NULL for BN arithmetic functions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba2f616aa9b9c081bb89a7b1073c90f2c86cccff;p=thirdparty%2Fopenssl.git doc: Clarify that BN_CTX must not be NULL for BN arithmetic functions The documentation for BN_add and related functions did not explicitly state that the ctx parameter cannot be NULL. Users may assume NULL is acceptable since some other OpenSSL functions allow it, but passing NULL to functions like BN_mod_add() or BN_mod() causes a crash. Update the documentation to explicitly state that ctx must not be NULL. Fixes #12092 Co-Authored-By: Claude Opus 4.5 Reviewed-by: Frederik Wedel-Heinen Reviewed-by: Eugene Syromiatnikov MergeDate: Wed Apr 15 11:47:59 2026 (Merged from https://github.com/openssl/openssl/pull/29773) --- diff --git a/doc/man3/BN_add.pod b/doc/man3/BN_add.pod index 46966d99637..edbc48c50f9 100644 --- a/doc/man3/BN_add.pod +++ b/doc/man3/BN_add.pod @@ -108,8 +108,10 @@ BN_gcd() computes the greatest common divisor of I and I and places the result in I. I may be the same B as I or I. -For all functions, I is a previously allocated B used for -temporary variables; see L. +For all functions that take a I parameter, it must be a previously +allocated B used for temporary variables; see L. +Unless stated otherwise in the documentation for a specific function, +the I parameter must not be NULL. Unless noted otherwise, the result B must be different from the arguments.