diff options
author | Richard Levitte <levitte@openssl.org> | 2021-01-28 08:56:53 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-03-19 16:46:39 +0100 |
commit | 06f6761280285401f3aaa31502614f7c8dd0c4fb (patch) | |
tree | 17234683f7434002c0b9295729b608490845b46f /include | |
parent | 65ef000ec26e6ec2fab2c31f74be1b76275bbbe5 (diff) |
PROV: Add type specific SubjectPublicKeyInfo decoding to the DER->key decoders
This makes it possible to use d2i_<TYPE>_PUBKEY instead of the generic
d2i_PUBKEY()
This required adding a number of new d2i_<TYPE>_PUBKEY functions.
These are all kept internal.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14314)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/x509.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/crypto/x509.h b/include/crypto/x509.h index 623b880959..e0997a4712 100644 --- a/include/crypto/x509.h +++ b/include/crypto/x509.h @@ -14,6 +14,7 @@ # include "internal/refcount.h" # include <openssl/asn1.h> # include <openssl/x509.h> +# include "crypto/ecx.h" /* Internal X509 structures and functions: not for application use */ @@ -328,4 +329,27 @@ ASN1_OCTET_STRING *ossl_x509_pubkey_hash(X509_PUBKEY *pubkey); /* A variant of d2i_PUBKEY() that is guaranteed to only return legacy keys */ EVP_PKEY *ossl_d2i_PUBKEY_legacy(EVP_PKEY **a, const unsigned char **in, long length); + +RSA *ossl_d2i_RSA_PSS_PUBKEY(RSA **a, const unsigned char **pp, long length); +int ossl_i2d_RSA_PSS_PUBKEY(const RSA *a, unsigned char **pp); +# ifndef OPENSSL_NO_DH +DH *ossl_d2i_DH_PUBKEY(DH **a, const unsigned char **pp, long length); +int ossl_i2d_DH_PUBKEY(const DH *a, unsigned char **pp); +DH *ossl_d2i_DHx_PUBKEY(DH **a, const unsigned char **pp, long length); +int ossl_i2d_DHx_PUBKEY(const DH *a, unsigned char **pp); +# endif +# ifndef OPENSSL_NO_EC +ECX_KEY *ossl_d2i_ED25519_PUBKEY(ECX_KEY **a, + const unsigned char **pp, long length); +int ossl_i2d_ED25519_PUBKEY(const ECX_KEY *a, unsigned char **pp); +ECX_KEY *ossl_d2i_ED448_PUBKEY(ECX_KEY **a, + const unsigned char **pp, long length); +int ossl_i2d_ED448_PUBKEY(const ECX_KEY *a, unsigned char **pp); +ECX_KEY *ossl_d2i_X25519_PUBKEY(ECX_KEY **a, + const unsigned char **pp, long length); +int ossl_i2d_X25519_PUBKEY(const ECX_KEY *a, unsigned char **pp); +ECX_KEY *ossl_d2i_X448_PUBKEY(ECX_KEY **a, + const unsigned char **pp, long length); +int ossl_i2d_X448_PUBKEY(const ECX_KEY *a, unsigned char **pp); +# endif #endif |