Home GnuPG
Diffusion GnuPG 924518b10d4d

gpg: Add option --weak-digest to gpg and gpgv.
924518b10d4dUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

gpg: Add option --weak-digest to gpg and gpgv.

* g10/options.h: Add 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.
* g10/sig-check.c: (do_check): Reject all weak digests.
* 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
unreliable.

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 always considered weak, regardless of any further
--weak-digest options supplied.

(this is a rough cherry-pick of applying the following commits to
STABLE-BRANCH-1-4:

76afaed65e3b0ddfa4923cb577ada43217dd4b18
b98939812abf6c643c752ce7c325f98039a1a9e2
91015d021b3dcbe21ad0e580a4f34c523abf9e72

)

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

Details

Provenance
dkgAuthored on Oct 27 2015, 5:01 AM
wernerCommitted on Dec 19 2015, 3:14 PM
Parents
rG43e5d28c6dba: gpg: Reject signatures made with MD5.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG924518b10d4d: gpg: Add option --weak-digest to gpg and gpgv. (authored by Daniel Kahn Gillmor <dkg@fifthhorseman.net>).Dec 19 2015, 3:14 PM