summaryrefslogtreecommitdiffstats
path: root/fips/rand/fips_drbg_hash.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-03-07 16:51:17 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-03-07 16:51:17 +0000
commite45c6c4e2537434f087793e5c51a5cb70af9d82e (patch)
tree147e5ddba01a9cb6b431a476d33dfa55d04589e1 /fips/rand/fips_drbg_hash.c
parentff4a19a471bfcb80ddd11b491b181589e324a52f (diff)
Uninstantiate and free functions for DRBG.
Diffstat (limited to 'fips/rand/fips_drbg_hash.c')
-rw-r--r--fips/rand/fips_drbg_hash.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fips/rand/fips_drbg_hash.c b/fips/rand/fips_drbg_hash.c
index 4dbcdb6a7b..ca3bce7320 100644
--- a/fips/rand/fips_drbg_hash.c
+++ b/fips/rand/fips_drbg_hash.c
@@ -306,6 +306,13 @@ static int drbg_hash_generate(DRBG_CTX *dctx,
return 1;
}
+static int drbg_hash_uninstantiate(DRBG_CTX *dctx)
+ {
+ EVP_MD_CTX_cleanup(&dctx->d.hash.mctx);
+ OPENSSL_cleanse(&dctx->d.hash, sizeof(DRBG_HASH_CTX));
+ return 1;
+ }
+
int fips_drbg_hash_init(DRBG_CTX *dctx)
{
const EVP_MD *md;
@@ -346,6 +353,7 @@ int fips_drbg_hash_init(DRBG_CTX *dctx)
dctx->instantiate = drbg_hash_instantiate;
dctx->reseed = drbg_hash_reseed;
dctx->generate = drbg_hash_generate;
+ dctx->uninstantiate = drbg_hash_uninstantiate;
dctx->d.hash.md = md;
EVP_MD_CTX_init(&hctx->mctx);