From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 23 Oct 2019 12:54:32 -0700 Subject: fix: add RSA-PSS keygen functions This adds support for missing RSA_PSS key generation functions. Refs https://github.com/nodejs/node/pull/26960. Upstreamed at https://boringssl-review.googlesource.com/c/boringssl/+/38524. diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 19baa64ddba84c3dd59e65aef77d1ebbf49e43df..37217c49f7e05eb25562023bf356fdadae1bc66f 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -723,6 +723,18 @@ OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int padding); OPENSSL_EXPORT int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *out_padding); +// EVP_PKEY_CTX_set_rsa_pss_keygen_md() always returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen() always returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, + int salt_len); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md() always returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + // EVP_PKEY_CTX_set_rsa_pss_saltlen sets the length of the salt in a PSS-padded // signature. A value of -1 cause the salt to be the same length as the digest // in the signature. A value of -2 causes the salt to be the maximum length