PROV: Use rsa_padding_add_PKCS1_OAEP_mgf1_with_libctx() in RSA-OAEP
authorRichard Levitte <levitte@openssl.org>
Tue, 26 May 2020 08:05:01 +0000 (10:05 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 27 May 2020 10:42:20 +0000 (12:42 +0200)
Fixes #11904

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11959)

crypto/rsa/rsa_local.h
include/crypto/rsa.h
providers/implementations/asymciphers/rsa_enc.c

index f94fc79cdd344d1659d3e5aa2e51e14dd42f62bf..65fd6022f7258d95a6444296ad6f6dfdfc6a2643 100644 (file)
@@ -187,12 +187,5 @@ int rsa_padding_add_PKCS1_type_2_with_libctx(OPENSSL_CTX *libctx,
                                              unsigned char *to, int tlen,
                                              const unsigned char *from,
                                              int flen);
-int rsa_padding_add_PKCS1_OAEP_mgf1_with_libctx(OPENSSL_CTX *libctx,
-                                                unsigned char *to, int tlen,
-                                                const unsigned char *from,
-                                                int flen,
-                                                const unsigned char *param,
-                                                int plen, const EVP_MD *md,
-                                                const EVP_MD *mgf1md);
 
 #endif /* OSSL_CRYPTO_RSA_LOCAL_H */
index 6f32ec422f2531765249af906eec6c556e493578..5d7a6e515dac20b55a300c14267624a84c729326 100644 (file)
@@ -69,6 +69,13 @@ int rsa_padding_check_PKCS1_type_2_TLS(OPENSSL_CTX *ctx, unsigned char *to,
                                        size_t tlen, const unsigned char *from,
                                        size_t flen, int client_version,
                                        int alt_version);
+int rsa_padding_add_PKCS1_OAEP_mgf1_with_libctx(OPENSSL_CTX *libctx,
+                                                unsigned char *to, int tlen,
+                                                const unsigned char *from,
+                                                int flen,
+                                                const unsigned char *param,
+                                                int plen, const EVP_MD *md,
+                                                const EVP_MD *mgf1md);
 
 int rsa_validate_public(const RSA *key);
 int rsa_validate_private(const RSA *key);
index 1f9ded4a651bdd31b17e0ee5dfb938ed2c4bf046..db89de8a268a8f50c5bf888ee15fa5026c652c15 100644 (file)
@@ -138,11 +138,13 @@ static int rsa_encrypt(void *vprsactx, unsigned char *out, size_t *outlen,
             PROVerr(0, ERR_R_INTERNAL_ERROR);
             return 0;
         }
-        ret = RSA_padding_add_PKCS1_OAEP_mgf1(tbuf, rsasize, in, inlen,
-                                              prsactx->oaep_label,
-                                              prsactx->oaep_labellen,
-                                              prsactx->oaep_md,
-                                              prsactx->mgf1_md);
+        ret =
+            rsa_padding_add_PKCS1_OAEP_mgf1_with_libctx(prsactx->libctx, tbuf,
+                                                        rsasize, in, inlen,
+                                                        prsactx->oaep_label,
+                                                        prsactx->oaep_labellen,
+                                                        prsactx->oaep_md,
+                                                        prsactx->mgf1_md);
 
         if (!ret) {
             OPENSSL_free(tbuf);