diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-01-29 20:32:32 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-01-29 20:32:32 +1000 |
commit | 12603de634fe628488066d1f3f2c720ca20d6df9 (patch) | |
tree | a7345e533ae5811eeb682a7cf8d02c6a8008b6f6 /crypto/evp/pmeth_gn.c | |
parent | a76ce2862bc6ae2cf8a749c8747d371041fc42d1 (diff) |
Add RSA key validation to default provider
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10780)
Diffstat (limited to 'crypto/evp/pmeth_gn.c')
-rw-r--r-- | crypto/evp/pmeth_gn.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c index 14c5fd4b99..a093337e62 100644 --- a/crypto/evp/pmeth_gn.c +++ b/crypto/evp/pmeth_gn.c @@ -171,75 +171,6 @@ EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, return mac_key; } -int EVP_PKEY_check(EVP_PKEY_CTX *ctx) -{ - EVP_PKEY *pkey = ctx->pkey; - - if (pkey == NULL) { - EVPerr(EVP_F_EVP_PKEY_CHECK, EVP_R_NO_KEY_SET); - return 0; - } - - /* call customized check function first */ - if (ctx->pmeth->check != NULL) - return ctx->pmeth->check(pkey); - - /* use default check function in ameth */ - if (pkey->ameth == NULL || pkey->ameth->pkey_check == NULL) { - EVPerr(EVP_F_EVP_PKEY_CHECK, - EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); - return -2; - } - - return pkey->ameth->pkey_check(pkey); -} - -int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx) -{ - EVP_PKEY *pkey = ctx->pkey; - - if (pkey == NULL) { - EVPerr(EVP_F_EVP_PKEY_PUBLIC_CHECK, EVP_R_NO_KEY_SET); - return 0; - } - - /* call customized public key check function first */ - if (ctx->pmeth->public_check != NULL) - return ctx->pmeth->public_check(pkey); - - /* use default public key check function in ameth */ - if (pkey->ameth == NULL || pkey->ameth->pkey_public_check == NULL) { - EVPerr(EVP_F_EVP_PKEY_PUBLIC_CHECK, - EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); - return -2; - } - - return pkey->ameth->pkey_public_check(pkey); -} - -int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx) -{ - EVP_PKEY *pkey = ctx->pkey; - - if (pkey == NULL) { - EVPerr(EVP_F_EVP_PKEY_PARAM_CHECK, EVP_R_NO_KEY_SET); - return 0; - } - - /* call customized param check function first */ - if (ctx->pmeth->param_check != NULL) - return ctx->pmeth->param_check(pkey); - - /* use default param check function in ameth */ - if (pkey->ameth == NULL || pkey->ameth->pkey_param_check == NULL) { - EVPerr(EVP_F_EVP_PKEY_PARAM_CHECK, - EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); - return -2; - } - - return pkey->ameth->pkey_param_check(pkey); -} - #endif /* FIPS_MODE */ /*- All methods below can also be used in FIPS_MODE */ @@ -327,5 +258,3 @@ const OSSL_PARAM *EVP_PKEY_key_fromdata_settable(EVP_PKEY_CTX *ctx) return evp_keymgmt_importdomparam_types(ctx->keymgmt); return NULL; } - - |