diff --git a/g10/ChangeLog b/g10/ChangeLog index 21819a55a..5dca098f2 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,11 @@ +2004-11-03 David Shaw + + * misc.c (print_digest_algo_note): The latest 2440bis drafts + deprecates MD5, so give a warning. + (print_pubkey_algo_note, print_cipher_algo_note, + print_digest_algo_note): Give the algorithm name in the + experimental algo warning. + 2004-11-03 Timo Schulz * passphrase.c (readn, writen): Use w32_strerror instead diff --git a/g10/misc.c b/g10/misc.c index 89ca92e50..3eae2aee8 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -287,46 +287,32 @@ buffer_to_u32( const byte *buffer ) return a; } - -static void -no_exp_algo(void) -{ - static int did_note = 0; - - if( !did_note ) { - did_note = 1; - log_info(_("Experimental algorithms should not be used!\n")); - } -} - void print_pubkey_algo_note( int algo ) { - if( algo >= 100 && algo <= 110 ) - no_exp_algo(); + if(algo >= 100 && algo <= 110) + { + static int warn=0; + if(!warn) + { + warn=1; + log_info(_("WARNING: using experimental public key algorithm %s\n"), + pubkey_algo_to_string(algo)); + } + } } void print_cipher_algo_note( int algo ) { - if( algo >= 100 && algo <= 110 ) - no_exp_algo(); - else if( algo == CIPHER_ALGO_3DES - || algo == CIPHER_ALGO_CAST5 - || algo == CIPHER_ALGO_BLOWFISH - || algo == CIPHER_ALGO_TWOFISH - || algo == CIPHER_ALGO_AES - || algo == CIPHER_ALGO_AES192 - || algo == CIPHER_ALGO_AES256 - ) - ; - else { - static int did_note = 0; - - if( !did_note ) { - did_note = 1; - log_info(_("this cipher algorithm is deprecated; " - "please use a more standard one!\n")); + if(algo >= 100 && algo <= 110) + { + static int warn=0; + if(!warn) + { + warn=1; + log_info(_("WARNING: using experimental cipher algorithm %s\n"), + cipher_algo_to_string(algo)); } } } @@ -334,11 +320,21 @@ print_cipher_algo_note( int algo ) void print_digest_algo_note( int algo ) { - if( algo >= 100 && algo <= 110 ) - no_exp_algo(); + if(algo >= 100 && algo <= 110) + { + static int warn=0; + if(!warn) + { + warn=1; + log_info(_("WARNING: using experimental digest algorithm %s\n"), + digest_algo_to_string(algo)); + } + } + else if(algo==DIGEST_ALGO_MD5) + log_info(_("WARNING: digest algorithm %s is deprecated\n"), + digest_algo_to_string(algo)); } - /* Return a string which is used as a kind of process ID */ const byte * get_session_marker( size_t *rlen )