From 6f64bd5e2724761ca84c51945aaf9c5d67c58ac2 Mon Sep 17 00:00:00 2001 From: schwarze Date: Sat, 17 Feb 2018 16:59:48 +0000 Subject: [PATCH] Merge documentation for {DH,DSA}_get0_{key,pqg}(3), EVP_PKEY_get0_{DH,DSA,RSA}(3), and RSA_{g,s}et0_key(3) that tb@ just provided. --- lib/libcrypto/man/DH_generate_key.3 | 5 +- lib/libcrypto/man/DH_generate_parameters.3 | 5 +- lib/libcrypto/man/DH_get0_pqg.3 | 121 ++++++++++++++++ lib/libcrypto/man/DH_new.3 | 8 +- lib/libcrypto/man/DH_size.3 | 5 +- lib/libcrypto/man/DSA_do_sign.3 | 5 +- lib/libcrypto/man/DSA_dup_DH.3 | 5 +- lib/libcrypto/man/DSA_generate_key.3 | 5 +- lib/libcrypto/man/DSA_generate_parameters.3 | 5 +- lib/libcrypto/man/DSA_get0_pqg.3 | 124 ++++++++++++++++ lib/libcrypto/man/DSA_new.3 | 6 +- lib/libcrypto/man/DSA_sign.3 | 5 +- lib/libcrypto/man/DSA_size.3 | 5 +- lib/libcrypto/man/EC_KEY_new.3 | 7 +- lib/libcrypto/man/EVP_PKEY_set1_RSA.3 | 41 +++++- lib/libcrypto/man/Makefile | 5 +- lib/libcrypto/man/RSA_check_key.3 | 5 +- lib/libcrypto/man/RSA_generate_key.3 | 5 +- lib/libcrypto/man/RSA_get0_key.3 | 148 ++++++++++++++++++++ lib/libcrypto/man/RSA_new.3 | 5 +- lib/libcrypto/man/RSA_print.3 | 7 +- lib/libcrypto/man/RSA_size.3 | 5 +- 22 files changed, 489 insertions(+), 43 deletions(-) create mode 100644 lib/libcrypto/man/DH_get0_pqg.3 create mode 100644 lib/libcrypto/man/DSA_get0_pqg.3 create mode 100644 lib/libcrypto/man/RSA_get0_key.3 diff --git a/lib/libcrypto/man/DH_generate_key.3 b/lib/libcrypto/man/DH_generate_key.3 index 870cfdeff9f..832a70bcf2e 100644 --- a/lib/libcrypto/man/DH_generate_key.3 +++ b/lib/libcrypto/man/DH_generate_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DH_generate_key.3,v 1.6 2016/12/10 22:22:59 schwarze Exp $ +.\" $OpenBSD: DH_generate_key.3,v 1.7 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DH_GENERATE_KEY 3 .Os .Sh NAME @@ -110,6 +110,7 @@ returns the size of the shared secret on success, or -1 on error. The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO +.Xr DH_get0_key 3 , .Xr DH_new 3 , .Xr DH_size 3 , .Xr ERR_get_error 3 , diff --git a/lib/libcrypto/man/DH_generate_parameters.3 b/lib/libcrypto/man/DH_generate_parameters.3 index a13699d0720..0de2541ed74 100644 --- a/lib/libcrypto/man/DH_generate_parameters.3 +++ b/lib/libcrypto/man/DH_generate_parameters.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DH_generate_parameters.3,v 1.7 2017/06/10 13:10:52 schwarze Exp $ +.\" $OpenBSD: DH_generate_parameters.3,v 1.8 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: June 10 2017 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DH_GENERATE_PARAMETERS 3 .Os .Sh NAME @@ -146,6 +146,7 @@ if the parameter generation fails. The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO +.Xr DH_get0_pqg 3 , .Xr DH_new 3 , .Xr ERR_get_error 3 , .Xr RAND_bytes 3 diff --git a/lib/libcrypto/man/DH_get0_pqg.3 b/lib/libcrypto/man/DH_get0_pqg.3 new file mode 100644 index 00000000000..3d8087dcfcb --- /dev/null +++ b/lib/libcrypto/man/DH_get0_pqg.3 @@ -0,0 +1,121 @@ +.\" $OpenBSD: DH_get0_pqg.3,v 1.1 2018/02/17 16:59:48 schwarze Exp $ +.\" selective merge up to: OpenSSL 7966101e Sep 18 11:58:24 2017 -0400 +.\" +.\" This file was written by Matt Caswell . +.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" +.\" 3. All advertising materials mentioning features or use of this +.\" software must display the following acknowledgment: +.\" "This product includes software developed by the OpenSSL Project +.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +.\" +.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +.\" endorse or promote products derived from this software without +.\" prior written permission. For written permission, please contact +.\" openssl-core@openssl.org. +.\" +.\" 5. Products derived from this software may not be called "OpenSSL" +.\" nor may "OpenSSL" appear in their names without prior written +.\" permission of the OpenSSL Project. +.\" +.\" 6. Redistributions of any form whatsoever must retain the following +.\" acknowledgment: +.\" "This product includes software developed by the OpenSSL Project +.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +.\" OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd $Mdocdate: February 17 2018 $ +.Dt DH_GET0_PQG 3 +.Os +.Sh NAME +.Nm DH_get0_pqg , +.Nm DH_get0_key +.Nd get data from a DH object +.Sh SYNOPSIS +.In openssl/dh.h +.Ft void +.Fo DH_get0_pqg +.Fa "const DH *dh" +.Fa "const BIGNUM **p" +.Fa "const BIGNUM **q" +.Fa "const BIGNUM **g" +.Fc +.Ft void +.Fo DH_get0_key +.Fa "const DH *dh" +.Fa "const BIGNUM **pub_key" +.Fa "const BIGNUM **priv_key" +.Fc +.Sh DESCRIPTION +A +.Vt DH +object contains the parameters +.Fa p , +.Fa q , +and optionally +.Fa g . +It also contains a public key +.Fa pub_key +and an optional private key +.Fa priv_key . +.Pp +The +.Fa p , +.Fa q , +and +.Fa g +parameters can be obtained by calling +.Fn DH_get0_pqg . +If the parameters have not yet been set, then +.Pf * Fa p , +.Pf * Fa q , +and +.Pf * Fa g +are set to +.Dv NULL . +Otherwise, they are set to pointers to the internal representations +of the values that should not be freed by the application. +.Pp +The +.Fn DH_get0_key +function stores pointers to the internal representations +of the public key in +.Pf * Fa pub_key +and to the private key in +.Pf * Fa priv_key . +Either may be +.Dv NULL +if it has not yet been set. +If the private key has been set, then the public key must be. +.Sh SEE ALSO +.Xr DH_generate_key 3 , +.Xr DH_generate_parameters 3 , +.Xr DH_new 3 , +.Xr DH_size 3 , +.Xr DHparams_print 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0. diff --git a/lib/libcrypto/man/DH_new.3 b/lib/libcrypto/man/DH_new.3 index 28f1888c017..58cde654692 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.4 2016/12/10 22:30:54 schwarze Exp $ +.\" $OpenBSD: DH_new.3,v 1.5 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DH_NEW 3 .Os .Sh NAME @@ -94,12 +94,14 @@ Otherwise it returns a pointer to the newly allocated structure. .Xr d2i_DHparams 3 , .Xr DH_generate_key 3 , .Xr DH_generate_parameters 3 , +.Xr DH_get0_pqg 3 , .Xr DH_get_ex_new_index 3 , .Xr DH_set_method 3 , .Xr DH_size 3 , .Xr DHparams_print 3 , .Xr DSA_dup_DH 3 , -.Xr ERR_get_error 3 +.Xr ERR_get_error 3 , +.Xr EVP_PKEY_set1_DH 3 .Sh HISTORY .Fn DH_new and diff --git a/lib/libcrypto/man/DH_size.3 b/lib/libcrypto/man/DH_size.3 index ea590357340..e566e523576 100644 --- a/lib/libcrypto/man/DH_size.3 +++ b/lib/libcrypto/man/DH_size.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DH_size.3,v 1.4 2016/12/10 22:22:59 schwarze Exp $ +.\" $OpenBSD: DH_size.3,v 1.5 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL 4d524e10 Feb 24 11:55:57 2000 +0000 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DH_SIZE 3 .Os .Sh NAME @@ -76,6 +76,7 @@ The size in bytes. .Sh SEE ALSO .Xr BN_num_bytes 3 , .Xr DH_generate_key 3 , +.Xr DH_get0_key 3 , .Xr DH_new 3 .Sh HISTORY .Fn DH_size diff --git a/lib/libcrypto/man/DSA_do_sign.3 b/lib/libcrypto/man/DSA_do_sign.3 index c229c2b629f..9d0696e44b5 100644 --- a/lib/libcrypto/man/DSA_do_sign.3 +++ b/lib/libcrypto/man/DSA_do_sign.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_do_sign.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_do_sign.3,v 1.6 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DSA_DO_SIGN 3 .Os .Sh NAME @@ -106,6 +106,7 @@ and -1 on error. The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO +.Xr DSA_get0_key 3 , .Xr DSA_new 3 , .Xr DSA_SIG_new 3 , .Xr DSA_sign 3 , diff --git a/lib/libcrypto/man/DSA_dup_DH.3 b/lib/libcrypto/man/DSA_dup_DH.3 index a1a67640c59..e8bc872d555 100644 --- a/lib/libcrypto/man/DSA_dup_DH.3 +++ b/lib/libcrypto/man/DSA_dup_DH.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_dup_DH.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_dup_DH.3,v 1.6 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DSA_DUP_DH 3 .Os .Sh NAME @@ -82,6 +82,7 @@ The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr DH_new 3 , +.Xr DSA_get0_pqg 3 , .Xr DSA_new 3 , .Xr ERR_get_error 3 .Sh HISTORY diff --git a/lib/libcrypto/man/DSA_generate_key.3 b/lib/libcrypto/man/DSA_generate_key.3 index f9a1681cffb..39cff886468 100644 --- a/lib/libcrypto/man/DSA_generate_key.3 +++ b/lib/libcrypto/man/DSA_generate_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_generate_key.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_generate_key.3,v 1.6 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DSA_GENERATE_KEY 3 .Os .Sh NAME @@ -76,6 +76,7 @@ The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr DSA_generate_parameters 3 , +.Xr DSA_get0_key 3 , .Xr DSA_new 3 , .Xr ERR_get_error 3 , .Xr RAND_bytes 3 diff --git a/lib/libcrypto/man/DSA_generate_parameters.3 b/lib/libcrypto/man/DSA_generate_parameters.3 index e6e6d90dce7..46827cf687c 100644 --- a/lib/libcrypto/man/DSA_generate_parameters.3 +++ b/lib/libcrypto/man/DSA_generate_parameters.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_generate_parameters.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_generate_parameters.3,v 1.6 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL 9b86974e Aug 7 22:14:47 2015 -0400 .\" .\" This file was written by Ulf Moeller , @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DSA_GENERATE_PARAMETERS 3 .Os .Sh NAME @@ -198,6 +198,7 @@ The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr BN_generate_prime 3 , +.Xr DSA_get0_pqg 3 , .Xr DSA_new 3 , .Xr ERR_get_error 3 , .Xr RAND_bytes 3 diff --git a/lib/libcrypto/man/DSA_get0_pqg.3 b/lib/libcrypto/man/DSA_get0_pqg.3 new file mode 100644 index 00000000000..f3dbe0ce8db --- /dev/null +++ b/lib/libcrypto/man/DSA_get0_pqg.3 @@ -0,0 +1,124 @@ +.\" $OpenBSD: DSA_get0_pqg.3,v 1.1 2018/02/17 16:59:48 schwarze Exp $ +.\" selective merge up to: OpenSSL e90fc053 Jul 15 09:39:45 2017 -0400 +.\" +.\" This file was written by Matt Caswell . +.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" +.\" 3. All advertising materials mentioning features or use of this +.\" software must display the following acknowledgment: +.\" "This product includes software developed by the OpenSSL Project +.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +.\" +.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +.\" endorse or promote products derived from this software without +.\" prior written permission. For written permission, please contact +.\" openssl-core@openssl.org. +.\" +.\" 5. Products derived from this software may not be called "OpenSSL" +.\" nor may "OpenSSL" appear in their names without prior written +.\" permission of the OpenSSL Project. +.\" +.\" 6. Redistributions of any form whatsoever must retain the following +.\" acknowledgment: +.\" "This product includes software developed by the OpenSSL Project +.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +.\" OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd $Mdocdate: February 17 2018 $ +.Dt DSA_GET0_PQG 3 +.Os +.Sh NAME +.Nm DSA_get0_pqg , +.Nm DSA_get0_key +.Nd get data from a DSA object +.Sh SYNOPSIS +.In openssl/dsa.h +.Ft void +.Fo DSA_get0_pqg +.Fa "const DSA *d" +.Fa "const BIGNUM **p" +.Fa "const BIGNUM **q" +.Fa "const BIGNUM **g" +.Fc +.Ft void +.Fo DSA_get0_key +.Fa "const DSA *d" +.Fa "const BIGNUM **pub_key" +.Fa "const BIGNUM **priv_key" +.Fc +.Sh DESCRIPTION +A +.Vt DSA +object contains the parameters +.Fa p , +.Fa q , +and +.Fa g . +It also contains a public key +.Fa pub_key +and an optional private key +.Fa priv_key . +.Pp +The +.Fa p , +.Fa q , +and +.Fa g +parameters can be obtained by calling +.Fn DSA_get0_pqg . +If the parameters have not yet been set, then +.Pf * Fa p , +.Pf * Fa q , +and +.Pf * Fa g +are set to +.Dv NULL . +Otherwise, they are set to pointers to the internal representations +of the values that should not be freed by the application. +.Pp +The +.Fn DSA_get0_key +function stores pointers to the internal representations +of the public key in +.Pf * Fa pub_key +and to the private key in +.Pf * Fa priv_key . +Either may be +.Dv NULL +if it has not yet been set. +If the private key has been set, then the public key must be. +.Sh SEE ALSO +.Xr DSA_do_sign 3 , +.Xr DSA_dup_DH 3 , +.Xr DSA_generate_key 3 , +.Xr DSA_generate_parameters 3 , +.Xr DSA_new 3 , +.Xr DSA_print 3 , +.Xr DSA_sign 3 , +.Xr DSA_size 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0. diff --git a/lib/libcrypto/man/DSA_new.3 b/lib/libcrypto/man/DSA_new.3 index c7339ceff12..817671093cf 100644 --- a/lib/libcrypto/man/DSA_new.3 +++ b/lib/libcrypto/man/DSA_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_new.3,v 1.5 2016/12/11 09:57:57 jmc Exp $ +.\" $OpenBSD: DSA_new.3,v 1.6 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DSA_NEW 3 .Os .Sh NAME @@ -99,6 +99,7 @@ Otherwise it returns a pointer to the newly allocated structure. .Xr DSA_dup_DH 3 , .Xr DSA_generate_key 3 , .Xr DSA_generate_parameters 3 , +.Xr DSA_get0_pqg 3 , .Xr DSA_get_ex_new_index 3 , .Xr DSA_print 3 , .Xr DSA_set_method 3 , @@ -107,6 +108,7 @@ Otherwise it returns a pointer to the newly allocated structure. .Xr DSA_size 3 , .Xr engine 3 , .Xr ERR_get_error 3 , +.Xr EVP_PKEY_set1_DSA 3 , .Xr RSA_new 3 .Sh STANDARDS US Federal Information Processing Standard FIPS 186 (Digital Signature diff --git a/lib/libcrypto/man/DSA_sign.3 b/lib/libcrypto/man/DSA_sign.3 index 8c851276817..1b3750bc6c0 100644 --- a/lib/libcrypto/man/DSA_sign.3 +++ b/lib/libcrypto/man/DSA_sign.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_sign.3,v 1.5 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_sign.3,v 1.6 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DSA_SIGN 3 .Os .Sh NAME @@ -157,6 +157,7 @@ The error codes can be obtained by .Xr ERR_get_error 3 . .Sh SEE ALSO .Xr DSA_do_sign 3 , +.Xr DSA_get0_key 3 , .Xr DSA_new 3 , .Xr ERR_get_error 3 , .Xr RAND_bytes 3 diff --git a/lib/libcrypto/man/DSA_size.3 b/lib/libcrypto/man/DSA_size.3 index 373b142c79f..4ed0d68b024 100644 --- a/lib/libcrypto/man/DSA_size.3 +++ b/lib/libcrypto/man/DSA_size.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: DSA_size.3,v 1.4 2016/12/10 22:47:49 schwarze Exp $ +.\" $OpenBSD: DSA_size.3,v 1.5 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 10 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt DSA_SIZE 3 .Os .Sh NAME @@ -72,6 +72,7 @@ must not be .Sh RETURN VALUES The size in bytes. .Sh SEE ALSO +.Xr DSA_get0_pqg 3 , .Xr DSA_new 3 , .Xr DSA_sign 3 .Sh HISTORY diff --git a/lib/libcrypto/man/EC_KEY_new.3 b/lib/libcrypto/man/EC_KEY_new.3 index 742be773eef..7767fb55e9b 100644 --- a/lib/libcrypto/man/EC_KEY_new.3 +++ b/lib/libcrypto/man/EC_KEY_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EC_KEY_new.3,v 1.8 2016/12/11 14:22:43 schwarze Exp $ +.\" $OpenBSD: EC_KEY_new.3,v 1.9 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL d900a015 Oct 8 14:40:42 2015 +0200 .\" .\" This file was written by Matt Caswell . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt EC_KEY_NEW 3 .Os .Sh NAME @@ -524,4 +524,5 @@ returns the point_conversion_form for the .Xr EC_GROUP_new 3 , .Xr EC_POINT_add 3 , .Xr EC_POINT_new 3 , -.Xr ECDSA_SIG_new 3 +.Xr ECDSA_SIG_new 3 , +.Xr EVP_PKEY_set1_EC_KEY 3 diff --git a/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 b/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 index 851184ae3c0..e897dacf685 100644 --- a/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 +++ b/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 @@ -1,5 +1,6 @@ -.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.5 2016/12/11 12:21:48 schwarze Exp $ -.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.6 2018/02/17 16:59:48 schwarze Exp $ +.\" full merge up to: OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 +.\" selective merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Dr. Stephen Henson . .\" Copyright (c) 2002, 2014, 2016 The OpenSSL Project. All rights reserved. @@ -48,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt EVP_PKEY_SET1_RSA 3 .Os .Sh NAME @@ -60,6 +61,9 @@ .Nm EVP_PKEY_get1_DSA , .Nm EVP_PKEY_get1_DH , .Nm EVP_PKEY_get1_EC_KEY , +.Nm EVP_PKEY_get0_RSA , +.Nm EVP_PKEY_get0_DSA , +.Nm EVP_PKEY_get0_DH , .Nm EVP_PKEY_assign_RSA , .Nm EVP_PKEY_assign_DSA , .Nm EVP_PKEY_assign_DH , @@ -106,6 +110,18 @@ .Fo EVP_PKEY_get1_EC_KEY .Fa "EVP_PKEY *pkey" .Fc +.Ft RSA * +.Fo EVP_PKEY_get0_RSA +.Fa "EVP_PKEY *pkey" +.Fc +.Ft DSA * +.Fo EVP_PKEY_get0_DSA +.Fa "EVP_PKEY *pkey" +.Fc +.Ft DH * +.Fo EVP_PKEY_get0_DH +.Fa "EVP_PKEY *pkey" +.Fc .Ft int .Fo EVP_PKEY_assign_RSA .Fa "EVP_PKEY *pkey" @@ -155,11 +171,18 @@ to and .Fn EVP_PKEY_get1_EC_KEY return the key referenced in -.Fa pkey -or +.Fa pkey , +incrementing its reference count by 1, or .Dv NULL if the key is not of the correct type. .Pp +.Fn EVP_PKEY_get0_RSA , +.Fn EVP_PKEY_get0_DSA , +and +.Fn EVP_PKEY_get0_DH +are identical except that they do not increment the reference count. +Consequently, the returned key must not be freed by the caller. +.Pp .Fn EVP_PKEY_assign_RSA , .Fn EVP_PKEY_assign_DSA , .Fn EVP_PKEY_assign_DH , @@ -235,8 +258,11 @@ return 1 for success or 0 for failure. .Fn EVP_PKEY_get1_RSA , .Fn EVP_PKEY_get1_DSA , .Fn EVP_PKEY_get1_DH , +.Fn EVP_PKEY_get1_EC_KEY , +.Fn EVP_PKEY_get0_RSA , +.Fn EVP_PKEY_get0_DSA , and -.Fn EVP_PKEY_get1_EC_KEY +.Fn EVP_PKEY_get0_DH return the referenced key or .Dv NULL if an error occurred. @@ -258,5 +284,8 @@ return a key type or .Dv EVP_PKEY_NONE ) on error. .Sh SEE ALSO +.Xr DH_new 3 , +.Xr DSA_new 3 , +.Xr EC_KEY_new 3 , .Xr EVP_PKEY_new 3 , .Xr RSA_new 3 diff --git a/lib/libcrypto/man/Makefile b/lib/libcrypto/man/Makefile index 7043c8397bf..77a65196856 100644 --- a/lib/libcrypto/man/Makefile +++ b/lib/libcrypto/man/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.129 2018/02/15 14:52:16 schwarze Exp $ +# $OpenBSD: Makefile,v 1.130 2018/02/17 16:59:48 schwarze Exp $ .include @@ -71,6 +71,7 @@ MAN= \ DH_generate_key.3 \ DH_generate_parameters.3 \ DH_get_ex_new_index.3 \ + DH_get0_pqg.3 \ DH_new.3 \ DH_set_method.3 \ DH_size.3 \ @@ -81,6 +82,7 @@ MAN= \ DSA_generate_key.3 \ DSA_generate_parameters.3 \ DSA_get_ex_new_index.3 \ + DSA_get0_pqg.3 \ DSA_new.3 \ DSA_set_method.3 \ DSA_sign.3 \ @@ -185,6 +187,7 @@ MAN= \ RSA_check_key.3 \ RSA_generate_key.3 \ RSA_get_ex_new_index.3 \ + RSA_get0_key.3 \ RSA_new.3 \ RSA_padding_add_PKCS1_type_1.3 \ RSA_print.3 \ diff --git a/lib/libcrypto/man/RSA_check_key.3 b/lib/libcrypto/man/RSA_check_key.3 index cfce0bbbf8f..691ee7a6ebe 100644 --- a/lib/libcrypto/man/RSA_check_key.3 +++ b/lib/libcrypto/man/RSA_check_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_check_key.3,v 1.4 2016/12/11 12:21:48 schwarze Exp $ +.\" $OpenBSD: RSA_check_key.3,v 1.5 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000 .\" .\" This file was written by Ulf Moeller and @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt RSA_CHECK_KEY 3 .Os .Sh NAME @@ -126,6 +126,7 @@ obtained using .Sh SEE ALSO .Xr BN_is_prime_ex 3 , .Xr ERR_get_error 3 , +.Xr RSA_get0_key 3 , .Xr RSA_new 3 .Sh HISTORY .Fn RSA_check_key diff --git a/lib/libcrypto/man/RSA_generate_key.3 b/lib/libcrypto/man/RSA_generate_key.3 index 838b10e2a92..ac6e5693dcb 100644 --- a/lib/libcrypto/man/RSA_generate_key.3 +++ b/lib/libcrypto/man/RSA_generate_key.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_generate_key.3,v 1.6 2017/03/25 18:08:48 schwarze Exp $ +.\" $OpenBSD: RSA_generate_key.3,v 1.7 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL RSA_generate_key.pod bb6c5e7f Feb 5 10:29:22 2017 -0500 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 25 2017 $ +.Dd $Mdocdate: February 17 2018 $ .Dt RSA_GENERATE_KEY 3 .Os .Sh NAME @@ -143,6 +143,7 @@ The error codes can be obtained by .Sh SEE ALSO .Xr BN_generate_prime 3 , .Xr ERR_get_error 3 , +.Xr RSA_get0_key 3 , .Xr RSA_new 3 .Sh HISTORY The diff --git a/lib/libcrypto/man/RSA_get0_key.3 b/lib/libcrypto/man/RSA_get0_key.3 new file mode 100644 index 00000000000..213dba396d1 --- /dev/null +++ b/lib/libcrypto/man/RSA_get0_key.3 @@ -0,0 +1,148 @@ +.\" $OpenBSD: RSA_get0_key.3,v 1.1 2018/02/17 16:59:48 schwarze Exp $ +.\" selective merge up to: OpenSSL 665d899f Aug 2 02:19:43 2017 +0800 +.\" +.\" This file was written by Richard Levitte +.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" +.\" 3. All advertising materials mentioning features or use of this +.\" software must display the following acknowledgment: +.\" "This product includes software developed by the OpenSSL Project +.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +.\" +.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +.\" endorse or promote products derived from this software without +.\" prior written permission. For written permission, please contact +.\" openssl-core@openssl.org. +.\" +.\" 5. Products derived from this software may not be called "OpenSSL" +.\" nor may "OpenSSL" appear in their names without prior written +.\" permission of the OpenSSL Project. +.\" +.\" 6. Redistributions of any form whatsoever must retain the following +.\" acknowledgment: +.\" "This product includes software developed by the OpenSSL Project +.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +.\" OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd $Mdocdate: February 17 2018 $ +.Dt RSA_GET0_KEY 3 +.Os +.Sh NAME +.Nm RSA_get0_key , +.Nm RSA_set0_key +.Nd get and set data in an RSA object +.Sh SYNOPSIS +.In openssl/rsa.h +.Ft void +.Fo RSA_get0_key +.Fa "const RSA *r" +.Fa "const BIGNUM **n" +.Fa "const BIGNUM **e" +.Fa "const BIGNUM **d" +.Fc +.Ft int +.Fo RSA_set0_key +.Fa "RSA *r" +.Fa "BIGNUM *n" +.Fa "BIGNUM *e" +.Fa "BIGNUM *d" +.Fc +.Sh DESCRIPTION +An +.Vt RSA +object contains the components for the public and private key. +.Fa n +is the modulus common to both public and private key, +.Fa e +is the public exponent and +.Fa d +is the private exponent. +These parameters can be obtained by calling +.Fn RSA_get0_key . +If they have not been set yet, then +.Pf * Fa n , +.Pf * Fa e , +and +.Pf * Fa d +will be set to +.Dv NULL . +Otherwise, they are set to pointers to the internal representations +of the values that should not be freed by the caller. +If any of the arguments is +.Dv NULL , +the respective parameter is not retrieved. +.Pp +The +.Fa n , +.Fa e , +and +.Fa d +parameter values can be set by calling +.Fn RSA_set0_key . +The values +.Fa n +and +.Fa e +must be +.Pf non- Dv NULL +the first time this function is called on a given +.Vt RSA +object. +The value +.Fa d +may be +.Dv NULL . +On subsequent calls, any of these values may be +.Dv NULL , +which means that the corresponding field is left untouched. +Calling this function transfers the memory management of the values to +the RSA object. +Therefore, the values that have been passed in +should not be freed by the caller. +.Pp +Values retrieved with +.Fn RSA_get0_key +are owned by the +.Vt RSA +object used in the call and may therefore +.Em not +be passed to +.Fn RSA_set0_key . +If needed, duplicate the received value using +.Xr BN_dup 3 +and pass the duplicate. +.Sh RETURN VALUES +.Fn RSA_set0_key +returns 1 on success or 0 on failure. +.Sh SEE ALSO +.Xr RSA_check_key 3 , +.Xr RSA_generate_key 3 , +.Xr RSA_new 3 , +.Xr RSA_print 3 , +.Xr RSA_size 3 +.Sh HISTORY +These functions first appeared in OpenSSL 1.1.0. diff --git a/lib/libcrypto/man/RSA_new.3 b/lib/libcrypto/man/RSA_new.3 index 9e43f03f1d0..820c472751c 100644 --- a/lib/libcrypto/man/RSA_new.3 +++ b/lib/libcrypto/man/RSA_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_new.3,v 1.4 2016/12/11 12:52:28 schwarze Exp $ +.\" $OpenBSD: RSA_new.3,v 1.5 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL doc/man3/RSA_new.pod 99d63d46 Oct 26 13:56:48 2016 -0400 .\" OpenSSL doc/crypto/rsa.pod 35d2e327 Jun 3 16:19:49 2016 -0400 .\" @@ -49,7 +49,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt RSA_NEW 3 .Os .Sh NAME @@ -160,6 +160,7 @@ Otherwise it returns a pointer to the newly allocated structure. .Xr RSA_blinding_on 3 , .Xr RSA_check_key 3 , .Xr RSA_generate_key 3 , +.Xr RSA_get0_key 3 , .Xr RSA_get_ex_new_index 3 , .Xr RSA_padding_add_PKCS1_type_1 3 , .Xr RSA_print 3 , diff --git a/lib/libcrypto/man/RSA_print.3 b/lib/libcrypto/man/RSA_print.3 index de53af64dcf..90c47a42fdc 100644 --- a/lib/libcrypto/man/RSA_print.3 +++ b/lib/libcrypto/man/RSA_print.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_print.3,v 1.5 2016/12/11 12:21:48 schwarze Exp $ +.\" $OpenBSD: RSA_print.3,v 1.6 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt RSA_PRINT 3 .Os .Sh NAME @@ -123,6 +123,9 @@ spaces. These functions return 1 on success or 0 on error. .Sh SEE ALSO .Xr BN_bn2bin 3 , +.Xr DH_get0_pqg 3 , +.Xr DSA_get0_pqg 3 , +.Xr RSA_get0_key 3 , .Xr RSA_new 3 .Sh HISTORY .Fn RSA_print , diff --git a/lib/libcrypto/man/RSA_size.3 b/lib/libcrypto/man/RSA_size.3 index fdd105158cb..ffed9a109e4 100644 --- a/lib/libcrypto/man/RSA_size.3 +++ b/lib/libcrypto/man/RSA_size.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: RSA_size.3,v 1.4 2016/12/11 12:21:48 schwarze Exp $ +.\" $OpenBSD: RSA_size.3,v 1.5 2018/02/17 16:59:48 schwarze Exp $ .\" OpenSSL 5bf73873 Aug 5 16:27:01 2002 +0000 .\" .\" This file was written by Ulf Moeller . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 11 2016 $ +.Dd $Mdocdate: February 17 2018 $ .Dt RSA_SIZE 3 .Os .Sh NAME @@ -73,6 +73,7 @@ must not be .Sh RETURN VALUES The size in bytes. .Sh SEE ALSO +.Xr RSA_get0_key 3 , .Xr RSA_new 3 .Sh HISTORY .Fn RSA_size -- 2.20.1