summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2023-09-09 14:31:38 +0000
committerschwarze <>2023-09-09 14:31:38 +0000
commit235a01a03d29cd07cde581e34ae6ca4f4ad3eed8 (patch)
treea9dd521bd5ab0cce54c1bcd4dd9bbf1c906e6e6c
parent51b92f8d21cbaaec94c215308fccd3b3741f99fb (diff)
downloadopenbsd-235a01a03d29cd07cde581e34ae6ca4f4ad3eed8.tar.gz
openbsd-235a01a03d29cd07cde581e34ae6ca4f4ad3eed8.tar.bz2
openbsd-235a01a03d29cd07cde581e34ae6ca4f4ad3eed8.zip
Document EVP_PKEY_CTX_set0_keygen_info(3).
While here, also add the missing RETURN VALUES entries for EVP_PKEY_gen_cb(3), EVP_PKEY_CTX_get_cb(3), and EVP_PKEY_CTX_get_keygen_info(3).
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_keygen.369
1 files changed, 59 insertions, 10 deletions
diff --git a/src/lib/libcrypto/man/EVP_PKEY_keygen.3 b/src/lib/libcrypto/man/EVP_PKEY_keygen.3
index aae994541f..7641dba5a2 100644
--- a/src/lib/libcrypto/man/EVP_PKEY_keygen.3
+++ b/src/lib/libcrypto/man/EVP_PKEY_keygen.3
@@ -1,8 +1,24 @@
1.\" $OpenBSD: EVP_PKEY_keygen.3,v 1.11 2023/04/25 16:50:33 tb Exp $ 1.\" $OpenBSD: EVP_PKEY_keygen.3,v 1.12 2023/09/09 14:31:38 schwarze Exp $
2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 2.\" full merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
3.\" selective merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100
4.\" 3.\"
5.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
6.\" Copyright (c) 2006, 2009, 2013, 2015, 2016, 2018 The OpenSSL Project. 22.\" Copyright (c) 2006, 2009, 2013, 2015, 2016, 2018 The OpenSSL Project.
7.\" All rights reserved. 23.\" All rights reserved.
8.\" 24.\"
@@ -50,7 +66,7 @@
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\" 68.\"
53.Dd $Mdocdate: April 25 2023 $ 69.Dd $Mdocdate: September 9 2023 $
54.Dt EVP_PKEY_KEYGEN 3 70.Dt EVP_PKEY_KEYGEN 3
55.Os 71.Os
56.Sh NAME 72.Sh NAME
@@ -61,6 +77,7 @@
61.Nm EVP_PKEY_gen_cb , 77.Nm EVP_PKEY_gen_cb ,
62.Nm EVP_PKEY_CTX_set_cb , 78.Nm EVP_PKEY_CTX_set_cb ,
63.Nm EVP_PKEY_CTX_get_cb , 79.Nm EVP_PKEY_CTX_get_cb ,
80.Nm EVP_PKEY_CTX_set0_keygen_info ,
64.Nm EVP_PKEY_CTX_get_keygen_info , 81.Nm EVP_PKEY_CTX_get_keygen_info ,
65.Nm EVP_PKEY_CTX_set_app_data , 82.Nm EVP_PKEY_CTX_set_app_data ,
66.Nm EVP_PKEY_CTX_get_app_data 83.Nm EVP_PKEY_CTX_get_app_data
@@ -98,6 +115,12 @@
98.Fo EVP_PKEY_CTX_get_cb 115.Fo EVP_PKEY_CTX_get_cb
99.Fa "EVP_PKEY_CTX *ctx" 116.Fa "EVP_PKEY_CTX *ctx"
100.Fc 117.Fc
118.Ft void
119.Fo EVP_PKEY_CTX_set0_keygen_info
120.Fa "EVP_PKEY_CTX *ctx"
121.Fa "int *dat"
122.Fa "int datlen"
123.Fc
101.Ft int 124.Ft int
102.Fo EVP_PKEY_CTX_get_keygen_info 125.Fo EVP_PKEY_CTX_get_keygen_info
103.Fa "EVP_PKEY_CTX *ctx" 126.Fa "EVP_PKEY_CTX *ctx"
@@ -131,13 +154,22 @@ and
131.Fn EVP_PKEY_paramgen 154.Fn EVP_PKEY_paramgen
132are similar except parameters are generated. 155are similar except parameters are generated.
133.Pp 156.Pp
134The function 157The functions
135.Fn EVP_PKEY_CTX_set_cb 158.Fn EVP_PKEY_CTX_set_cb
136sets the key or parameter generation callback to 159and
137.Fa cb .
138The function
139.Fn EVP_PKEY_CTX_get_cb 160.Fn EVP_PKEY_CTX_get_cb
140returns the key or parameter generation callback. 161set and retrieve the key or parameter generation callback, respectively.
162.Pp
163The function
164.Fn EVP_PKEY_CTX_set0_keygen_info
165sets the parameters associated with the generation operation to the array
166.Fa dat
167containing
168.Ft datlen
169integer parameters.
170The caller retains ownership of the
171.Fa dat
172array; it will never be freed by the library.
141.Pp 173.Pp
142The function 174The function
143.Fn EVP_PKEY_CTX_get_keygen_info 175.Fn EVP_PKEY_CTX_get_keygen_info
@@ -209,6 +241,23 @@ and
209return 1 for success and 0 or a negative value for failure. 241return 1 for success and 0 or a negative value for failure.
210In particular, a return value of -2 indicates the operation is not 242In particular, a return value of -2 indicates the operation is not
211supported by the public key algorithm. 243supported by the public key algorithm.
244.Pp
245Callback functions of the type
246.Fn EVP_PKEY_gen_cb
247are supposed to return 1 on success or 0 on error.
248.Pp
249.Fn EVP_PKEY_CTX_get_cb
250returns a function pointer to the currently installed callback function or
251.Dv NULL
252if no callback function is installed.
253.Pp
254.Fn EVP_PKEY_CTX_get_keygen_info
255retuns the number of available parameters if
256.Fa idx
257is \-1, one of these parameters if
258.Fa idx
259is greater than or equal to zero but less than the number
260of available parameters, or 0 otherwise.
212.Sh EXAMPLES 261.Sh EXAMPLES
213Generate a 2048-bit RSA key: 262Generate a 2048-bit RSA key:
214.Bd -literal -offset indent 263.Bd -literal -offset indent