drbg_hmac.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. /*
  2. * Copyright 2011-2024 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 <stdlib.h>
  10. #include <string.h>
  11. #include <openssl/crypto.h>
  12. #include <openssl/err.h>
  13. #include <openssl/rand.h>
  14. #include <openssl/proverr.h>
  15. #include "internal/thread_once.h"
  16. #include "prov/providercommon.h"
  17. #include "prov/implementations.h"
  18. #include "prov/provider_ctx.h"
  19. #include "prov/hmac_drbg.h"
  20. #include "drbg_local.h"
  21. static OSSL_FUNC_rand_newctx_fn drbg_hmac_new_wrapper;
  22. static OSSL_FUNC_rand_freectx_fn drbg_hmac_free;
  23. static OSSL_FUNC_rand_instantiate_fn drbg_hmac_instantiate_wrapper;
  24. static OSSL_FUNC_rand_uninstantiate_fn drbg_hmac_uninstantiate_wrapper;
  25. static OSSL_FUNC_rand_generate_fn drbg_hmac_generate_wrapper;
  26. static OSSL_FUNC_rand_reseed_fn drbg_hmac_reseed_wrapper;
  27. static OSSL_FUNC_rand_settable_ctx_params_fn drbg_hmac_settable_ctx_params;
  28. static OSSL_FUNC_rand_set_ctx_params_fn drbg_hmac_set_ctx_params;
  29. static OSSL_FUNC_rand_gettable_ctx_params_fn drbg_hmac_gettable_ctx_params;
  30. static OSSL_FUNC_rand_get_ctx_params_fn drbg_hmac_get_ctx_params;
  31. static OSSL_FUNC_rand_verify_zeroization_fn drbg_hmac_verify_zeroization;
  32. static int drbg_hmac_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[]);
  33. /*
  34. * Called twice by SP800-90Ar1 10.1.2.2 HMAC_DRBG_Update_Process.
  35. *
  36. * hmac is an object that holds the input/output Key and Value (K and V).
  37. * inbyte is 0x00 on the first call and 0x01 on the second call.
  38. * in1, in2, in3 are optional inputs that can be NULL.
  39. * in1len, in2len, in3len are the lengths of the input buffers.
  40. *
  41. * The returned K,V is:
  42. * hmac->K = HMAC(hmac->K, hmac->V || inbyte || [in1] || [in2] || [in3])
  43. * hmac->V = HMAC(hmac->K, hmac->V)
  44. *
  45. * Returns zero if an error occurs otherwise it returns 1.
  46. */
  47. static int do_hmac(PROV_DRBG_HMAC *hmac, unsigned char inbyte,
  48. const unsigned char *in1, size_t in1len,
  49. const unsigned char *in2, size_t in2len,
  50. const unsigned char *in3, size_t in3len)
  51. {
  52. EVP_MAC_CTX *ctx = hmac->ctx;
  53. if (!EVP_MAC_init(ctx, hmac->K, hmac->blocklen, NULL)
  54. /* K = HMAC(K, V || inbyte || [in1] || [in2] || [in3]) */
  55. || !EVP_MAC_update(ctx, hmac->V, hmac->blocklen)
  56. || !EVP_MAC_update(ctx, &inbyte, 1)
  57. || !(in1 == NULL || in1len == 0 || EVP_MAC_update(ctx, in1, in1len))
  58. || !(in2 == NULL || in2len == 0 || EVP_MAC_update(ctx, in2, in2len))
  59. || !(in3 == NULL || in3len == 0 || EVP_MAC_update(ctx, in3, in3len))
  60. || !EVP_MAC_final(ctx, hmac->K, NULL, sizeof(hmac->K)))
  61. return 0;
  62. /* V = HMAC(K, V) */
  63. return EVP_MAC_init(ctx, hmac->K, hmac->blocklen, NULL)
  64. && EVP_MAC_update(ctx, hmac->V, hmac->blocklen)
  65. && EVP_MAC_final(ctx, hmac->V, NULL, sizeof(hmac->V));
  66. }
  67. /*
  68. * SP800-90Ar1 10.1.2.2 HMAC_DRBG_Update_Process
  69. *
  70. *
  71. * Updates the drbg objects Key(K) and Value(V) using the following algorithm:
  72. * K,V = do_hmac(hmac, 0, in1, in2, in3)
  73. * if (any input is not NULL)
  74. * K,V = do_hmac(hmac, 1, in1, in2, in3)
  75. *
  76. * where in1, in2, in3 are optional input buffers that can be NULL.
  77. * in1len, in2len, in3len are the lengths of the input buffers.
  78. *
  79. * Returns zero if an error occurs otherwise it returns 1.
  80. */
  81. static int drbg_hmac_update(PROV_DRBG_HMAC *hmac,
  82. const unsigned char *in1, size_t in1len,
  83. const unsigned char *in2, size_t in2len,
  84. const unsigned char *in3, size_t in3len)
  85. {
  86. /* (Steps 1-2) K = HMAC(K, V||0x00||provided_data). V = HMAC(K,V) */
  87. if (!do_hmac(hmac, 0x00, in1, in1len, in2, in2len, in3, in3len))
  88. return 0;
  89. /* (Step 3) If provided_data == NULL then return (K,V) */
  90. if (in1len == 0 && in2len == 0 && in3len == 0)
  91. return 1;
  92. /* (Steps 4-5) K = HMAC(K, V||0x01||provided_data). V = HMAC(K,V) */
  93. return do_hmac(hmac, 0x01, in1, in1len, in2, in2len, in3, in3len);
  94. }
  95. /*
  96. * SP800-90Ar1 10.1.2.3 HMAC_DRBG_Instantiate_Process:
  97. *
  98. * This sets the drbg Key (K) to all zeros, and Value (V) to all 1's.
  99. * and then calls (K,V) = drbg_hmac_update() with input parameters:
  100. * ent = entropy data (Can be NULL) of length ent_len.
  101. * nonce = nonce data (Can be NULL) of length nonce_len.
  102. * pstr = personalization data (Can be NULL) of length pstr_len.
  103. *
  104. * Returns zero if an error occurs otherwise it returns 1.
  105. */
  106. int ossl_drbg_hmac_init(PROV_DRBG_HMAC *hmac,
  107. const unsigned char *ent, size_t ent_len,
  108. const unsigned char *nonce, size_t nonce_len,
  109. const unsigned char *pstr, size_t pstr_len)
  110. {
  111. if (hmac->ctx == NULL) {
  112. ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_MAC);
  113. return 0;
  114. }
  115. /* (Step 2) Key = 0x00 00...00 */
  116. memset(hmac->K, 0x00, hmac->blocklen);
  117. /* (Step 3) V = 0x01 01...01 */
  118. memset(hmac->V, 0x01, hmac->blocklen);
  119. /* (Step 4) (K,V) = HMAC_DRBG_Update(entropy||nonce||pers string, K, V) */
  120. return drbg_hmac_update(hmac, ent, ent_len, nonce, nonce_len, pstr,
  121. pstr_len);
  122. }
  123. static int drbg_hmac_instantiate(PROV_DRBG *drbg,
  124. const unsigned char *ent, size_t ent_len,
  125. const unsigned char *nonce, size_t nonce_len,
  126. const unsigned char *pstr, size_t pstr_len)
  127. {
  128. return ossl_drbg_hmac_init((PROV_DRBG_HMAC *)drbg->data, ent, ent_len,
  129. nonce, nonce_len, pstr, pstr_len);
  130. }
  131. static int drbg_hmac_instantiate_wrapper(void *vdrbg, unsigned int strength,
  132. int prediction_resistance,
  133. const unsigned char *pstr,
  134. size_t pstr_len,
  135. const OSSL_PARAM params[])
  136. {
  137. PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  138. int ret = 0;
  139. if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  140. return 0;
  141. if (!ossl_prov_is_running()
  142. || !drbg_hmac_set_ctx_params_locked(drbg, params))
  143. goto err;
  144. ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
  145. pstr, pstr_len);
  146. err:
  147. if (drbg->lock != NULL)
  148. CRYPTO_THREAD_unlock(drbg->lock);
  149. return ret;
  150. }
  151. /*
  152. * SP800-90Ar1 10.1.2.4 HMAC_DRBG_Reseed_Process:
  153. *
  154. * Reseeds the drbg's Key (K) and Value (V) by calling
  155. * (K,V) = drbg_hmac_update() with the following input parameters:
  156. * ent = entropy input data (Can be NULL) of length ent_len.
  157. * adin = additional input data (Can be NULL) of length adin_len.
  158. *
  159. * Returns zero if an error occurs otherwise it returns 1.
  160. */
  161. static int drbg_hmac_reseed(PROV_DRBG *drbg,
  162. const unsigned char *ent, size_t ent_len,
  163. const unsigned char *adin, size_t adin_len)
  164. {
  165. PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data;
  166. /* (Step 2) (K,V) = HMAC_DRBG_Update(entropy||additional_input, K, V) */
  167. return drbg_hmac_update(hmac, ent, ent_len, adin, adin_len, NULL, 0);
  168. }
  169. static int drbg_hmac_reseed_wrapper(void *vdrbg, int prediction_resistance,
  170. const unsigned char *ent, size_t ent_len,
  171. const unsigned char *adin, size_t adin_len)
  172. {
  173. PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  174. return ossl_prov_drbg_reseed(drbg, prediction_resistance, ent, ent_len,
  175. adin, adin_len);
  176. }
  177. /*
  178. * SP800-90Ar1 10.1.2.5 HMAC_DRBG_Generate_Process:
  179. *
  180. * Generates pseudo random bytes and updates the internal K,V for the drbg.
  181. * out is a buffer to fill with outlen bytes of pseudo random data.
  182. * adin is an additional_input string of size adin_len that may be NULL.
  183. *
  184. * Returns zero if an error occurs otherwise it returns 1.
  185. */
  186. int ossl_drbg_hmac_generate(PROV_DRBG_HMAC *hmac,
  187. unsigned char *out, size_t outlen,
  188. const unsigned char *adin, size_t adin_len)
  189. {
  190. EVP_MAC_CTX *ctx = hmac->ctx;
  191. const unsigned char *temp = hmac->V;
  192. /* (Step 2) if adin != NULL then (K,V) = HMAC_DRBG_Update(adin, K, V) */
  193. if (adin != NULL
  194. && adin_len > 0
  195. && !drbg_hmac_update(hmac, adin, adin_len, NULL, 0, NULL, 0))
  196. return 0;
  197. /*
  198. * (Steps 3-5) temp = NULL
  199. * while (len(temp) < outlen) {
  200. * V = HMAC(K, V)
  201. * temp = temp || V
  202. * }
  203. */
  204. for (;;) {
  205. if (!EVP_MAC_init(ctx, hmac->K, hmac->blocklen, NULL)
  206. || !EVP_MAC_update(ctx, temp, hmac->blocklen))
  207. return 0;
  208. if (outlen > hmac->blocklen) {
  209. if (!EVP_MAC_final(ctx, out, NULL, outlen))
  210. return 0;
  211. temp = out;
  212. } else {
  213. if (!EVP_MAC_final(ctx, hmac->V, NULL, sizeof(hmac->V)))
  214. return 0;
  215. memcpy(out, hmac->V, outlen);
  216. break;
  217. }
  218. out += hmac->blocklen;
  219. outlen -= hmac->blocklen;
  220. }
  221. /* (Step 6) (K,V) = HMAC_DRBG_Update(adin, K, V) */
  222. if (!drbg_hmac_update(hmac, adin, adin_len, NULL, 0, NULL, 0))
  223. return 0;
  224. return 1;
  225. }
  226. static int drbg_hmac_generate(PROV_DRBG *drbg,
  227. unsigned char *out, size_t outlen,
  228. const unsigned char *adin, size_t adin_len)
  229. {
  230. return ossl_drbg_hmac_generate((PROV_DRBG_HMAC *)drbg->data, out, outlen,
  231. adin, adin_len);
  232. }
  233. static int drbg_hmac_generate_wrapper(void *vdrbg,
  234. unsigned char *out, size_t outlen, unsigned int strength,
  235. int prediction_resistance, const unsigned char *adin, size_t adin_len)
  236. {
  237. PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  238. return ossl_prov_drbg_generate(drbg, out, outlen, strength,
  239. prediction_resistance, adin, adin_len);
  240. }
  241. static int drbg_hmac_uninstantiate(PROV_DRBG *drbg)
  242. {
  243. PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data;
  244. OPENSSL_cleanse(hmac->K, sizeof(hmac->K));
  245. OPENSSL_cleanse(hmac->V, sizeof(hmac->V));
  246. return ossl_prov_drbg_uninstantiate(drbg);
  247. }
  248. static int drbg_hmac_uninstantiate_wrapper(void *vdrbg)
  249. {
  250. PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  251. int ret;
  252. if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  253. return 0;
  254. ret = drbg_hmac_uninstantiate(drbg);
  255. if (drbg->lock != NULL)
  256. CRYPTO_THREAD_unlock(drbg->lock);
  257. return ret;
  258. }
  259. static int drbg_hmac_verify_zeroization(void *vdrbg)
  260. {
  261. PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  262. PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data;
  263. int ret = 0;
  264. if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
  265. return 0;
  266. PROV_DRBG_VERIFY_ZEROIZATION(hmac->K);
  267. PROV_DRBG_VERIFY_ZEROIZATION(hmac->V);
  268. ret = 1;
  269. err:
  270. if (drbg->lock != NULL)
  271. CRYPTO_THREAD_unlock(drbg->lock);
  272. return ret;
  273. }
  274. static int drbg_hmac_new(PROV_DRBG *drbg)
  275. {
  276. PROV_DRBG_HMAC *hmac;
  277. hmac = OPENSSL_secure_zalloc(sizeof(*hmac));
  278. if (hmac == NULL)
  279. return 0;
  280. drbg->data = hmac;
  281. /* See SP800-57 Part1 Rev4 5.6.1 Table 3 */
  282. drbg->max_entropylen = DRBG_MAX_LENGTH;
  283. drbg->max_noncelen = DRBG_MAX_LENGTH;
  284. drbg->max_perslen = DRBG_MAX_LENGTH;
  285. drbg->max_adinlen = DRBG_MAX_LENGTH;
  286. /* Maximum number of bits per request = 2^19 = 2^16 bytes */
  287. drbg->max_request = 1 << 16;
  288. return 1;
  289. }
  290. static void *drbg_hmac_new_wrapper(void *provctx, void *parent,
  291. const OSSL_DISPATCH *parent_dispatch)
  292. {
  293. return ossl_rand_drbg_new(provctx, parent, parent_dispatch,
  294. &drbg_hmac_new, &drbg_hmac_free,
  295. &drbg_hmac_instantiate, &drbg_hmac_uninstantiate,
  296. &drbg_hmac_reseed, &drbg_hmac_generate);
  297. }
  298. static void drbg_hmac_free(void *vdrbg)
  299. {
  300. PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  301. PROV_DRBG_HMAC *hmac;
  302. if (drbg != NULL && (hmac = (PROV_DRBG_HMAC *)drbg->data) != NULL) {
  303. EVP_MAC_CTX_free(hmac->ctx);
  304. ossl_prov_digest_reset(&hmac->digest);
  305. OPENSSL_secure_clear_free(hmac, sizeof(*hmac));
  306. }
  307. ossl_rand_drbg_free(drbg);
  308. }
  309. static int drbg_hmac_get_ctx_params(void *vdrbg, OSSL_PARAM params[])
  310. {
  311. PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  312. PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)drbg->data;
  313. const char *name;
  314. const EVP_MD *md;
  315. OSSL_PARAM *p;
  316. int ret = 0, complete = 0;
  317. if (!ossl_drbg_get_ctx_params_no_lock(drbg, params, &complete))
  318. return 0;
  319. if (complete)
  320. return 1;
  321. if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
  322. return 0;
  323. p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAC);
  324. if (p != NULL) {
  325. if (hmac->ctx == NULL)
  326. goto err;
  327. name = EVP_MAC_get0_name(EVP_MAC_CTX_get0_mac(hmac->ctx));
  328. if (!OSSL_PARAM_set_utf8_string(p, name))
  329. goto err;
  330. }
  331. p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_DIGEST);
  332. if (p != NULL) {
  333. md = ossl_prov_digest_md(&hmac->digest);
  334. if (md == NULL || !OSSL_PARAM_set_utf8_string(p, EVP_MD_get0_name(md)))
  335. goto err;
  336. }
  337. ret = ossl_drbg_get_ctx_params(drbg, params);
  338. err:
  339. if (drbg->lock != NULL)
  340. CRYPTO_THREAD_unlock(drbg->lock);
  341. return ret;
  342. }
  343. static const OSSL_PARAM *drbg_hmac_gettable_ctx_params(ossl_unused void *vctx,
  344. ossl_unused void *p_ctx)
  345. {
  346. static const OSSL_PARAM known_gettable_ctx_params[] = {
  347. OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_MAC, NULL, 0),
  348. OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_DIGEST, NULL, 0),
  349. OSSL_PARAM_DRBG_GETTABLE_CTX_COMMON,
  350. OSSL_PARAM_END
  351. };
  352. return known_gettable_ctx_params;
  353. }
  354. static int drbg_hmac_set_ctx_params_locked(void *vctx, const OSSL_PARAM params[])
  355. {
  356. PROV_DRBG *ctx = (PROV_DRBG *)vctx;
  357. PROV_DRBG_HMAC *hmac = (PROV_DRBG_HMAC *)ctx->data;
  358. OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  359. const EVP_MD *md;
  360. if (!ossl_prov_digest_load_from_params(&hmac->digest, params, libctx))
  361. return 0;
  362. md = ossl_prov_digest_md(&hmac->digest);
  363. if (md != NULL && !ossl_drbg_verify_digest(libctx, md))
  364. return 0; /* Error already raised for us */
  365. if (!ossl_prov_macctx_load_from_params(&hmac->ctx, params,
  366. NULL, NULL, NULL, libctx))
  367. return 0;
  368. if (md != NULL && hmac->ctx != NULL) {
  369. /* These are taken from SP 800-90 10.1 Table 2 */
  370. hmac->blocklen = EVP_MD_get_size(md);
  371. /* See SP800-57 Part1 Rev4 5.6.1 Table 3 */
  372. ctx->strength = 64 * (int)(hmac->blocklen >> 3);
  373. if (ctx->strength > 256)
  374. ctx->strength = 256;
  375. ctx->seedlen = hmac->blocklen;
  376. ctx->min_entropylen = ctx->strength / 8;
  377. ctx->min_noncelen = ctx->min_entropylen / 2;
  378. }
  379. return ossl_drbg_set_ctx_params(ctx, params);
  380. }
  381. static int drbg_hmac_set_ctx_params(void *vctx, const OSSL_PARAM params[])
  382. {
  383. PROV_DRBG *drbg = (PROV_DRBG *)vctx;
  384. int ret;
  385. if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  386. return 0;
  387. ret = drbg_hmac_set_ctx_params_locked(vctx, params);
  388. if (drbg->lock != NULL)
  389. CRYPTO_THREAD_unlock(drbg->lock);
  390. return ret;
  391. }
  392. static const OSSL_PARAM *drbg_hmac_settable_ctx_params(ossl_unused void *vctx,
  393. ossl_unused void *p_ctx)
  394. {
  395. static const OSSL_PARAM known_settable_ctx_params[] = {
  396. OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0),
  397. OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_DIGEST, NULL, 0),
  398. OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_MAC, NULL, 0),
  399. OSSL_PARAM_DRBG_SETTABLE_CTX_COMMON,
  400. OSSL_PARAM_END
  401. };
  402. return known_settable_ctx_params;
  403. }
  404. const OSSL_DISPATCH ossl_drbg_ossl_hmac_functions[] = {
  405. { OSSL_FUNC_RAND_NEWCTX, (void(*)(void))drbg_hmac_new_wrapper },
  406. { OSSL_FUNC_RAND_FREECTX, (void(*)(void))drbg_hmac_free },
  407. { OSSL_FUNC_RAND_INSTANTIATE,
  408. (void(*)(void))drbg_hmac_instantiate_wrapper },
  409. { OSSL_FUNC_RAND_UNINSTANTIATE,
  410. (void(*)(void))drbg_hmac_uninstantiate_wrapper },
  411. { OSSL_FUNC_RAND_GENERATE, (void(*)(void))drbg_hmac_generate_wrapper },
  412. { OSSL_FUNC_RAND_RESEED, (void(*)(void))drbg_hmac_reseed_wrapper },
  413. { OSSL_FUNC_RAND_ENABLE_LOCKING, (void(*)(void))ossl_drbg_enable_locking },
  414. { OSSL_FUNC_RAND_LOCK, (void(*)(void))ossl_drbg_lock },
  415. { OSSL_FUNC_RAND_UNLOCK, (void(*)(void))ossl_drbg_unlock },
  416. { OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS,
  417. (void(*)(void))drbg_hmac_settable_ctx_params },
  418. { OSSL_FUNC_RAND_SET_CTX_PARAMS, (void(*)(void))drbg_hmac_set_ctx_params },
  419. { OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS,
  420. (void(*)(void))drbg_hmac_gettable_ctx_params },
  421. { OSSL_FUNC_RAND_GET_CTX_PARAMS, (void(*)(void))drbg_hmac_get_ctx_params },
  422. { OSSL_FUNC_RAND_VERIFY_ZEROIZATION,
  423. (void(*)(void))drbg_hmac_verify_zeroization },
  424. { OSSL_FUNC_RAND_GET_SEED, (void(*)(void))ossl_drbg_get_seed },
  425. { OSSL_FUNC_RAND_CLEAR_SEED, (void(*)(void))ossl_drbg_clear_seed },
  426. OSSL_DISPATCH_END
  427. };