[openpgp] Deprecating SHA1

"Neal H. Walfield" <neal@walfield.org> Fri, 23 October 2020 12:51 UTC

Return-Path: <neal@walfield.org>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost []) by ietfa.amsl.com (Postfix) with ESMTP id A06EB3A0AC3 for <openpgp@ietfa.amsl.com>; Fri, 23 Oct 2020 05:51:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([]) by localhost (ietfa.amsl.com []) (amavisd-new, port 10024) with ESMTP id yTQCMoK34Q4o for <openpgp@ietfa.amsl.com>; Fri, 23 Oct 2020 05:51:15 -0700 (PDT)
Received: from mail.dasr.de (mail.dasr.de []) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AC66A3A0ABE for <openpgp@ietf.org>; Fri, 23 Oct 2020 05:51:15 -0700 (PDT)
Received: from pd9e79cc0.dip0.t-ipconnect.de ([] helo=forster.huenfield.org) by mail.dasr.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from <neal@walfield.org>) id 1kVwXF-0002gC-EZ for openpgp@ietf.org; Fri, 23 Oct 2020 12:51:09 +0000
Received: from grit.huenfield.org ([] helo=grit.walfield.org) by forster.huenfield.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <neal@walfield.org>) id 1kVwXE-0005TX-R9 for openpgp@ietf.org; Fri, 23 Oct 2020 14:51:09 +0200
Date: Fri, 23 Oct 2020 14:51:08 +0200
Message-ID: <87sga5xg03.wl-neal@walfield.org>
From: "Neal H. Walfield" <neal@walfield.org>
To: "openpgp@ietf.org" <openpgp@ietf.org>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/26 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset="US-ASCII"
X-SA-Exim-Mail-From: neal@walfield.org
X-SA-Exim-Scanned: No (on forster.huenfield.org); SAEximRunCond expanded to false
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/Rp-inhYKT8A9H5E34iLTrc9I0gc>
Subject: [openpgp] Deprecating SHA1
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 23 Oct 2020 12:51:18 -0000


I'm turning to this mailing list to seek advice about how to deal with
SHA1-based self signatures.  I have two concrete questions, which are
at the bottom of the email.  But first, I want to present the concrete
problem and my thoughts so far.

Based on the "SHA-1 is a Shambles" paper [1] we decided to change
Sequoia to reject signatures that use SHA1 by default [2].  This
includes both signatures over data, as well as self signatures of all
kinds including primary key binding signatures (aka backsigs).

  [1] https://sha-mbles.github.io/
  [2] https://docs.sequoia-pgp.org/sequoia_openpgp/policy/struct.StandardPolicy.html#method.reject_hash_at

A Secure Drop developer recently contacted us, and indicated that our
policy was too strict: some of the Secure Drop installations have
offline keys that use SHA1, and the users have no easy way (or lack
the will) to update those keys.

This prompted me to investigate the use of SHA1 in general.
Unfortunately, it appears that many actively used certificates from
technically sophisticated users still rely on SHA1.  The results of my
investigation are here:


First, I found that Microsoft's "Security Notifications PGP Key" [3],
which was created less than a year ago (Oct 2019) uses SHA-1.  Given
the use of the preferred-email-encoding@pgp.com notation, I suspect
that they are using a Symantec PGP product.

  [3] https://www.microsoft.com/en-us/msrc/pgp-key-security-notifications

Looking at the Debian Keyring, I found that:

  - 106 of the 884 certificate (12%) use SHA1 for all User ID binding
    signatures and direct key signatures

  - 63 more (7%) use SHA1 to protect at least one non-revoked User ID.

  - 234 have a non-revoked, live signing capable subkey

    - 19 of those have binding signatures that use SHA1 in some way

    - 9 use something stronger for the subkey binding signature, but
      SHA1 for the backsig.  (This appears to be a bug in GnuPG, which
      I reported [4].)

  [4] https://dev.gnupg.org/T5110

As Debian Developers are perhaps the most sophisticated OpenPGP users,
this is pretty damning.

For Arch developers, the situation is worse: 2 of the 5 master ("CA")
keys rely on SHA1.  Of the 72 developer keys, 26 (36%) use SHA1 for
all User ID self signatures and direct key signatures.  Of the 46
remaining certificates, 2 use SHA1 for a non-revoked, live
signing-capable subkey.

Looking at the Fedora Project's signing Keys [5]: all 7 use SHA1
exclusively.  When I spoke with the person responsible for this
infrastructure, we discovered that this was due to a configuration
error, which they promptly fixed.

  [5] https://getfedora.org/static/fedora.gpg

Given these results, we decided to reevaluate our bad listing of SHA1.
As the SHA1 paper indicates that SHA1's preimage resistance is not
broken, I thought that we might be able to accept SHA1 for self
signatures, and not for documents [6].  But, Azul pointed out [7] that
Mallory could create a collision for a document and a self-signature,
and then convince Alice to sign the document.  This could work in
practice because Mallory can predict everything in the signature, but
the timestamp, and if Alice is an automated signing service, there is
a good chance that Mallory would be able to get Alice to sign the
document at the right time.

  [6] https://gitlab.com/sequoia-pgp/sequoia/-/issues/595
  [7] https://gitlab.com/sequoia-pgp/sequoia/-/issues/595#note_433768966

If the signature included a salt, Mallory would have had a much harder
time coercing Alice to sign the document with the right metadata.  As
such, we plan to include a salt in all signatures that Sequoia makes
so that should, say, SHA256 suffer the same fate as SHA1, we can still
rely on preimage resistance to allow us to continue to accept self
signatures that use SHA256 for a while [8].

  [8] https://gitlab.com/sequoia-pgp/sequoia/-/issues/597

So, two questions:

  - Does anyone see a safe way to accept SHA1 self-signatures today?
    Or (ouch!), if we want to be safe, do we have to convince ~10% of
    the sophisticated OpenPGP users to re-sign or regenerate their

  - What do people think about including a salt in the hash to make
    the content of the hash less predictable as described in [7]?


:) Neal