summaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rsa/rsa_lib.c')
-rw-r--r--crypto/rsa/rsa_lib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c
index 8f934d8abc..0fbda9a9b1 100644
--- a/crypto/rsa/rsa_lib.c
+++ b/crypto/rsa/rsa_lib.c
@@ -13,6 +13,8 @@
#include <openssl/lhash.h>
#include "internal/bn_int.h"
#include <openssl/engine.h>
+#include <openssl/evp.h>
+#include "internal/evp_int.h"
#include "rsa_locl.h"
static const RSA_METHOD *default_RSA_meth = NULL;
@@ -309,3 +311,13 @@ ENGINE *RSA_get0_engine(const RSA *r)
{
return r->engine;
}
+
+int RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2)
+{
+ /* If key type not RSA or RSA-PSS return error */
+ if (ctx != NULL && ctx->pmeth != NULL
+ && ctx->pmeth->pkey_id != EVP_PKEY_RSA
+ && ctx->pmeth->pkey_id != EVP_PKEY_RSA_PSS)
+ return -1;
+ return EVP_PKEY_CTX_ctrl(ctx, -1, optype, cmd, p1, p2);
+}