-.\" $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 <ulf@openssl.org>.
.\" 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
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 ,
-.\" $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 <ulf@openssl.org>.
.\" 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
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
--- /dev/null
+.\" $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 <matt@openssl.org>.
+.\" 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.
-.\" $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 <ulf@openssl.org>.
.\" 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
.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
-.\" $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 <ulf@openssl.org>.
.\" 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
.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
-.\" $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 <ulf@openssl.org>.
.\" 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
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 ,
-.\" $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 <ulf@openssl.org>.
.\" 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
.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
-.\" $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 <ulf@openssl.org>.
.\" 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
.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
-.\" $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 <ulf@openssl.org>,
.\" 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
.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
--- /dev/null
+.\" $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 <matt@openssl.org>.
+.\" 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.
-.\" $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 <ulf@openssl.org>.
.\" 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
.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 ,
.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
-.\" $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 <ulf@openssl.org>.
.\" 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
.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
-.\" $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 <ulf@openssl.org>.
.\" 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
.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
-.\" $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 <matt@openssl.org>.
.\" 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
.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
-.\" $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 <steve@openssl.org>.
.\" Copyright (c) 2002, 2014, 2016 The OpenSSL Project. All rights reserved.
.\" 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
.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 ,
.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"
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 ,
.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.
.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
-# $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 <bsd.own.mk>
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 \
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 \
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 \
-.\" $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 <ulf@openssl.org> and
.\" 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
.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
-.\" $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 <ulf@openssl.org>.
.\" 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
.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
--- /dev/null
+.\" $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 <levitte@openssl.org>
+.\" 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.
-.\" $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
.\"
.\" 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
.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 ,
-.\" $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 <ulf@openssl.org>.
.\" 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
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 ,
-.\" $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 <ulf@openssl.org>.
.\" 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
.Sh RETURN VALUES
The size in bytes.
.Sh SEE ALSO
+.Xr RSA_get0_key 3 ,
.Xr RSA_new 3
.Sh HISTORY
.Fn RSA_size