doc: note that the BN_new() initialises the BIGNUM
authorHubert Kario <hkario@redhat.com>
Fri, 29 Sep 2017 13:40:43 +0000 (15:40 +0200)
committerRich Salz <rsalz@openssl.org>
Fri, 29 Sep 2017 16:53:14 +0000 (12:53 -0400)
BN_new() and BN_secure_new() not only allocate memory, but also
initialise it to deterministic value - 0.

Document that behaviour to make it explicit

backport from #4438

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4443)

doc/crypto/BN_new.pod

index 413a1ea842a97b855d218aa2570b5bf0bb0224c7..d446603191af41d23f5f4650142c7cd1f24987f4 100644 (file)
@@ -34,7 +34,8 @@ If B<a> is NULL, nothing is done.
 
 =head1 RETURN VALUES
 
-BN_new() returns a pointer to the B<BIGNUM>. If the allocation fails,
+BN_new() returns a pointer to the B<BIGNUM> initialised to the value 0.
+If the allocation fails,
 it returns B<NULL> and sets an error code that can be obtained
 by L<ERR_get_error(3)|ERR_get_error(3)>.