diff options
author | jsing <> | 2019-10-24 15:47:15 +0000 |
---|---|---|
committer | jsing <> | 2019-10-24 15:47:15 +0000 |
commit | 50e5605acbcc6e6bf44f795b6e2747dbecef349d (patch) | |
tree | e97555b995bdb0199ee9fe306f2b474d1305fa88 /src/lib/libcrypto/rsa/rsa_lib.c | |
parent | ef4abacfcb7c75a1b082fb154737c8d3af8f14ab (diff) | |
download | openbsd-50e5605acbcc6e6bf44f795b6e2747dbecef349d.tar.gz openbsd-50e5605acbcc6e6bf44f795b6e2747dbecef349d.tar.bz2 openbsd-50e5605acbcc6e6bf44f795b6e2747dbecef349d.zip |
Provide RSA_pkey_ctx_ctrl().
This is a wrapper around EVP_PKEY_CTX_ctrl() which requires the key to be
either RSA or RSA-PSS.
From OpenSSL 1.1.1d.
ok tb@
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_lib.c')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_lib.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c index 84e1dc7eaf..bf6865d260 100644 --- a/src/lib/libcrypto/rsa/rsa_lib.c +++ b/src/lib/libcrypto/rsa/rsa_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_lib.c,v 1.37 2018/04/14 07:09:21 tb Exp $ */ | 1 | /* $OpenBSD: rsa_lib.c,v 1.38 2019/10/24 15:47:15 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -63,9 +63,12 @@ | |||
63 | #include <openssl/bn.h> | 63 | #include <openssl/bn.h> |
64 | #include <openssl/crypto.h> | 64 | #include <openssl/crypto.h> |
65 | #include <openssl/err.h> | 65 | #include <openssl/err.h> |
66 | #include <openssl/evp.h> | ||
66 | #include <openssl/lhash.h> | 67 | #include <openssl/lhash.h> |
67 | #include <openssl/rsa.h> | 68 | #include <openssl/rsa.h> |
68 | 69 | ||
70 | #include "evp_locl.h" | ||
71 | |||
69 | #ifndef OPENSSL_NO_ENGINE | 72 | #ifndef OPENSSL_NO_ENGINE |
70 | #include <openssl/engine.h> | 73 | #include <openssl/engine.h> |
71 | #endif | 74 | #endif |
@@ -365,3 +368,15 @@ RSA_set_flags(RSA *r, int flags) | |||
365 | { | 368 | { |
366 | r->flags |= flags; | 369 | r->flags |= flags; |
367 | } | 370 | } |
371 | |||
372 | int | ||
373 | RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2) | ||
374 | { | ||
375 | /* Return an error if the key type is not RSA or RSA-PSS. */ | ||
376 | if (ctx != NULL && ctx->pmeth != NULL && | ||
377 | ctx->pmeth->pkey_id != EVP_PKEY_RSA && | ||
378 | ctx->pmeth->pkey_id != EVP_PKEY_RSA_PSS) | ||
379 | return -1; | ||
380 | |||
381 | return EVP_PKEY_CTX_ctrl(ctx, -1, optype, cmd, p1, p2); | ||
382 | } | ||