summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/crypto/rsa/internal.h9
-rw-r--r--src/include/openssl/rsa.h29
2 files changed, 29 insertions, 9 deletions
diff --git a/src/crypto/rsa/internal.h b/src/crypto/rsa/internal.h
index aa3a982..3dd4f04 100644
--- a/src/crypto/rsa/internal.h
+++ b/src/crypto/rsa/internal.h
@@ -113,15 +113,6 @@ int RSA_padding_add_none(uint8_t *to, unsigned to_len, const uint8_t *from,
int RSA_padding_check_none(uint8_t *to, unsigned to_len, const uint8_t *from,
unsigned from_len);
-/* RSA_verify_PKCS1_PSS_mgf1 */
-int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash,
- const EVP_MD *Hash, const EVP_MD *mgf1Hash,
- const uint8_t *EM, int sLen);
-
-int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, uint8_t *EM, const uint8_t *mHash,
- const EVP_MD *Hash, const EVP_MD *mgf1Hash,
- int sLen);
-
/* RSA_private_transform calls either the method-specific |private_transform|
* function (if given) or the generic one. See the comment for
* |private_transform| in |rsa_meth_st|. */
diff --git a/src/include/openssl/rsa.h b/src/include/openssl/rsa.h
index ff2bd8b..5f39e0b 100644
--- a/src/include/openssl/rsa.h
+++ b/src/include/openssl/rsa.h
@@ -285,6 +285,35 @@ OPENSSL_EXPORT int RSA_check_key(const RSA *rsa);
* otherwise. */
OPENSSL_EXPORT int RSA_recover_crt_params(RSA *rsa);
+/* RSA_verify_PKCS1_PSS_mgf1 verifies that |EM| is a correct PSS padding of
+ * |mHash|, where |mHash| is a digest produced by |Hash|. The |mgf1Hash|
+ * argument specifies the hash function for generating the mask. If NULL,
+ * |Hash| is used. The |sLen| argument specifies the expected salt length in
+ * bytes. If |sLen| is -1 then the salt length is the same as the hash length.
+ * If -2, then the salt length is maximal and is taken from the size of |EM|.
+ *
+ * It returns one on success or zero on error. */
+OPENSSL_EXPORT int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash,
+ const EVP_MD *Hash,
+ const EVP_MD *mgf1Hash,
+ const uint8_t *EM, int sLen);
+
+/* RSA_padding_add_PKCS1_PSS_mgf1 writes a PSS padding of |mHash| to |EM|,
+ * where |mHash| is a digest produced by |Hash|. There must be at least
+ * |RSA_size(rsa)| bytes of space in |EM|. The |mgf1Hash| argument specifies
+ * the hash function for generating the mask. If NULL, |Hash| is used. The
+ * |sLen| argument specifies the expected salt length in bytes. If |sLen| is -1
+ * then the salt length is the same as the hash length. If -2, then the salt
+ * length is maximal given the space in |EM|.
+ *
+ * It returns one on success or zero on error. */
+OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, uint8_t *EM,
+ const uint8_t *mHash,
+ const EVP_MD *Hash,
+ const EVP_MD *mgf1Hash,
+ int sLen);
+
+
/* ASN.1 functions. */