summaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2008-09-29 17:02:55 +0200
committerWerner Koch <wk@gnupg.org>2008-09-29 17:02:55 +0200
commit7d63aa42e5d2c086810e3d7eca64a01f366b4e88 (patch)
tree7dccaebaa7f86d56fef8beb00eb9c2bc583ede20 /g10
parent2008-09-28 Marcus Brinkmann <marcus@g10code.com> (diff)
downloadgnupg2-7d63aa42e5d2c086810e3d7eca64a01f366b4e88.tar.xz
gnupg2-7d63aa42e5d2c086810e3d7eca64a01f366b4e88.zip
Remove hacks which are not anymore needed since we now require Libgcrypt 1.4
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog11
-rw-r--r--g10/gpg.c23
-rw-r--r--g10/options.skel1
-rw-r--r--g10/seskey.c6
-rw-r--r--g10/sign.c4
-rw-r--r--g10/skclist.c13
6 files changed, 23 insertions, 35 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 9434509a6..0c8c54e6d 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -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
diff --git a/g10/gpg.c b/g10/gpg.c
index 0601f50f0..9dd17906d 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -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))
diff --git a/g10/options.skel b/g10/options.skel
index aa47305c9..deb71c911 100644
--- a/g10/options.skel
+++ b/g10/options.skel
@@ -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
diff --git a/g10/seskey.c b/g10/seskey.c
index b843530dc..cc3c32ea7 100644
--- a/g10/seskey.c
+++ b/g10/seskey.c
@@ -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) )
diff --git a/g10/sign.c b/g10/sign.c
index 022622b20..597aba786 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -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)
diff --git a/g10/skclist.c b/g10/skclist.c
index 405f3f516..22f2c0c8d 100644
--- a/g10/skclist.c
+++ b/g10/skclist.c
@@ -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);
}