asymcipher.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. /*
  2. * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <openssl/objects.h>
  12. #include <openssl/evp.h>
  13. #include "internal/cryptlib.h"
  14. #include "internal/provider.h"
  15. #include "internal/core.h"
  16. #include "crypto/evp.h"
  17. #include "evp_local.h"
  18. static int evp_pkey_asym_cipher_init(EVP_PKEY_CTX *ctx, int operation,
  19. const OSSL_PARAM params[])
  20. {
  21. int ret = 0;
  22. void *provkey = NULL;
  23. EVP_ASYM_CIPHER *cipher = NULL;
  24. EVP_KEYMGMT *tmp_keymgmt = NULL;
  25. const OSSL_PROVIDER *tmp_prov = NULL;
  26. const char *supported_ciph = NULL;
  27. int iter;
  28. if (ctx == NULL) {
  29. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  30. return -2;
  31. }
  32. evp_pkey_ctx_free_old_ops(ctx);
  33. ctx->operation = operation;
  34. ERR_set_mark();
  35. if (evp_pkey_ctx_is_legacy(ctx))
  36. goto legacy;
  37. if (ctx->pkey == NULL) {
  38. ERR_clear_last_mark();
  39. ERR_raise(ERR_LIB_EVP, EVP_R_NO_KEY_SET);
  40. goto err;
  41. }
  42. /*
  43. * Try to derive the supported asym cipher from |ctx->keymgmt|.
  44. */
  45. if (!ossl_assert(ctx->pkey->keymgmt == NULL
  46. || ctx->pkey->keymgmt == ctx->keymgmt)) {
  47. ERR_clear_last_mark();
  48. ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  49. goto err;
  50. }
  51. supported_ciph
  52. = evp_keymgmt_util_query_operation_name(ctx->keymgmt,
  53. OSSL_OP_ASYM_CIPHER);
  54. if (supported_ciph == NULL) {
  55. ERR_clear_last_mark();
  56. ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  57. goto err;
  58. }
  59. /*
  60. * We perform two iterations:
  61. *
  62. * 1. Do the normal asym cipher fetch, using the fetching data given by
  63. * the EVP_PKEY_CTX.
  64. * 2. Do the provider specific asym cipher fetch, from the same provider
  65. * as |ctx->keymgmt|
  66. *
  67. * We then try to fetch the keymgmt from the same provider as the
  68. * asym cipher, and try to export |ctx->pkey| to that keymgmt (when
  69. * this keymgmt happens to be the same as |ctx->keymgmt|, the export
  70. * is a no-op, but we call it anyway to not complicate the code even
  71. * more).
  72. * If the export call succeeds (returns a non-NULL provider key pointer),
  73. * we're done and can perform the operation itself. If not, we perform
  74. * the second iteration, or jump to legacy.
  75. */
  76. for (iter = 1, provkey = NULL; iter < 3 && provkey == NULL; iter++) {
  77. EVP_KEYMGMT *tmp_keymgmt_tofree;
  78. /*
  79. * If we're on the second iteration, free the results from the first.
  80. * They are NULL on the first iteration, so no need to check what
  81. * iteration we're on.
  82. */
  83. EVP_ASYM_CIPHER_free(cipher);
  84. EVP_KEYMGMT_free(tmp_keymgmt);
  85. switch (iter) {
  86. case 1:
  87. cipher = EVP_ASYM_CIPHER_fetch(ctx->libctx, supported_ciph,
  88. ctx->propquery);
  89. if (cipher != NULL)
  90. tmp_prov = EVP_ASYM_CIPHER_get0_provider(cipher);
  91. break;
  92. case 2:
  93. tmp_prov = EVP_KEYMGMT_get0_provider(ctx->keymgmt);
  94. cipher =
  95. evp_asym_cipher_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  96. supported_ciph, ctx->propquery);
  97. if (cipher == NULL)
  98. goto legacy;
  99. break;
  100. }
  101. if (cipher == NULL)
  102. continue;
  103. /*
  104. * Ensure that the key is provided, either natively, or as a cached
  105. * export. We start by fetching the keymgmt with the same name as
  106. * |ctx->pkey|, but from the provider of the asym cipher method, using
  107. * the same property query as when fetching the asym cipher method.
  108. * With the keymgmt we found (if we did), we try to export |ctx->pkey|
  109. * to it (evp_pkey_export_to_provider() is smart enough to only actually
  110. * export it if |tmp_keymgmt| is different from |ctx->pkey|'s keymgmt)
  111. */
  112. tmp_keymgmt_tofree = tmp_keymgmt
  113. = evp_keymgmt_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  114. EVP_KEYMGMT_get0_name(ctx->keymgmt),
  115. ctx->propquery);
  116. if (tmp_keymgmt != NULL)
  117. provkey = evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
  118. &tmp_keymgmt, ctx->propquery);
  119. if (tmp_keymgmt == NULL)
  120. EVP_KEYMGMT_free(tmp_keymgmt_tofree);
  121. }
  122. if (provkey == NULL) {
  123. EVP_ASYM_CIPHER_free(cipher);
  124. goto legacy;
  125. }
  126. ERR_pop_to_mark();
  127. /* No more legacy from here down to legacy: */
  128. ctx->op.ciph.cipher = cipher;
  129. ctx->op.ciph.algctx = cipher->newctx(ossl_provider_ctx(cipher->prov));
  130. if (ctx->op.ciph.algctx == NULL) {
  131. /* The provider key can stay in the cache */
  132. ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  133. goto err;
  134. }
  135. switch (operation) {
  136. case EVP_PKEY_OP_ENCRYPT:
  137. if (cipher->encrypt_init == NULL) {
  138. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  139. ret = -2;
  140. goto err;
  141. }
  142. ret = cipher->encrypt_init(ctx->op.ciph.algctx, provkey, params);
  143. break;
  144. case EVP_PKEY_OP_DECRYPT:
  145. if (cipher->decrypt_init == NULL) {
  146. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  147. ret = -2;
  148. goto err;
  149. }
  150. ret = cipher->decrypt_init(ctx->op.ciph.algctx, provkey, params);
  151. break;
  152. default:
  153. ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  154. goto err;
  155. }
  156. if (ret <= 0)
  157. goto err;
  158. EVP_KEYMGMT_free(tmp_keymgmt);
  159. return 1;
  160. legacy:
  161. /*
  162. * If we don't have the full support we need with provided methods,
  163. * let's go see if legacy does.
  164. */
  165. ERR_pop_to_mark();
  166. EVP_KEYMGMT_free(tmp_keymgmt);
  167. tmp_keymgmt = NULL;
  168. if (ctx->pmeth == NULL || ctx->pmeth->encrypt == NULL) {
  169. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  170. return -2;
  171. }
  172. switch (ctx->operation) {
  173. case EVP_PKEY_OP_ENCRYPT:
  174. if (ctx->pmeth->encrypt_init == NULL)
  175. return 1;
  176. ret = ctx->pmeth->encrypt_init(ctx);
  177. break;
  178. case EVP_PKEY_OP_DECRYPT:
  179. if (ctx->pmeth->decrypt_init == NULL)
  180. return 1;
  181. ret = ctx->pmeth->decrypt_init(ctx);
  182. break;
  183. default:
  184. ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  185. ret = -1;
  186. }
  187. err:
  188. if (ret <= 0) {
  189. evp_pkey_ctx_free_old_ops(ctx);
  190. ctx->operation = EVP_PKEY_OP_UNDEFINED;
  191. }
  192. EVP_KEYMGMT_free(tmp_keymgmt);
  193. return ret;
  194. }
  195. int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx)
  196. {
  197. return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_ENCRYPT, NULL);
  198. }
  199. int EVP_PKEY_encrypt_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[])
  200. {
  201. return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_ENCRYPT, params);
  202. }
  203. int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,
  204. unsigned char *out, size_t *outlen,
  205. const unsigned char *in, size_t inlen)
  206. {
  207. int ret;
  208. if (ctx == NULL) {
  209. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  210. return -2;
  211. }
  212. if (ctx->operation != EVP_PKEY_OP_ENCRYPT) {
  213. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
  214. return -1;
  215. }
  216. if (ctx->op.ciph.algctx == NULL)
  217. goto legacy;
  218. ret = ctx->op.ciph.cipher->encrypt(ctx->op.ciph.algctx, out, outlen,
  219. (out == NULL ? 0 : *outlen), in, inlen);
  220. return ret;
  221. legacy:
  222. if (ctx->pmeth == NULL || ctx->pmeth->encrypt == NULL) {
  223. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  224. return -2;
  225. }
  226. M_check_autoarg(ctx, out, outlen, EVP_F_EVP_PKEY_ENCRYPT)
  227. return ctx->pmeth->encrypt(ctx, out, outlen, in, inlen);
  228. }
  229. int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx)
  230. {
  231. return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_DECRYPT, NULL);
  232. }
  233. int EVP_PKEY_decrypt_init_ex(EVP_PKEY_CTX *ctx, const OSSL_PARAM params[])
  234. {
  235. return evp_pkey_asym_cipher_init(ctx, EVP_PKEY_OP_DECRYPT, params);
  236. }
  237. int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,
  238. unsigned char *out, size_t *outlen,
  239. const unsigned char *in, size_t inlen)
  240. {
  241. int ret;
  242. if (ctx == NULL) {
  243. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  244. return -2;
  245. }
  246. if (ctx->operation != EVP_PKEY_OP_DECRYPT) {
  247. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
  248. return -1;
  249. }
  250. if (ctx->op.ciph.algctx == NULL)
  251. goto legacy;
  252. ret = ctx->op.ciph.cipher->decrypt(ctx->op.ciph.algctx, out, outlen,
  253. (out == NULL ? 0 : *outlen), in, inlen);
  254. return ret;
  255. legacy:
  256. if (ctx->pmeth == NULL || ctx->pmeth->decrypt == NULL) {
  257. ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  258. return -2;
  259. }
  260. M_check_autoarg(ctx, out, outlen, EVP_F_EVP_PKEY_DECRYPT)
  261. return ctx->pmeth->decrypt(ctx, out, outlen, in, inlen);
  262. }
  263. static EVP_ASYM_CIPHER *evp_asym_cipher_new(OSSL_PROVIDER *prov)
  264. {
  265. EVP_ASYM_CIPHER *cipher = OPENSSL_zalloc(sizeof(EVP_ASYM_CIPHER));
  266. if (cipher == NULL)
  267. return NULL;
  268. cipher->lock = CRYPTO_THREAD_lock_new();
  269. if (cipher->lock == NULL) {
  270. ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  271. OPENSSL_free(cipher);
  272. return NULL;
  273. }
  274. cipher->prov = prov;
  275. ossl_provider_up_ref(prov);
  276. cipher->refcnt = 1;
  277. return cipher;
  278. }
  279. static void *evp_asym_cipher_from_algorithm(int name_id,
  280. const OSSL_ALGORITHM *algodef,
  281. OSSL_PROVIDER *prov)
  282. {
  283. const OSSL_DISPATCH *fns = algodef->implementation;
  284. EVP_ASYM_CIPHER *cipher = NULL;
  285. int ctxfncnt = 0, encfncnt = 0, decfncnt = 0;
  286. int gparamfncnt = 0, sparamfncnt = 0;
  287. if ((cipher = evp_asym_cipher_new(prov)) == NULL) {
  288. ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  289. goto err;
  290. }
  291. cipher->name_id = name_id;
  292. if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  293. goto err;
  294. cipher->description = algodef->algorithm_description;
  295. for (; fns->function_id != 0; fns++) {
  296. switch (fns->function_id) {
  297. case OSSL_FUNC_ASYM_CIPHER_NEWCTX:
  298. if (cipher->newctx != NULL)
  299. break;
  300. cipher->newctx = OSSL_FUNC_asym_cipher_newctx(fns);
  301. ctxfncnt++;
  302. break;
  303. case OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT:
  304. if (cipher->encrypt_init != NULL)
  305. break;
  306. cipher->encrypt_init = OSSL_FUNC_asym_cipher_encrypt_init(fns);
  307. encfncnt++;
  308. break;
  309. case OSSL_FUNC_ASYM_CIPHER_ENCRYPT:
  310. if (cipher->encrypt != NULL)
  311. break;
  312. cipher->encrypt = OSSL_FUNC_asym_cipher_encrypt(fns);
  313. encfncnt++;
  314. break;
  315. case OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT:
  316. if (cipher->decrypt_init != NULL)
  317. break;
  318. cipher->decrypt_init = OSSL_FUNC_asym_cipher_decrypt_init(fns);
  319. decfncnt++;
  320. break;
  321. case OSSL_FUNC_ASYM_CIPHER_DECRYPT:
  322. if (cipher->decrypt != NULL)
  323. break;
  324. cipher->decrypt = OSSL_FUNC_asym_cipher_decrypt(fns);
  325. decfncnt++;
  326. break;
  327. case OSSL_FUNC_ASYM_CIPHER_FREECTX:
  328. if (cipher->freectx != NULL)
  329. break;
  330. cipher->freectx = OSSL_FUNC_asym_cipher_freectx(fns);
  331. ctxfncnt++;
  332. break;
  333. case OSSL_FUNC_ASYM_CIPHER_DUPCTX:
  334. if (cipher->dupctx != NULL)
  335. break;
  336. cipher->dupctx = OSSL_FUNC_asym_cipher_dupctx(fns);
  337. break;
  338. case OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS:
  339. if (cipher->get_ctx_params != NULL)
  340. break;
  341. cipher->get_ctx_params
  342. = OSSL_FUNC_asym_cipher_get_ctx_params(fns);
  343. gparamfncnt++;
  344. break;
  345. case OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS:
  346. if (cipher->gettable_ctx_params != NULL)
  347. break;
  348. cipher->gettable_ctx_params
  349. = OSSL_FUNC_asym_cipher_gettable_ctx_params(fns);
  350. gparamfncnt++;
  351. break;
  352. case OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS:
  353. if (cipher->set_ctx_params != NULL)
  354. break;
  355. cipher->set_ctx_params
  356. = OSSL_FUNC_asym_cipher_set_ctx_params(fns);
  357. sparamfncnt++;
  358. break;
  359. case OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS:
  360. if (cipher->settable_ctx_params != NULL)
  361. break;
  362. cipher->settable_ctx_params
  363. = OSSL_FUNC_asym_cipher_settable_ctx_params(fns);
  364. sparamfncnt++;
  365. break;
  366. }
  367. }
  368. if (ctxfncnt != 2
  369. || (encfncnt != 0 && encfncnt != 2)
  370. || (decfncnt != 0 && decfncnt != 2)
  371. || (encfncnt != 2 && decfncnt != 2)
  372. || (gparamfncnt != 0 && gparamfncnt != 2)
  373. || (sparamfncnt != 0 && sparamfncnt != 2)) {
  374. /*
  375. * In order to be a consistent set of functions we must have at least
  376. * a set of context functions (newctx and freectx) as well as a pair of
  377. * "cipher" functions: (encrypt_init, encrypt) or
  378. * (decrypt_init decrypt). set_ctx_params and settable_ctx_params are
  379. * optional, but if one of them is present then the other one must also
  380. * be present. The same applies to get_ctx_params and
  381. * gettable_ctx_params. The dupctx function is optional.
  382. */
  383. ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  384. goto err;
  385. }
  386. return cipher;
  387. err:
  388. EVP_ASYM_CIPHER_free(cipher);
  389. return NULL;
  390. }
  391. void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher)
  392. {
  393. int i;
  394. if (cipher == NULL)
  395. return;
  396. CRYPTO_DOWN_REF(&cipher->refcnt, &i, cipher->lock);
  397. if (i > 0)
  398. return;
  399. OPENSSL_free(cipher->type_name);
  400. ossl_provider_free(cipher->prov);
  401. CRYPTO_THREAD_lock_free(cipher->lock);
  402. OPENSSL_free(cipher);
  403. }
  404. int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher)
  405. {
  406. int ref = 0;
  407. CRYPTO_UP_REF(&cipher->refcnt, &ref, cipher->lock);
  408. return 1;
  409. }
  410. OSSL_PROVIDER *EVP_ASYM_CIPHER_get0_provider(const EVP_ASYM_CIPHER *cipher)
  411. {
  412. return cipher->prov;
  413. }
  414. EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
  415. const char *properties)
  416. {
  417. return evp_generic_fetch(ctx, OSSL_OP_ASYM_CIPHER, algorithm, properties,
  418. evp_asym_cipher_from_algorithm,
  419. (int (*)(void *))EVP_ASYM_CIPHER_up_ref,
  420. (void (*)(void *))EVP_ASYM_CIPHER_free);
  421. }
  422. EVP_ASYM_CIPHER *evp_asym_cipher_fetch_from_prov(OSSL_PROVIDER *prov,
  423. const char *algorithm,
  424. const char *properties)
  425. {
  426. return evp_generic_fetch_from_prov(prov, OSSL_OP_ASYM_CIPHER,
  427. algorithm, properties,
  428. evp_asym_cipher_from_algorithm,
  429. (int (*)(void *))EVP_ASYM_CIPHER_up_ref,
  430. (void (*)(void *))EVP_ASYM_CIPHER_free);
  431. }
  432. int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name)
  433. {
  434. return evp_is_a(cipher->prov, cipher->name_id, NULL, name);
  435. }
  436. int evp_asym_cipher_get_number(const EVP_ASYM_CIPHER *cipher)
  437. {
  438. return cipher->name_id;
  439. }
  440. const char *EVP_ASYM_CIPHER_get0_name(const EVP_ASYM_CIPHER *cipher)
  441. {
  442. return cipher->type_name;
  443. }
  444. const char *EVP_ASYM_CIPHER_get0_description(const EVP_ASYM_CIPHER *cipher)
  445. {
  446. return cipher->description;
  447. }
  448. void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
  449. void (*fn)(EVP_ASYM_CIPHER *cipher,
  450. void *arg),
  451. void *arg)
  452. {
  453. evp_generic_do_all(libctx, OSSL_OP_ASYM_CIPHER,
  454. (void (*)(void *, void *))fn, arg,
  455. evp_asym_cipher_from_algorithm,
  456. (int (*)(void *))EVP_ASYM_CIPHER_up_ref,
  457. (void (*)(void *))EVP_ASYM_CIPHER_free);
  458. }
  459. int EVP_ASYM_CIPHER_names_do_all(const EVP_ASYM_CIPHER *cipher,
  460. void (*fn)(const char *name, void *data),
  461. void *data)
  462. {
  463. if (cipher->prov != NULL)
  464. return evp_names_do_all(cipher->prov, cipher->name_id, fn, data);
  465. return 1;
  466. }
  467. const OSSL_PARAM *EVP_ASYM_CIPHER_gettable_ctx_params(const EVP_ASYM_CIPHER *cip)
  468. {
  469. void *provctx;
  470. if (cip == NULL || cip->gettable_ctx_params == NULL)
  471. return NULL;
  472. provctx = ossl_provider_ctx(EVP_ASYM_CIPHER_get0_provider(cip));
  473. return cip->gettable_ctx_params(NULL, provctx);
  474. }
  475. const OSSL_PARAM *EVP_ASYM_CIPHER_settable_ctx_params(const EVP_ASYM_CIPHER *cip)
  476. {
  477. void *provctx;
  478. if (cip == NULL || cip->settable_ctx_params == NULL)
  479. return NULL;
  480. provctx = ossl_provider_ctx(EVP_ASYM_CIPHER_get0_provider(cip));
  481. return cip->settable_ctx_params(NULL, provctx);
  482. }