summaryrefslogtreecommitdiff
path: root/lib/libcrypto/rsa/rsa_pmeth.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2019-10-29 08:52:03 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2019-10-29 08:52:03 +0000
commit65bfdcbeba4d7a2a95280452be232ef28bafa428 (patch)
treeef79aece6fda8daa039679938d1ec1c2350ae068 /lib/libcrypto/rsa/rsa_pmeth.c
parentf577cf018951129cecd6a679eb874a24f39d9c30 (diff)
Add two controls that were missed in the previous commit.
Diffstat (limited to 'lib/libcrypto/rsa/rsa_pmeth.c')
-rw-r--r--lib/libcrypto/rsa/rsa_pmeth.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/libcrypto/rsa/rsa_pmeth.c b/lib/libcrypto/rsa/rsa_pmeth.c
index a5dd86a5de6..78f6532a5f3 100644
--- a/lib/libcrypto/rsa/rsa_pmeth.c
+++ b/lib/libcrypto/rsa/rsa_pmeth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_pmeth.c,v 1.23 2019/10/29 08:00:18 jsing Exp $ */
+/* $OpenBSD: rsa_pmeth.c,v 1.24 2019/10/29 08:52:02 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
@@ -451,6 +451,18 @@ bad_pad:
rctx->pub_exp = p2;
return 1;
+ case EVP_PKEY_CTRL_RSA_OAEP_MD:
+ case EVP_PKEY_CTRL_GET_RSA_OAEP_MD:
+ if (rctx->pad_mode != RSA_PKCS1_OAEP_PADDING) {
+ RSAerror(RSA_R_INVALID_PADDING_MODE);
+ return -2;
+ }
+ if (type == EVP_PKEY_CTRL_GET_RSA_OAEP_MD)
+ *(const EVP_MD **)p2 = rctx->md;
+ else
+ rctx->md = p2;
+ return 1;
+
case EVP_PKEY_CTRL_MD:
if (!check_padding_md(p2, rctx->pad_mode))
return 0;