From: Dr. Stephen Henson Date: Thu, 24 Nov 2016 21:42:49 +0000 (+0000) Subject: PSS ASN.1 method X-Git-Tag: OpenSSL_1_1_1-pre1~2783 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4e8ba7479df8c5fb23f59742f434ae0e78d1a42f;p=oweals%2Fopenssl.git PSS ASN.1 method Reviewed-by: Rich Salz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/2177) --- diff --git a/crypto/asn1/standard_methods.h b/crypto/asn1/standard_methods.h index 5b8f9dd447..51b0e81f68 100644 --- a/crypto/asn1/standard_methods.h +++ b/crypto/asn1/standard_methods.h @@ -30,6 +30,9 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = { #ifndef OPENSSL_NO_CMAC &cmac_asn1_meth, #endif +#ifndef OPENSSL_NO_RSA + &rsa_pss_asn1_meth, +#endif #ifndef OPENSSL_NO_DH &dhx_asn1_meth, #endif diff --git a/crypto/include/internal/asn1_int.h b/crypto/include/internal/asn1_int.h index f70e3b47ba..a5fdc0eb1d 100644 --- a/crypto/include/internal/asn1_int.h +++ b/crypto/include/internal/asn1_int.h @@ -64,6 +64,7 @@ extern const EVP_PKEY_ASN1_METHOD eckey_asn1_meth; extern const EVP_PKEY_ASN1_METHOD ecx25519_asn1_meth; extern const EVP_PKEY_ASN1_METHOD hmac_asn1_meth; extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[2]; +extern const EVP_PKEY_ASN1_METHOD rsa_pss_asn1_meth; /* * These are used internally in the ASN1_OBJECT to keep track of whether the diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c index 7259bc92bc..733a6bf86c 100644 --- a/crypto/rsa/rsa_ameth.c +++ b/crypto/rsa/rsa_ameth.c @@ -836,3 +836,34 @@ const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[2] = { EVP_PKEY_RSA, ASN1_PKEY_ALIAS} }; + +const EVP_PKEY_ASN1_METHOD rsa_pss_asn1_meth = { + EVP_PKEY_RSA_PSS, + EVP_PKEY_RSA_PSS, + ASN1_PKEY_SIGPARAM_NULL, + + "RSA-PSS", + "OpenSSL RSA-PSS method", + + rsa_pub_decode, + rsa_pub_encode, + rsa_pub_cmp, + rsa_pub_print, + + rsa_priv_decode, + rsa_priv_encode, + rsa_priv_print, + + int_rsa_size, + rsa_bits, + rsa_security_bits, + + 0, 0, 0, 0, 0, 0, + + rsa_sig_print, + int_rsa_free, + rsa_pkey_ctrl, + 0, 0, + rsa_item_verify, + rsa_item_sign, +};