Authored by dkg on Oct 19 2015, 12:15 AM.



From ff0d1b5fb9a5c9de7108a12d13d4eafd59a8b41a Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Sun, 18 Oct 2015 16:12:20 -0400
Subject: [PATCH] Enable deprecation of specific digest algorithms for gpg and

  • g10/options.h: add additional_weak_digests linked list to opts.
  • g10/main.h: declare weakhash linked list struct and additional_weak_digest() function to insert newly-declared weak digests into opts.
  • g10/misc.c: (additional_weak_digest): new function. (print_digest_algo_note): check for deprecated digests; use proper gcry_md_algos type.
  • g10/sig-check.c: (do_check): reject weak digests in addition to MD5.
  • g10/gpg.c: add --weak-digest option to gpg
  • doc/gpg.texi: document gpg --weak-digest option
  • g10/gpgv.c: add --weak-digest option to gpgv
  • doc/gpgv.texi: document gpgv --weak-digest option

gpg and gpgv treat signatures made over MD5 as unreliable, unless the
user supplies --allow-weak-digests to gpg. Signatures over any other
digest are considered acceptable.

Despite SHA-1 being a mandatory-to-implement digest algorithm in RFC
4880, the collision-resistance of SHA-1 is weaker than anyone would
like it to be.

Some operators of high-value targets that depend on OpenPGP signatures
may wish to require their signers to use a stronger digest algorithm
than SHA1, even if the OpenPGP ecosystem at large cannot deprecate
SHA1 entirely today.

This changeset adds a new "--weak-digest DIGEST" option for both gpg
and gpgv, which makes it straightforward for anyone to treat any
signature or certification made over the specified digest as

This option can be supplied multiple times if the operator wishes to
deprecate multiple digest algorithms, and will be ignored completely
if the operator supplies --allow-weak-digests (as before).

MD5 is still always considered weak, regardless of any further
--weak-digest options supplied.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

doc/gpg.texi | 17 ++++++++++++++---
doc/gpgv.texi | 8 ++++++++
g10/gpg.c | 6 ++++++
g10/gpgv.c | 5 +++++
g10/main.h | 7 +++++++
g10/misc.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++---
g10/options.h | 1 +
g10/sig-check.c | 11 +++++++----
8 files changed, 96 insertions(+), 10 deletions(-)


Test Plan

Diff Detail

Lint Skipped
Unit Tests Skipped