diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-04-18 01:11:46 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-04-18 01:11:46 +0000 |
commit | b3a7116be570add37aeac9848253ac835268d744 (patch) | |
tree | c7f2bd34ccd22458974dd490df4121c1ddc2cf17 /lib/libcrypto/man/DH_new.3 | |
parent | 439bd1c02713cebb06199845e207af492fa17ae1 (diff) |
* Document DH_up_ref(3), DSA_up_ref(3), and RSA_up_ref(3).
* Correct documentation of DH_new(3), DH_free(3), DSA_new(3), DSA_free(3),
RSA_new(3), and RSA_free(3) with respect to reference counting.
* Stop referencing engine(3).
Diffstat (limited to 'lib/libcrypto/man/DH_new.3')
-rw-r--r-- | lib/libcrypto/man/DH_new.3 | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/lib/libcrypto/man/DH_new.3 b/lib/libcrypto/man/DH_new.3 index bd3b3105611..3208e767013 100644 --- a/lib/libcrypto/man/DH_new.3 +++ b/lib/libcrypto/man/DH_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DH_new.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ +.\" $OpenBSD: DH_new.3,v 1.8 2018/04/18 01:11:45 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller <ulf@openssl.org>. @@ -48,17 +48,22 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 27 2018 $ +.Dd $Mdocdate: April 18 2018 $ .Dt DH_NEW 3 .Os .Sh NAME .Nm DH_new , +.Nm DH_up_ref , .Nm DH_free .Nd allocate and free DH objects .Sh SYNOPSIS .In openssl/dh.h .Ft DH* .Fn DH_new void +.Ft int +.Fo DH_up_ref +.Fa "DH *dh" +.Fc .Ft void .Fo DH_free .Fa "DH *dh" @@ -69,10 +74,19 @@ The DH functions implement the Diffie-Hellman key agreement protocol. .Fn DH_new allocates and initializes a .Vt DH -structure. +structure, setting the reference count to 1. +It is equivalent to +.Xr DH_new_method 3 +with a +.Dv NULL +argument. +.Pp +.Fn DH_up_ref +increments the reference count by 1. .Pp .Fn DH_free -frees the +decrements the reference count by 1. +If it reaches 0, it frees the .Vt DH structure and its components. The values are erased before the memory is returned to the system. @@ -89,6 +103,9 @@ returns and sets an error code that can be obtained by .Xr ERR_get_error 3 . Otherwise it returns a pointer to the newly allocated structure. +.Pp +.Fn DH_up_ref +returns 1 for success or 0 for failure. .Sh SEE ALSO .Xr BN_new 3 , .Xr d2i_DHparams 3 , @@ -108,3 +125,7 @@ and .Fn DH_free first appeared in SSLeay 0.5.1 and have been available since .Ox 2.4 . +.Pp +.Fn DH_up_ref +first appeared in OpenSSL 0.9.7 and has been available since +.Ox 3.2 . |