From b13e238a195893b55e09f2c5d73c70b27a040a50 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 27 Feb 1998 17:51:28 +0000 Subject: bug fixes --- cipher/md.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cipher/md.c') diff --git a/cipher/md.c b/cipher/md.c index dd40136a7..a9a566698 100644 --- a/cipher/md.c +++ b/cipher/md.c @@ -49,15 +49,18 @@ void md_enable( MD_HANDLE h, int algo ) { if( algo == DIGEST_ALGO_MD5 ) { - md5_init( &h->md5 ); + if( !h->use_md5 ) + md5_init( &h->md5 ); h->use_md5 = 1; } else if( algo == DIGEST_ALGO_RMD160 ) { - rmd160_init( &h->rmd160 ); + if( !h->use_rmd160 ) + rmd160_init( &h->rmd160 ); h->use_rmd160 = 1; } else if( algo == DIGEST_ALGO_SHA1 ) { - sha1_init( &h->sha1 ); + if( !h->use_sha1 ) + sha1_init( &h->sha1 ); h->use_sha1 = 1; } else -- cgit v1.2.3