summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/DH_get0_pqg.368
1 files changed, 64 insertions, 4 deletions
diff --git a/src/lib/libcrypto/man/DH_get0_pqg.3 b/src/lib/libcrypto/man/DH_get0_pqg.3
index 3d8087dcfc..7fcad59fbb 100644
--- a/src/lib/libcrypto/man/DH_get0_pqg.3
+++ b/src/lib/libcrypto/man/DH_get0_pqg.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: DH_get0_pqg.3,v 1.1 2018/02/17 16:59:48 schwarze Exp $ 1.\" $OpenBSD: DH_get0_pqg.3,v 1.2 2018/02/19 11:55:49 schwarze Exp $
2.\" selective merge up to: OpenSSL 7966101e Sep 18 11:58:24 2017 -0400 2.\" selective merge up to: OpenSSL 7966101e Sep 18 11:58:24 2017 -0400
3.\" 3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>. 4.\" This file was written by Matt Caswell <matt@openssl.org>.
@@ -48,13 +48,15 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: February 17 2018 $ 51.Dd $Mdocdate: February 19 2018 $
52.Dt DH_GET0_PQG 3 52.Dt DH_GET0_PQG 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
55.Nm DH_get0_pqg , 55.Nm DH_get0_pqg ,
56.Nm DH_get0_key 56.Nm DH_set0_pqg ,
57.Nd get data from a DH object 57.Nm DH_get0_key ,
58.Nm DH_set0_key
59.Nd get data from and set data in a DH object
58.Sh SYNOPSIS 60.Sh SYNOPSIS
59.In openssl/dh.h 61.In openssl/dh.h
60.Ft void 62.Ft void
@@ -64,12 +66,25 @@
64.Fa "const BIGNUM **q" 66.Fa "const BIGNUM **q"
65.Fa "const BIGNUM **g" 67.Fa "const BIGNUM **g"
66.Fc 68.Fc
69.Ft int
70.Fo DH_set0_pqg
71.Fa "DH *dh"
72.Fa "BIGNUM *p"
73.Fa "BIGNUM *q"
74.Fa "BIGNUM *g"
75.Fc
67.Ft void 76.Ft void
68.Fo DH_get0_key 77.Fo DH_get0_key
69.Fa "const DH *dh" 78.Fa "const DH *dh"
70.Fa "const BIGNUM **pub_key" 79.Fa "const BIGNUM **pub_key"
71.Fa "const BIGNUM **priv_key" 80.Fa "const BIGNUM **priv_key"
72.Fc 81.Fc
82.Ft int
83.Fo DH_set0_key
84.Fa "DH *dh"
85.Fa "BIGNUM *pub_key"
86.Fa "BIGNUM *priv_key"
87.Fc
73.Sh DESCRIPTION 88.Sh DESCRIPTION
74A 89A
75.Vt DH 90.Vt DH
@@ -101,6 +116,21 @@ Otherwise, they are set to pointers to the internal representations
101of the values that should not be freed by the application. 116of the values that should not be freed by the application.
102.Pp 117.Pp
103The 118The
119.Fa p ,
120.Fa q ,
121and
122.Fa g
123values can be set by calling
124.Fn DH_set0_pqg .
125Calling this function transfers the memory management of the values to
126.Fa dh ,
127and therefore they should not be freed by the caller.
128The
129.Fa q
130argument may be
131.Dv NULL .
132.Pp
133The
104.Fn DH_get0_key 134.Fn DH_get0_key
105function stores pointers to the internal representations 135function stores pointers to the internal representations
106of the public key in 136of the public key in
@@ -111,6 +141,36 @@ Either may be
111.Dv NULL 141.Dv NULL
112if it has not yet been set. 142if it has not yet been set.
113If the private key has been set, then the public key must be. 143If the private key has been set, then the public key must be.
144.Pp
145The public and private key values can be set using
146.Fn DH_set0_key .
147Either parameter may be
148.Dv NULL ,
149which means the corresponding
150.Vt DH
151field is left untouched.
152This function transfers the memory management of the key values to
153.Fa dh ,
154and therefore they should not be freed by the caller.
155.Pp
156Values retrieved with
157.Fn DH_get0_pqg
158and
159.Fn DH_get0_key
160are owned by the
161.Vt DH
162object and may therefore not be passed to
163.Fn DH_set0_pqg
164or
165.Fn DH_set0_key .
166If needed, duplicate the received values using
167.Xr BN_dup 3
168and pass the duplicates.
169.Sh RETURN VALUES
170.Fn DH_set0_pqg
171and
172.Fn DH_set0_key
173return 1 on success or 0 on failure.
114.Sh SEE ALSO 174.Sh SEE ALSO
115.Xr DH_generate_key 3 , 175.Xr DH_generate_key 3 ,
116.Xr DH_generate_parameters 3 , 176.Xr DH_generate_parameters 3 ,