Path: blob/main/crypto/openssl/providers/implementations/asymciphers/rsa_enc.c
108091 views
/*1* Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.2*3* Licensed under the Apache License 2.0 (the "License"). You may not use4* this file except in compliance with the License. You can obtain a copy5* in the file LICENSE in the source distribution or at6* https://www.openssl.org/source/license.html7*/89/*10* RSA low level APIs are deprecated for public use, but still ok for11* internal use.12*/13#include "internal/deprecated.h"1415#include <openssl/crypto.h>16#include <openssl/evp.h>17#include <openssl/core_dispatch.h>18#include <openssl/core_names.h>19#include <openssl/rsa.h>20#include <openssl/params.h>21#include <openssl/err.h>22#include <openssl/proverr.h>23/* Just for SSL_MAX_MASTER_KEY_LENGTH */24#include <openssl/prov_ssl.h>25#include "internal/constant_time.h"26#include "internal/sizes.h"27#include "crypto/rsa.h"28#include "prov/provider_ctx.h"29#include "prov/implementations.h"30#include "prov/providercommon.h"31#include "prov/securitycheck.h"32#include <stdlib.h>3334static OSSL_FUNC_asym_cipher_newctx_fn rsa_newctx;35static OSSL_FUNC_asym_cipher_encrypt_init_fn rsa_encrypt_init;36static OSSL_FUNC_asym_cipher_encrypt_fn rsa_encrypt;37static OSSL_FUNC_asym_cipher_decrypt_init_fn rsa_decrypt_init;38static OSSL_FUNC_asym_cipher_decrypt_fn rsa_decrypt;39static OSSL_FUNC_asym_cipher_freectx_fn rsa_freectx;40static OSSL_FUNC_asym_cipher_dupctx_fn rsa_dupctx;41static OSSL_FUNC_asym_cipher_get_ctx_params_fn rsa_get_ctx_params;42static OSSL_FUNC_asym_cipher_gettable_ctx_params_fn rsa_gettable_ctx_params;43static OSSL_FUNC_asym_cipher_set_ctx_params_fn rsa_set_ctx_params;44static OSSL_FUNC_asym_cipher_settable_ctx_params_fn rsa_settable_ctx_params;4546static OSSL_ITEM padding_item[] = {47{ RSA_PKCS1_PADDING, OSSL_PKEY_RSA_PAD_MODE_PKCSV15 },48{ RSA_NO_PADDING, OSSL_PKEY_RSA_PAD_MODE_NONE },49{ RSA_PKCS1_OAEP_PADDING, OSSL_PKEY_RSA_PAD_MODE_OAEP }, /* Correct spelling first */50{ RSA_PKCS1_OAEP_PADDING, "oeap" },51{ 0, NULL }52};5354/*55* What's passed as an actual key is defined by the KEYMGMT interface.56* We happen to know that our KEYMGMT simply passes RSA structures, so57* we use that here too.58*/5960typedef struct {61OSSL_LIB_CTX *libctx;62RSA *rsa;63int pad_mode;64int operation;65/* OAEP message digest */66EVP_MD *oaep_md;67/* message digest for MGF1 */68EVP_MD *mgf1_md;69/* OAEP label */70unsigned char *oaep_label;71size_t oaep_labellen;72/* TLS padding */73unsigned int client_version;74unsigned int alt_version;75/* PKCS#1 v1.5 decryption mode */76unsigned int implicit_rejection;77OSSL_FIPS_IND_DECLARE78} PROV_RSA_CTX;7980static void *rsa_newctx(void *provctx)81{82PROV_RSA_CTX *prsactx;8384if (!ossl_prov_is_running())85return NULL;86prsactx = OPENSSL_zalloc(sizeof(PROV_RSA_CTX));87if (prsactx == NULL)88return NULL;89prsactx->libctx = PROV_LIBCTX_OF(provctx);90OSSL_FIPS_IND_INIT(prsactx)9192return prsactx;93}9495static int rsa_init(void *vprsactx, void *vrsa, const OSSL_PARAM params[],96int operation, const char *desc)97{98PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;99int protect = 0;100101if (!ossl_prov_is_running() || prsactx == NULL || vrsa == NULL)102return 0;103104if (!ossl_rsa_key_op_get_protect(vrsa, operation, &protect))105return 0;106if (!RSA_up_ref(vrsa))107return 0;108RSA_free(prsactx->rsa);109prsactx->rsa = vrsa;110prsactx->operation = operation;111prsactx->implicit_rejection = 1;112113switch (RSA_test_flags(prsactx->rsa, RSA_FLAG_TYPE_MASK)) {114case RSA_FLAG_TYPE_RSA:115prsactx->pad_mode = RSA_PKCS1_PADDING;116break;117default:118/* This should not happen due to the check above */119ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);120return 0;121}122123OSSL_FIPS_IND_SET_APPROVED(prsactx)124if (!rsa_set_ctx_params(prsactx, params))125return 0;126#ifdef FIPS_MODULE127if (!ossl_fips_ind_rsa_key_check(OSSL_FIPS_IND_GET(prsactx),128OSSL_FIPS_IND_SETTABLE0, prsactx->libctx,129prsactx->rsa, desc, protect))130return 0;131#endif132return 1;133}134135static int rsa_encrypt_init(void *vprsactx, void *vrsa,136const OSSL_PARAM params[])137{138return rsa_init(vprsactx, vrsa, params, EVP_PKEY_OP_ENCRYPT,139"RSA Encrypt Init");140}141142static int rsa_decrypt_init(void *vprsactx, void *vrsa,143const OSSL_PARAM params[])144{145return rsa_init(vprsactx, vrsa, params, EVP_PKEY_OP_DECRYPT,146"RSA Decrypt Init");147}148149static int rsa_encrypt(void *vprsactx, unsigned char *out, size_t *outlen,150size_t outsize, const unsigned char *in, size_t inlen)151{152PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;153size_t len = RSA_size(prsactx->rsa);154int ret;155156if (!ossl_prov_is_running())157return 0;158159#ifdef FIPS_MODULE160if ((prsactx->pad_mode == RSA_PKCS1_PADDING161|| prsactx->pad_mode == RSA_PKCS1_WITH_TLS_PADDING)162&& !OSSL_FIPS_IND_ON_UNAPPROVED(prsactx, OSSL_FIPS_IND_SETTABLE1,163prsactx->libctx, "RSA Encrypt",164"PKCS#1 v1.5 padding",165ossl_fips_config_rsa_pkcs15_padding_disabled)) {166ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE);167return 0;168}169#endif170171if (len == 0) {172ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);173return 0;174}175176if (out == NULL) {177*outlen = len;178return 1;179}180181if (outsize < len) {182ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);183return 0;184}185186if (prsactx->pad_mode == RSA_PKCS1_OAEP_PADDING) {187int rsasize = RSA_size(prsactx->rsa);188unsigned char *tbuf;189190if ((tbuf = OPENSSL_malloc(rsasize)) == NULL)191return 0;192if (prsactx->oaep_md == NULL) {193prsactx->oaep_md = EVP_MD_fetch(prsactx->libctx, "SHA-1", NULL);194if (prsactx->oaep_md == NULL) {195OPENSSL_free(tbuf);196ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);197return 0;198}199}200ret = ossl_rsa_padding_add_PKCS1_OAEP_mgf1_ex(prsactx->libctx, tbuf,201rsasize, in, inlen,202prsactx->oaep_label,203prsactx->oaep_labellen,204prsactx->oaep_md,205prsactx->mgf1_md);206207if (!ret) {208OPENSSL_free(tbuf);209return 0;210}211ret = RSA_public_encrypt(rsasize, tbuf, out, prsactx->rsa,212RSA_NO_PADDING);213OPENSSL_free(tbuf);214} else {215ret = RSA_public_encrypt(inlen, in, out, prsactx->rsa,216prsactx->pad_mode);217}218/* A ret value of 0 is not an error */219if (ret < 0)220return ret;221*outlen = ret;222return 1;223}224225static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen,226size_t outsize, const unsigned char *in, size_t inlen)227{228PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;229int ret;230int pad_mode;231size_t len = RSA_size(prsactx->rsa);232233if (!ossl_prov_is_running())234return 0;235236if (prsactx->pad_mode == RSA_PKCS1_WITH_TLS_PADDING) {237if (out == NULL) {238*outlen = SSL_MAX_MASTER_KEY_LENGTH;239return 1;240}241if (outsize < SSL_MAX_MASTER_KEY_LENGTH) {242ERR_raise(ERR_LIB_PROV, PROV_R_BAD_LENGTH);243return 0;244}245} else {246if (out == NULL) {247if (len == 0) {248ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY);249return 0;250}251*outlen = len;252return 1;253}254255if (outsize < len) {256ERR_raise(ERR_LIB_PROV, PROV_R_BAD_LENGTH);257return 0;258}259}260261if (prsactx->pad_mode == RSA_PKCS1_OAEP_PADDING262|| prsactx->pad_mode == RSA_PKCS1_WITH_TLS_PADDING) {263unsigned char *tbuf;264265if ((tbuf = OPENSSL_malloc(len)) == NULL)266return 0;267ret = RSA_private_decrypt(inlen, in, tbuf, prsactx->rsa,268RSA_NO_PADDING);269/*270* With no padding then, on success ret should be len, otherwise an271* error occurred (non-constant time)272*/273if (ret != (int)len) {274OPENSSL_free(tbuf);275ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_DECRYPT);276return 0;277}278if (prsactx->pad_mode == RSA_PKCS1_OAEP_PADDING) {279if (prsactx->oaep_md == NULL) {280prsactx->oaep_md = EVP_MD_fetch(prsactx->libctx, "SHA-1", NULL);281if (prsactx->oaep_md == NULL) {282OPENSSL_free(tbuf);283ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);284return 0;285}286}287ret = RSA_padding_check_PKCS1_OAEP_mgf1(out, outsize, tbuf,288len, len,289prsactx->oaep_label,290prsactx->oaep_labellen,291prsactx->oaep_md,292prsactx->mgf1_md);293} else {294/* RSA_PKCS1_WITH_TLS_PADDING */295if (prsactx->client_version <= 0) {296ERR_raise(ERR_LIB_PROV, PROV_R_BAD_TLS_CLIENT_VERSION);297OPENSSL_free(tbuf);298return 0;299}300ret = ossl_rsa_padding_check_PKCS1_type_2_TLS(301prsactx->libctx, out, outsize, tbuf, len,302prsactx->client_version, prsactx->alt_version);303}304OPENSSL_free(tbuf);305} else {306if ((prsactx->implicit_rejection == 0) && (prsactx->pad_mode == RSA_PKCS1_PADDING))307pad_mode = RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING;308else309pad_mode = prsactx->pad_mode;310ret = RSA_private_decrypt(inlen, in, out, prsactx->rsa, pad_mode);311}312*outlen = constant_time_select_s(constant_time_msb_s(ret), *outlen, ret);313ret = constant_time_select_int(constant_time_msb(ret), 0, 1);314return ret;315}316317static void rsa_freectx(void *vprsactx)318{319PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;320321RSA_free(prsactx->rsa);322323EVP_MD_free(prsactx->oaep_md);324EVP_MD_free(prsactx->mgf1_md);325OPENSSL_free(prsactx->oaep_label);326327OPENSSL_free(prsactx);328}329330static void *rsa_dupctx(void *vprsactx)331{332PROV_RSA_CTX *srcctx = (PROV_RSA_CTX *)vprsactx;333PROV_RSA_CTX *dstctx;334335if (!ossl_prov_is_running())336return NULL;337338dstctx = OPENSSL_zalloc(sizeof(*srcctx));339if (dstctx == NULL)340return NULL;341342*dstctx = *srcctx;343if (dstctx->rsa != NULL && !RSA_up_ref(dstctx->rsa)) {344OPENSSL_free(dstctx);345return NULL;346}347348if (dstctx->oaep_md != NULL && !EVP_MD_up_ref(dstctx->oaep_md)) {349RSA_free(dstctx->rsa);350OPENSSL_free(dstctx);351return NULL;352}353354if (dstctx->mgf1_md != NULL && !EVP_MD_up_ref(dstctx->mgf1_md)) {355RSA_free(dstctx->rsa);356EVP_MD_free(dstctx->oaep_md);357OPENSSL_free(dstctx);358return NULL;359}360361if (dstctx->oaep_label != NULL362&& (dstctx->oaep_label = OPENSSL_memdup(dstctx->oaep_label, dstctx->oaep_labellen)) == NULL) {363rsa_freectx(dstctx);364return NULL;365}366367return dstctx;368}369370static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)371{372PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;373OSSL_PARAM *p;374375if (prsactx == NULL)376return 0;377378p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_PAD_MODE);379if (p != NULL)380switch (p->data_type) {381case OSSL_PARAM_INTEGER: /* Support for legacy pad mode number */382if (!OSSL_PARAM_set_int(p, prsactx->pad_mode))383return 0;384break;385case OSSL_PARAM_UTF8_STRING: {386int i;387const char *word = NULL;388389for (i = 0; padding_item[i].id != 0; i++) {390if (prsactx->pad_mode == (int)padding_item[i].id) {391word = padding_item[i].ptr;392break;393}394}395396if (word != NULL) {397if (!OSSL_PARAM_set_utf8_string(p, word))398return 0;399} else {400ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);401}402} break;403default:404return 0;405}406407p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST);408if (p != NULL && !OSSL_PARAM_set_utf8_string(p, prsactx->oaep_md == NULL ? "" : EVP_MD_get0_name(prsactx->oaep_md)))409return 0;410411p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST);412if (p != NULL) {413EVP_MD *mgf1_md = prsactx->mgf1_md == NULL ? prsactx->oaep_md414: prsactx->mgf1_md;415416if (!OSSL_PARAM_set_utf8_string(p, mgf1_md == NULL ? "" : EVP_MD_get0_name(mgf1_md)))417return 0;418}419420p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL);421if (p != NULL && !OSSL_PARAM_set_octet_ptr(p, prsactx->oaep_label, prsactx->oaep_labellen))422return 0;423424p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION);425if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->client_version))426return 0;427428p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION);429if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->alt_version))430return 0;431432p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION);433if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->implicit_rejection))434return 0;435if (!OSSL_FIPS_IND_GET_CTX_PARAM(prsactx, params))436return 0;437return 1;438}439440static const OSSL_PARAM known_gettable_ctx_params[] = {441OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST, NULL, 0),442OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, NULL, 0),443OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST, NULL, 0),444OSSL_PARAM_DEFN(OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, OSSL_PARAM_OCTET_PTR,445NULL, 0),446OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),447OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),448OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),449OSSL_FIPS_IND_GETTABLE_CTX_PARAM()450OSSL_PARAM_END451};452453static const OSSL_PARAM *rsa_gettable_ctx_params(ossl_unused void *vprsactx,454ossl_unused void *provctx)455{456return known_gettable_ctx_params;457}458459static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])460{461PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;462const OSSL_PARAM *p;463char mdname[OSSL_MAX_NAME_SIZE];464char mdprops[OSSL_MAX_PROPQUERY_SIZE] = { '\0' };465char *str = NULL;466467if (prsactx == NULL)468return 0;469if (ossl_param_is_empty(params))470return 1;471472if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE0, params,473OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK))474return 0;475if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE1, params,476OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED))477return 0;478479p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST);480if (p != NULL) {481str = mdname;482if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdname)))483return 0;484485p = OSSL_PARAM_locate_const(params,486OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS);487if (p != NULL) {488str = mdprops;489if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdprops)))490return 0;491}492493EVP_MD_free(prsactx->oaep_md);494prsactx->oaep_md = EVP_MD_fetch(prsactx->libctx, mdname, mdprops);495496if (prsactx->oaep_md == NULL)497return 0;498}499500p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_PAD_MODE);501if (p != NULL) {502int pad_mode = 0;503504switch (p->data_type) {505case OSSL_PARAM_INTEGER: /* Support for legacy pad mode number */506if (!OSSL_PARAM_get_int(p, &pad_mode))507return 0;508break;509case OSSL_PARAM_UTF8_STRING: {510int i;511512if (p->data == NULL)513return 0;514515for (i = 0; padding_item[i].id != 0; i++) {516if (strcmp(p->data, padding_item[i].ptr) == 0) {517pad_mode = padding_item[i].id;518break;519}520}521} break;522default:523return 0;524}525526/*527* PSS padding is for signatures only so is not compatible with528* asymmetric cipher use.529*/530if (pad_mode == RSA_PKCS1_PSS_PADDING)531return 0;532if (pad_mode == RSA_PKCS1_OAEP_PADDING && prsactx->oaep_md == NULL) {533prsactx->oaep_md = EVP_MD_fetch(prsactx->libctx, "SHA1", mdprops);534if (prsactx->oaep_md == NULL)535return 0;536}537prsactx->pad_mode = pad_mode;538}539540p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST);541if (p != NULL) {542str = mdname;543if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdname)))544return 0;545546p = OSSL_PARAM_locate_const(params,547OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS);548if (p != NULL) {549str = mdprops;550if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdprops)))551return 0;552} else {553str = NULL;554}555556EVP_MD_free(prsactx->mgf1_md);557prsactx->mgf1_md = EVP_MD_fetch(prsactx->libctx, mdname, str);558559if (prsactx->mgf1_md == NULL)560return 0;561}562563p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL);564if (p != NULL) {565void *tmp_label = NULL;566size_t tmp_labellen;567568if (!OSSL_PARAM_get_octet_string(p, &tmp_label, 0, &tmp_labellen))569return 0;570OPENSSL_free(prsactx->oaep_label);571prsactx->oaep_label = (unsigned char *)tmp_label;572prsactx->oaep_labellen = tmp_labellen;573}574575p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION);576if (p != NULL) {577unsigned int client_version;578579if (!OSSL_PARAM_get_uint(p, &client_version))580return 0;581prsactx->client_version = client_version;582}583584p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION);585if (p != NULL) {586unsigned int alt_version;587588if (!OSSL_PARAM_get_uint(p, &alt_version))589return 0;590prsactx->alt_version = alt_version;591}592p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION);593if (p != NULL) {594unsigned int implicit_rejection;595596if (!OSSL_PARAM_get_uint(p, &implicit_rejection))597return 0;598prsactx->implicit_rejection = implicit_rejection;599}600return 1;601}602603static const OSSL_PARAM known_settable_ctx_params[] = {604OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST, NULL, 0),605OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS, NULL, 0),606OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, NULL, 0),607OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST, NULL, 0),608OSSL_PARAM_utf8_string(OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS, NULL, 0),609OSSL_PARAM_octet_string(OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, NULL, 0),610OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),611OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),612OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),613OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK)614OSSL_FIPS_IND_SETTABLE_CTX_PARAM(OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED)615OSSL_PARAM_END616};617618static const OSSL_PARAM *rsa_settable_ctx_params(ossl_unused void *vprsactx,619ossl_unused void *provctx)620{621return known_settable_ctx_params;622}623624const OSSL_DISPATCH ossl_rsa_asym_cipher_functions[] = {625{ OSSL_FUNC_ASYM_CIPHER_NEWCTX, (void (*)(void))rsa_newctx },626{ OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT, (void (*)(void))rsa_encrypt_init },627{ OSSL_FUNC_ASYM_CIPHER_ENCRYPT, (void (*)(void))rsa_encrypt },628{ OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT, (void (*)(void))rsa_decrypt_init },629{ OSSL_FUNC_ASYM_CIPHER_DECRYPT, (void (*)(void))rsa_decrypt },630{ OSSL_FUNC_ASYM_CIPHER_FREECTX, (void (*)(void))rsa_freectx },631{ OSSL_FUNC_ASYM_CIPHER_DUPCTX, (void (*)(void))rsa_dupctx },632{ OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS,633(void (*)(void))rsa_get_ctx_params },634{ OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS,635(void (*)(void))rsa_gettable_ctx_params },636{ OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS,637(void (*)(void))rsa_set_ctx_params },638{ OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS,639(void (*)(void))rsa_settable_ctx_params },640OSSL_DISPATCH_END641};642643644