gpg: Default to SHA-512 for all signature types on RSA keys.
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 7 Sep 2017 22:49:35 +0000 (18:49 -0400)
committerPeter Michael Green <plugwash@raspbian.org>
Wed, 25 Jul 2018 10:25:32 +0000 (11:25 +0100)
* g10/main.h (DEFAULT_DIGEST_ALGO): Use SHA512 instead of SHA256 in
--gnupg mode (leave strict RFC and PGP modes alone).
* configure.ac: Do not allow disabling sha512.
* g10/misc.c (map_md_openpgp_to_gcry): Always support SHA512.

--

SHA512 is more performant on most 64-bit platforms than SHA256, and
offers a better security margin.  It is also widely implemented.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic update-defaults
Gbp-Pq: Name gpg-Default-to-SHA-512-for-all-signature-types-on-RS.patch

configure.ac
g10/main.h
g10/misc.c

index 0b6425dd7b34100aa823a7874c673774dd707ab5..c8c91aae7b6f8b292f775ae783d305f19132ebd4 100644 (file)
@@ -314,7 +314,7 @@ GNUPG_GPG_DISABLE_ALGO([rmd160],[RIPE-MD160 hash])
 GNUPG_GPG_DISABLE_ALGO([sha224],[SHA-224 hash])
 # SHA256 is a MUST algorithm for GnuPG.
 GNUPG_GPG_DISABLE_ALGO([sha384],[SHA-384 hash])
-GNUPG_GPG_DISABLE_ALGO([sha512],[SHA-512 hash])
+# SHA512 is a MUST algorithm for GnuPG.
 
 
 # Allow disabling of zip support.
index 6f93de98d48272be474432dad7eb38b3c91bcb59..dcd3767affc22ef28f3e03993f0aa24669949905 100644 (file)
@@ -41,7 +41,7 @@
 # define DEFAULT_CIPHER_ALGO     CIPHER_ALGO_3DES
 #endif
 
-#define DEFAULT_DIGEST_ALGO     ((GNUPG)? DIGEST_ALGO_SHA256:DIGEST_ALGO_SHA1)
+#define DEFAULT_DIGEST_ALGO     ((GNUPG)? DIGEST_ALGO_SHA512:DIGEST_ALGO_SHA1)
 #define DEFAULT_S2K_DIGEST_ALGO DIGEST_ALGO_SHA1
 #ifdef HAVE_ZIP
 # define DEFAULT_COMPRESS_ALGO   COMPRESS_ALGO_ZIP
index 97809692e24168dd036bbf8bce830a7583e7a7e8..86baff9f6dcecd19cbdd12ba2f60139c9d5b6ed4 100644 (file)
@@ -743,11 +743,8 @@ map_md_openpgp_to_gcry (digest_algo_t algo)
     case DIGEST_ALGO_SHA384: return 0;
 #endif
 
-#ifdef GPG_USE_SHA512
     case DIGEST_ALGO_SHA512: return GCRY_MD_SHA512;
-#else
-    case DIGEST_ALGO_SHA512: return 0;
-#endif
+
     default: return 0;
     }
 }