diff options
Diffstat (limited to 'cipher/md.c')
-rw-r--r-- | cipher/md.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/cipher/md.c b/cipher/md.c index 46083960f..fbae09765 100644 --- a/cipher/md.c +++ b/cipher/md.c @@ -27,10 +27,6 @@ #include "cipher.h" #include "errors.h" - - -/*static FILE *dumpfp;*/ - /**************** * Open a message digest handle for use with algorithm ALGO. * More algorithms may be added by md_enable(). The initial algorithm @@ -41,13 +37,6 @@ md_open( int algo, int secure ) { MD_HANDLE hd; - #if 0 - if( !dumpfp ) - dumpfp = fopen("md.out", "w"); - if( !dumpfp ) - BUG(); - { int i; for(i=0; i < 16; i++ ) putc('\xff', dumpfp ); } - #endif hd = secure ? m_alloc_secure_clear( sizeof *hd ) : m_alloc_clear( sizeof *hd ); hd->secure = secure; @@ -81,7 +70,6 @@ md_copy( MD_HANDLE a ) { MD_HANDLE b; - /*{ int i; for(i=0; i < 16; i++ ) putc('\xee', dumpfp ); }*/ b = a->secure ? m_alloc_secure( sizeof *b ) : m_alloc( sizeof *b ); memcpy( b, a, sizeof *a ); @@ -101,10 +89,12 @@ md_close(MD_HANDLE a) void md_write( MD_HANDLE a, byte *inbuf, size_t inlen) { - /* if( a->bufcount && fwrite(a->buffer, a->bufcount, 1, dumpfp ) != 1 ) - BUG(); - if( inlen && fwrite(inbuf, inlen, 1, dumpfp ) != 1 ) - BUG(); */ + if( a->debug ) { + if( a->bufcount && fwrite(a->buffer, a->bufcount, 1, a->debug ) != 1 ) + BUG(); + if( inlen && fwrite(inbuf, inlen, 1, a->debug ) != 1 ) + BUG(); + } if( a->use_rmd160 ) { rmd160_write( &a->rmd160, a->buffer, a->bufcount ); rmd160_write( &a->rmd160, inbuf, inlen ); @@ -127,7 +117,6 @@ md_final(MD_HANDLE a) { if( a->bufcount ) md_write( a, NULL, 0 ); - /*{ int i; for(i=0; i < 16; i++ ) putc('\xcc', dumpfp ); }*/ if( a->use_rmd160 ) { byte *p; rmd160_final( &a->rmd160 ); |