gpg: Prefer SHA-512 and SHA-384 in personal-digest-preferences.
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Wed, 3 Jan 2018 17:34:26 +0000 (12:34 -0500)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 19 Jul 2018 18:02:31 +0000 (19:02 +0100)
* g10/keygen.c (keygen_set_std_prefs): prefer SHA-512
and SHA-384 by default.

--

In 8ede3ae29a39641a2f98ad9a4cf61ea99085a892, upstream changed the
defaults for --default-preference-list to advertise a preference for
SHA-512, without touching --personal-digest-preferences.  This makes
the same change for --personal-digest-preferences, since every modern
OpenPGP library supports them all.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic update-defaults
Gbp-Pq: Name gpg-Prefer-SHA-512-and-SHA-384-in-personal-digest.patch

g10/keygen.c

index db5e635ac5c92eaae6b2b2f4f23ab263c486e199..96f451fd125314c9c0e86d1e1f8d8f3eab7b9f2b 100644 (file)
@@ -386,16 +386,16 @@ keygen_set_std_prefs (const char *string,int personal)
             if (personal)
               {
                 /* The default internal hash algo order is:
-                 *  SHA-256, SHA-384, SHA-512, SHA-224, SHA-1.
+                 *  SHA-512, SHA-384, SHA-256, SHA-224, SHA-1.
                  */
-                if (!openpgp_md_test_algo (DIGEST_ALGO_SHA256))
-                  strcat (dummy_string, "H8 ");
+                if (!openpgp_md_test_algo (DIGEST_ALGO_SHA512))
+                  strcat (dummy_string, "H10 ");
 
                 if (!openpgp_md_test_algo (DIGEST_ALGO_SHA384))
                   strcat (dummy_string, "H9 ");
 
-                if (!openpgp_md_test_algo (DIGEST_ALGO_SHA512))
-                  strcat (dummy_string, "H10 ");
+                if (!openpgp_md_test_algo (DIGEST_ALGO_SHA256))
+                  strcat (dummy_string, "H8 ");
               }
             else
               {