1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Remove hacks which are not anymore needed since we now require Libgcrypt 1.4

This commit is contained in:
Werner Koch 2008-09-29 15:02:55 +00:00
parent d62ca1bf4a
commit 7d63aa42e5
27 changed files with 348 additions and 271 deletions

View file

@ -1,3 +1,14 @@
2008-09-29 Werner Koch <wk@g10code.com>
* gpg.c (main): Remove -sat kludge. Note that we printed a
warning for two years.
* seskey.c (encode_md_value): Remove extra gcry_md_test_algo since
it is not needed with Libgcrypt 1.4.
* skclist.c (random_is_faked): Simplify.
* sign.c (match_dsa_hash): Remove runtime check for SHA224.
* gpg.c (print_mds): Use GCRY_MD_SHA224 constant.
2008-09-25 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (keyedit_menu): Fix bug where a modified keyring loses

View file

@ -1,6 +1,6 @@
/* gpg.c - The GnuPG utility (main for gpg)
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
* 2006, 2007 Free Software Foundation, Inc.
* 2006, 2007, 2008 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@ -3285,15 +3285,6 @@ main (int argc, char **argv)
set_cmd( &cmd, aListKeys);
}
/* kludge to let -sat generate a clear text signature */
if( opt.textmode == 2 && !detached_sig && opt.armor && cmd == aSign )
{
log_info ("compatibility note:\n");
log_info ("\"-sat\" won't generate clear signed messages in "
"future versions\n");
log_info ("Use \"--clearsign\" instead of \"-sat\"\n");
cmd = aClearsign;
}
if( opt.verbose > 1 )
set_packet_list_mode(1);
@ -4155,8 +4146,8 @@ print_mds( const char *fname, int algo )
gcry_md_enable (md, GCRY_MD_MD5);
gcry_md_enable (md, GCRY_MD_SHA1);
gcry_md_enable (md, GCRY_MD_RMD160);
if (!openpgp_md_test_algo (DIGEST_ALGO_SHA224))
gcry_md_enable (md, DIGEST_ALGO_SHA224);
if (!openpgp_md_test_algo (GCRY_MD_SHA224))
gcry_md_enable (md, GCRY_MD_SHA224);
if (!openpgp_md_test_algo (GCRY_MD_SHA256))
gcry_md_enable (md, GCRY_MD_SHA256);
if (!openpgp_md_test_algo (GCRY_MD_SHA384))
@ -4178,8 +4169,8 @@ print_mds( const char *fname, int algo )
print_hashline( md, GCRY_MD_MD5, fname );
print_hashline( md, GCRY_MD_SHA1, fname );
print_hashline( md, GCRY_MD_RMD160, fname );
if (!gcry_md_test_algo (DIGEST_ALGO_SHA224))
print_hashline (md, DIGEST_ALGO_SHA224, fname);
if (!gcry_md_test_algo (GCRY_MD_SHA224))
print_hashline (md, GCRY_MD_SHA224, fname);
if (!gcry_md_test_algo (GCRY_MD_SHA256))
print_hashline( md, GCRY_MD_SHA256, fname );
if (!gcry_md_test_algo (GCRY_MD_SHA384))
@ -4195,8 +4186,8 @@ print_mds( const char *fname, int algo )
print_hex( md, GCRY_MD_MD5, fname );
print_hex( md, GCRY_MD_SHA1, fname );
print_hex( md, GCRY_MD_RMD160, fname );
if (!gcry_md_test_algo (DIGEST_ALGO_SHA224))
print_hex (md, DIGEST_ALGO_SHA224, fname);
if (!gcry_md_test_algo (GCRY_MD_SHA224))
print_hex (md, GCRY_MD_SHA224, fname);
if (!gcry_md_test_algo (GCRY_MD_SHA256))
print_hex( md, GCRY_MD_SHA256, fname );
if (!gcry_md_test_algo (GCRY_MD_SHA384))

View file

@ -128,6 +128,7 @@ require-cross-certification
# the "--keyserver-options debug".
keyserver hkp://keys.gnupg.net
#keyserver http://http-keys.gnupg.net
#keyserver mailto:pgp-public-keys@keys.nl.pgp.net
#keyserver ldap://pgp.surfnet.nl:11370
#keyserver ldap://keyserver.pgp.com

View file

@ -265,11 +265,9 @@ encode_md_value (PKT_public_key *pk, PKT_secret_key *sk,
byte *asn;
size_t asnlen;
rc = gcry_md_test_algo (hash_algo);
if (!rc)
rc = gcry_md_algo_info (hash_algo, GCRYCTL_GET_ASNOID, NULL, &asnlen);
rc = gcry_md_algo_info (hash_algo, GCRYCTL_GET_ASNOID, NULL, &asnlen);
if (rc)
log_fatal ("can't get OID of algo %d: %s\n",
log_fatal ("can't get OID of digest algorithm %d: %s\n",
hash_algo, gpg_strerror (rc));
asn = xmalloc (asnlen);
if ( gcry_md_algo_info (hash_algo, GCRYCTL_GET_ASNOID, asn, &asnlen) )

View file

@ -346,9 +346,7 @@ match_dsa_hash (unsigned int qbytes)
if (qbytes <= 20)
return DIGEST_ALGO_SHA1;
/* SHA244 is only available with libgcrypt 1.4 - thus do a runtime
test. */
if (qbytes <= 28 && !gcry_md_test_algo (DIGEST_ALGO_SHA224))
if (qbytes <= 28)
return DIGEST_ALGO_SHA224;
if (qbytes <= 32)

View file

@ -41,18 +41,7 @@
int
random_is_faked (void)
{
/* We use a runtime check to allow for slow migrattion of libgcrypt.
We can't use the constant becuase that one is actually an enum
value. */
gpg_error_t err = gcry_control ( 51 /*GCRYCTL_FAKED_RANDOM_P*/, 0);
if (!err)
return 0;
if (gpg_err_code (err) != GPG_ERR_INV_OP)
return 1;
log_info ("WARNING: libgcrypt too old.\n");
log_info (" can't check whether we are in faked RNG mode\n");
return 0; /* Need to return false. */
return !!gcry_control ( GCRYCTL_FAKED_RANDOM_P, 0);
}