Commit e8330cf5 authored by Ben Laurie's avatar Ben Laurie
Browse files

Add a cleanup function for MDs.

parent 7d344704
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -165,6 +165,8 @@ int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
	/* Don't assume ctx->md_data was cleaned in EVP_Digest_Final,
	 * because sometimes only copies of the context are ever finalised.
	 */
	if(ctx->digest && ctx->digest->cleanup)
		ctx->digest->cleanup(ctx);
	if(ctx->digest && ctx->digest->ctx_size && ctx->md_data)
		{
		memset(ctx->md_data,0,ctx->digest->ctx_size);
+1 −0
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ struct env_md_st
	int (*update)(EVP_MD_CTX *ctx,const void *data,unsigned long count);
	int (*final)(EVP_MD_CTX *ctx,unsigned char *md);
	int (*copy)(EVP_MD_CTX *to,const EVP_MD_CTX *from);
	int (*cleanup)(EVP_MD_CTX *ctx);

	/* FIXME: prototype these some day */
	int (*sign)();
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ static const EVP_MD dsa_md=
	update,
	final,
	NULL,
	NULL,
	EVP_PKEY_DSA_method,
	SHA_CBLOCK,
	sizeof(EVP_MD *)+sizeof(SHA_CTX),
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ static const EVP_MD dss1_md=
	update,
	final,
	NULL,
	NULL,
	EVP_PKEY_DSA_method,
	SHA_CBLOCK,
	sizeof(EVP_MD *)+sizeof(SHA_CTX),
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ static const EVP_MD md2_md=
	update,
	final,
	NULL,
	NULL,
	EVP_PKEY_RSA_method,
	MD2_BLOCK,
	sizeof(EVP_MD *)+sizeof(MD2_CTX),
Loading