From 4eafcfb13bc2c36a22569cb95ed1bd9090a5a3af Mon Sep 17 00:00:00 2001 From: David Shaw Date: Tue, 11 Feb 2003 15:05:33 +0000 Subject: [PATCH] * g10.c (print_mds): Check that SHA384 and 512 are available before using them as they are no longer always available. * exec.c (set_exec_path): Add debugging line. * Makefile.am: Use the more correct @PACKAGE@ rather than "gnupg". --- g10/ChangeLog | 9 +++++++++ g10/Makefile.am | 2 +- g10/exec.c | 3 +++ g10/g10.c | 18 ++++++++++++------ 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index c542f767b..00cacbfab 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,12 @@ +2003-02-11 David Shaw + + * g10.c (print_mds): Check that SHA384 and 512 are available + before using them as they are no longer always available. + + * exec.c (set_exec_path): Add debugging line. + + * Makefile.am: Use the more correct @PACKAGE@ rather than "gnupg". + 2003-02-06 David Shaw * Makefile.am: Pass GNUPG_LIBEXECDIR as part of CFLAGS so it can diff --git a/g10/Makefile.am b/g10/Makefile.am index 5bb333f7a..dc515a2b4 100644 --- a/g10/Makefile.am +++ b/g10/Makefile.am @@ -23,7 +23,7 @@ EXTRA_DIST = options.skel # it seems that we can't use this with automake 1.5 #OMIT_DEPENDENCIES = zlib.h zconf.h LDFLAGS = @LDFLAGS@ -libexecdir = @libexecdir@/gnupg +libexecdir = @libexecdir@/@PACKAGE@ CFLAGS = @CFLAGS@ -DGNUPG_LIBEXECDIR="\"$(libexecdir)\"" needed_libs = ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a diff --git a/g10/exec.c b/g10/exec.c index 27aa874f0..fd592e853 100644 --- a/g10/exec.c +++ b/g10/exec.c @@ -112,6 +112,9 @@ int set_exec_path(const char *path,int method) strcat(p,path); + if(DBG_EXTPROG) + log_debug("set_exec_path method %d: %s\n",method,p); + /* Notice that path is never freed. That is intentional due to the way putenv() works. This leaks a few bytes if we call set_exec_path multiple times. */ diff --git a/g10/g10.c b/g10/g10.c index 8e76f3dfb..802d162a1 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -2709,8 +2709,10 @@ print_mds( const char *fname, int algo ) if( !check_digest_algo(DIGEST_ALGO_TIGER) ) md_enable( md, DIGEST_ALGO_TIGER ); md_enable( md, DIGEST_ALGO_SHA256 ); - md_enable( md, DIGEST_ALGO_SHA384 ); - md_enable( md, DIGEST_ALGO_SHA512 ); + if( !check_digest_algo(DIGEST_ALGO_SHA384) ) + md_enable( md, DIGEST_ALGO_SHA384 ); + if( !check_digest_algo(DIGEST_ALGO_SHA512) ) + md_enable( md, DIGEST_ALGO_SHA512 ); } while( (n=fread( buf, 1, DIM(buf), fp )) ) @@ -2729,8 +2731,10 @@ print_mds( const char *fname, int algo ) if( !check_digest_algo(DIGEST_ALGO_TIGER) ) print_hashline( md, DIGEST_ALGO_TIGER, fname ); print_hashline( md, DIGEST_ALGO_SHA256, fname ); - print_hashline( md, DIGEST_ALGO_SHA384, fname ); - print_hashline( md, DIGEST_ALGO_SHA512, fname ); + if( !check_digest_algo(DIGEST_ALGO_SHA384) ) + print_hashline( md, DIGEST_ALGO_SHA384, fname ); + if( !check_digest_algo(DIGEST_ALGO_SHA512) ) + print_hashline( md, DIGEST_ALGO_SHA512, fname ); } } else { @@ -2743,8 +2747,10 @@ print_mds( const char *fname, int algo ) if( !check_digest_algo(DIGEST_ALGO_TIGER) ) print_hex( md, DIGEST_ALGO_TIGER, fname ); print_hex( md, DIGEST_ALGO_SHA256, fname ); - print_hex( md, DIGEST_ALGO_SHA384, fname ); - print_hex( md, DIGEST_ALGO_SHA512, fname ); + if( !check_digest_algo(DIGEST_ALGO_SHA384) ) + print_hex( md, DIGEST_ALGO_SHA384, fname ); + if( !check_digest_algo(DIGEST_ALGO_SHA512) ) + print_hex( md, DIGEST_ALGO_SHA512, fname ); } } }