-.\" $OpenBSD: EVP_PKCS82PKEY.3,v 1.1 2021/10/25 13:48:12 schwarze Exp $
+.\" $OpenBSD: EVP_PKCS82PKEY.3,v 1.2 2023/12/21 21:32:01 tb Exp $
.\"
.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 25 2021 $
+.Dd $Mdocdate: December 21 2023 $
.Dt EVP_PKCS82PKEY 3
.Os
.Sh NAME
.Fa pkey .
.Pp
Supported algorithms include DH, DSA, EC, GOST2001, and RSA.
-Application programs can add additional algorithms using
-.Xr EVP_PKEY_asn1_add0 3 .
.Sh RETURN VALUES
These functions return a newly allocated object or
.Dv NULL
.Fa pkey
is unsupported or if memory allocation, decoding, or encoding fails.
.Sh SEE ALSO
-.Xr EVP_PKEY_asn1_add0 3 ,
.Xr EVP_PKEY_base_id 3 ,
.Xr EVP_PKEY_new 3 ,
.Xr PKCS8_pkey_set0 3 ,
-.\" $OpenBSD: EVP_PKEY_asn1_get_count.3,v 1.7 2023/09/13 13:55:50 schwarze Exp $
+.\" $OpenBSD: EVP_PKEY_asn1_get_count.3,v 1.8 2023/12/21 21:32:01 tb Exp $
.\" full merge up to: OpenSSL 72a7a702 Feb 26 14:05:09 2019 +0000
.\"
.\" This file is a derived work.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: September 13 2023 $
+.Dd $Mdocdate: December 21 2023 $
.Dt EVP_PKEY_ASN1_GET_COUNT 3
.Os
.Sh NAME
.Sh DESCRIPTION
.Fn EVP_PKEY_asn1_get_count
returns the number of public key ASN.1 methods available.
-It includes standard methods and any methods added by the application.
.Pp
.Fn EVP_PKEY_asn1_get0
returns the public key ASN.1 method
.Fn EVP_PKEY_asn1_find
or
.Fn EVP_PKEY_asn1_find_str .
-It is either an alias built into the library, or it was created with
-.Xr EVP_PKEY_asn1_add_alias 3 .
.It Dv ASN1_PKEY_DYNAMIC
This
.Fa ameth
In particular, this is used for
.Dv EVP_PKEY_RSA .
.El
-.Pp
-.Fn EVP_PKEY_asn1_get_count ,
-.Fn EVP_PKEY_asn1_get0 ,
-.Fn EVP_PKEY_asn1_find
-and
-.Fn EVP_PKEY_asn1_find_str
-are not thread safe, but as long as all
-.Vt EVP_PKEY_ASN1_METHOD
-objects are added before the application gets threaded, using them is
-safe.
-See
-.Xr EVP_PKEY_asn1_add0 3 .
.Sh RETURN VALUES
.Fn EVP_PKEY_asn1_get_count
returns the number of available public key methods.
-.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.10 2023/09/13 14:18:21 schwarze Exp $
+.\" $OpenBSD: EVP_PKEY_asn1_new.3,v 1.11 2023/12/21 21:32:01 tb Exp $
.\" selective merge up to:
.\" OpenSSL man3/EVP_PKEY_ASN1_METHOD b0004708 Nov 1 00:45:24 2017 +0800
.\"
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: September 13 2023 $
+.Dd $Mdocdate: December 21 2023 $
.Dt EVP_PKEY_ASN1_NEW 3
.Os
.Sh NAME
+.\" .Nm EVP_PKEY_asn1_add0 and
+.\" .Nm EVP_PKEY_asn1_add_alias are intentionally undocumented
+.\" because they will be removed in the next major bump
.Nm EVP_PKEY_asn1_new ,
.Nm EVP_PKEY_asn1_copy ,
.Nm EVP_PKEY_asn1_free ,
-.Nm EVP_PKEY_asn1_add0 ,
-.Nm EVP_PKEY_asn1_add_alias ,
.Nm EVP_PKEY_asn1_set_public ,
.Nm EVP_PKEY_asn1_set_private ,
.Nm EVP_PKEY_asn1_set_param ,
.Fo EVP_PKEY_asn1_free
.Fa "EVP_PKEY_ASN1_METHOD *ameth"
.Fc
-.Ft int
-.Fo EVP_PKEY_asn1_add0
-.Fa "const EVP_PKEY_ASN1_METHOD *ameth"
-.Fc
-.Ft int
-.Fo EVP_PKEY_asn1_add_alias
-.Fa "int to"
-.Fa "int from"
-.Fc
.Ft void
.Fo EVP_PKEY_asn1_set_public
.Fa "EVP_PKEY_ASN1_METHOD *ameth"
is a structure which holds a set of ASN.1 conversion, printing and
information methods for a specific public key algorithm.
.Pp
-There are two places where the
+The built-in
.Vt EVP_PKEY_ASN1_METHOD
-objects are stored: one is a built-in array representing the standard
-methods for different algorithms, and the other one is a stack of
-user-defined application-specific methods, which can be manipulated by
-using
-.Fn EVP_PKEY_asn1_add0 .
+objects are stored in a table containing the standard
+methods for different algorithms.
.Ss Methods
The methods are the underlying implementations of a particular public
key algorithm present by the
.Dv NULL
of not marked as dynamically allocated, no action occurs.
.Pp
-.Fn EVP_PKEY_asn1_add0
-adds
-.Fa ameth
-to the user defined stack of methods unless another
-.Vt EVP_PKEY_ASN1_METHOD
-with the same NID is already there.
-This function is not thread safe, it is recommended to only use this when
-initializing the application.
-.Pp
-.Fn EVP_PKEY_asn1_add_alias
-creates an alias with the NID
-.Fa to
-for the
-.Vt EVP_PKEY_ASN1_METHOD
-with NID
-.Fa from
-unless another
-.Vt EVP_PKEY_ASN1_METHOD
-with the same NID is already added.
-This function is not thread safe, it's recommended to only use this when
-initializing the application.
-.Pp
.Fn EVP_PKEY_asn1_set_public ,
.Fn EVP_PKEY_asn1_set_private ,
.Fn EVP_PKEY_asn1_set_param ,
object or
.Dv NULL
if memory allocation fails.
-.Pp
-.Fn EVP_PKEY_asn1_add0
-and
-.Fn EVP_PKEY_asn1_add_alias
-return 0 on error or 1 on success.
.Sh SEE ALSO
.Xr EVP_PKEY_asn1_get_count 3 ,
.Xr EVP_PKEY_new 3 ,
.Fn EVP_PKEY_asn1_new ,
.Fn EVP_PKEY_asn1_copy ,
.Fn EVP_PKEY_asn1_free ,
-.Fn EVP_PKEY_asn1_add0 ,
-.Fn EVP_PKEY_asn1_add_alias ,
.Fn EVP_PKEY_asn1_set_public ,
.Fn EVP_PKEY_asn1_set_private ,
.Fn EVP_PKEY_asn1_set_param ,
-.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.20 2023/08/27 13:08:15 schwarze Exp $
+.\" $OpenBSD: EVP_PKEY_set1_RSA.3,v 1.21 2023/12/21 21:32:01 tb Exp $
.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
.\"
.\" This file is a derived work.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 27 2023 $
+.Dd $Mdocdate: December 21 2023 $
.Dt EVP_PKEY_SET1_RSA 3
.Os
.Sh NAME
.It Dv EVP_PKEY_RSA_PSS Ta = Dv NID_rsassaPss Ta RSA-PSS
.El
.Pp
-Application programs can support additional key types by calling
-.Xr EVP_PKEY_asn1_add0 3 .
-.Pp
.Fn EVP_PKEY_id
returns the actual OID associated with
.Fa pkey .
.It Dv EVP_PKEY_RSA2 Ta = Dv NID_rsa Ta RSA
.El
.Pp
-Application programs can support additional alternative OIDs by calling
-.Xr EVP_PKEY_asn1_add_alias 3 .
-.Pp
Most applications wishing to know a key type will simply call
.Fn EVP_PKEY_base_id
and will not care about the actual type,