diff options
author | Werner Koch <[email protected]> | 2006-04-28 14:31:29 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2006-04-28 14:31:29 +0000 |
commit | 00ffc478de4940b9fbbb9f488f545a65ca7d1278 (patch) | |
tree | 9ec271f1c03397acbd3c6274931ca7a927ae907f /g10/pkclist.c | |
parent | Still merging 1.4.3 code back (diff) | |
download | gnupg-00ffc478de4940b9fbbb9f488f545a65ca7d1278.tar.gz gnupg-00ffc478de4940b9fbbb9f488f545a65ca7d1278.zip |
Merged recent changes from 1.4
Diffstat (limited to 'g10/pkclist.c')
-rw-r--r-- | g10/pkclist.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/g10/pkclist.c b/g10/pkclist.c index 9e2a63642..4a12083d3 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -1,6 +1,6 @@ /* pkclist.c - create a list of public keys - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, - * 2004, 2005 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + * 2006 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -1210,8 +1210,20 @@ algo_available( preftype_t preftype, int algo, void *hint ) } else if( preftype == PREFTYPE_HASH ) { - if(hint && ((*(int *)hint) != gcry_md_get_algo_dlen (algo))) - return 0; + if(hint) + { + if(opt.flags.dsa2) + { + /* If --enable-dsa2 is set, then we'll accept a hash + that is larger than we need. If --enable-dsa2 is not + set, then we won't accept any hash that isn't exactly + the right size. */ + if ((*(int *)hint) > gcry_md_get_algo_dlen (algo)) + return 0; + } + else if (((*(int *)hint) != gcry_md_get_algo_dlen (algo))) + return 0; + } if((PGP6 || PGP7) && (algo != DIGEST_ALGO_MD5 && algo != DIGEST_ALGO_SHA1 |