diff options
Diffstat (limited to 'src/lib/libcrypto/man')
| -rw-r--r-- | src/lib/libcrypto/man/DH_get0_pqg.3 | 68 |
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 |
| 74 | A | 89 | A |
| 75 | .Vt DH | 90 | .Vt DH |
| @@ -101,6 +116,21 @@ Otherwise, they are set to pointers to the internal representations | |||
| 101 | of the values that should not be freed by the application. | 116 | of the values that should not be freed by the application. |
| 102 | .Pp | 117 | .Pp |
| 103 | The | 118 | The |
| 119 | .Fa p , | ||
| 120 | .Fa q , | ||
| 121 | and | ||
| 122 | .Fa g | ||
| 123 | values can be set by calling | ||
| 124 | .Fn DH_set0_pqg . | ||
| 125 | Calling this function transfers the memory management of the values to | ||
| 126 | .Fa dh , | ||
| 127 | and therefore they should not be freed by the caller. | ||
| 128 | The | ||
| 129 | .Fa q | ||
| 130 | argument may be | ||
| 131 | .Dv NULL . | ||
| 132 | .Pp | ||
| 133 | The | ||
| 104 | .Fn DH_get0_key | 134 | .Fn DH_get0_key |
| 105 | function stores pointers to the internal representations | 135 | function stores pointers to the internal representations |
| 106 | of the public key in | 136 | of the public key in |
| @@ -111,6 +141,36 @@ Either may be | |||
| 111 | .Dv NULL | 141 | .Dv NULL |
| 112 | if it has not yet been set. | 142 | if it has not yet been set. |
| 113 | If the private key has been set, then the public key must be. | 143 | If the private key has been set, then the public key must be. |
| 144 | .Pp | ||
| 145 | The public and private key values can be set using | ||
| 146 | .Fn DH_set0_key . | ||
| 147 | Either parameter may be | ||
| 148 | .Dv NULL , | ||
| 149 | which means the corresponding | ||
| 150 | .Vt DH | ||
| 151 | field is left untouched. | ||
| 152 | This function transfers the memory management of the key values to | ||
| 153 | .Fa dh , | ||
| 154 | and therefore they should not be freed by the caller. | ||
| 155 | .Pp | ||
| 156 | Values retrieved with | ||
| 157 | .Fn DH_get0_pqg | ||
| 158 | and | ||
| 159 | .Fn DH_get0_key | ||
| 160 | are owned by the | ||
| 161 | .Vt DH | ||
| 162 | object and may therefore not be passed to | ||
| 163 | .Fn DH_set0_pqg | ||
| 164 | or | ||
| 165 | .Fn DH_set0_key . | ||
| 166 | If needed, duplicate the received values using | ||
| 167 | .Xr BN_dup 3 | ||
| 168 | and pass the duplicates. | ||
| 169 | .Sh RETURN VALUES | ||
| 170 | .Fn DH_set0_pqg | ||
| 171 | and | ||
| 172 | .Fn DH_set0_key | ||
| 173 | return 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 , |
