[Dcrup] DKIM-Signing hashes with Ed25519

Дилян Палаузов <dilyan.palauzov@aegee.org> Wed, 14 November 2018 21:44 UTC

Return-Path: <dilyan.palauzov@aegee.org>
X-Original-To: dcrup@ietfa.amsl.com
Delivered-To: dcrup@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 41CC6128B14 for <dcrup@ietfa.amsl.com>; Wed, 14 Nov 2018 13:44:34 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (4096-bit key) header.d=aegee.org
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qyEMDjw-91QA for <dcrup@ietfa.amsl.com>; Wed, 14 Nov 2018 13:44:31 -0800 (PST)
Received: from mail.aegee.org (mail.aegee.org [144.76.142.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1D7CB126CB6 for <dcrup@ietf.org>; Wed, 14 Nov 2018 13:44:30 -0800 (PST)
Authentication-Results: mail.aegee.org/wAELiNiO006500; auth=pass (LOGIN) smtp.auth=didopalauzov@AEGEE.ORG
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aegee.org; s=k4096; t=1542231866; i=dkim+MSA-tls@aegee.org; r=y; bh=/LxaoD1lb/fUPXoEkBuSOegW5h9TifMbnDEFz5CuhsQ=; h=Subject:From:To:Cc:Date; b=DxPDTNVFJC2GO0eMOwwX5OAX+WBg0diAr4H9+fzAhQn8qsMglygE0YdNiHlKTTHCr FWQlDYWu2BdcFF1gRLgg2Meoe+ffWM7xJA0/D0Wp8UbC/cdJRMA1Ki8bwUcYcE67IF fpWLLQq6FDvHbMeSXNHKfZaXSsVXPfqw9V20SOmjcqUGGTd9o1/qqVaC2QvgbJ3yxa YgF4s7IdDFHHf9lOO21onjQKKEUE0HRKYGpGAiQgYPbp1p+gEU97n+epIf+pndJXuE ROTGWN++cDtGSv4yb5v7ndKaXn1CGILosGG4cknOHlKOMbniZkY5l0IzEqtCa/3CJs a++6McOKljkxat3loJcbtwp6PjJmVqV9zckQEaoaje57EZeSLUZ8F8iyHX6EruoZBX 9ws/hl5Plgi7zFVk/Z9r5lJnZXHFKMSxdjY9VWC2KR6ODdN3Fkm8u4xxKaCXQfexJH 03E+rpTZbR7fFT9hwLpmPDe4zKjwwD0GvpKSzRZM/ANyopYLe4i8/axcQhpWgWl22p NDB98WWr/XLgCWh0kBrlw13akU1jIUoTDLMCGg1Tx7+D+19sg+Wy0Kk7VqVPutoCSa sacQJhl/qtpEgApUU/9CbrTJ5+i7z1YOVwxL0l7uCJls+XaTPZb+6HzmB27xzuJFyT qIwN4U5V4T4zyhOYde2c9xdw=
Authentication-Results: mail.aegee.org/wAELiNiO006500; dkim=none
Received: from Tylan (dslb-084-061-083-131.084.061.pools.vodafone-ip.de [84.61.83.131]) (authenticated bits=0) by mail.aegee.org (8.15.2/8.15.2) with ESMTPSA id wAELiNiO006500 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 14 Nov 2018 21:44:26 GMT
Message-ID: <1b32eeb225568185b52691d684ea59e0b2f9f26d.camel@aegee.org>
From: Дилян Палаузов <dilyan.palauzov@aegee.org>
To: dcrup@ietf.org
Cc: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date: Wed, 14 Nov 2018 21:44:22 +0000
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.31.2
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.100.2 at mail.aegee.org
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/dcrup/YjeiaMf0kUNvVIOmcgquju6JYZQ>
Subject: [Dcrup] DKIM-Signing hashes with Ed25519
X-BeenThere: dcrup@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DKIM Crypto Update <dcrup.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dcrup>, <mailto:dcrup-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dcrup/>
List-Post: <mailto:dcrup@ietf.org>
List-Help: <mailto:dcrup-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dcrup>, <mailto:dcrup-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Nov 2018 21:44:34 -0000

Hello,

the algoritm described in RFC 6376 “DomainKeys Identified Mail (DKIM)
Signatures” for signing a message is:

1. Normalize/Canonicalize (Section 5.3)
2. Compute hash (Section 5.5): “The Signer MUST compute the message
hash as described in Section 3.7 and then sign it using the selected
public-key algorithm.”
3. Sign the hash (Section 5.6):  “The DKIM-Signature header field MUST
be the same as used to compute the hash as described above, except that
the value of the "b=" tag MUST be the appropriately signed hash
computed in the previous step…”

This RFC describes the rsa-sha256 algorithm for signing (for the
aforementioned hash).

RFC 8463 “A New Cryptographic Signature Method for DomainKeys
Identified Mail (DKIM)” adds the Ed25519-SHA256 signing algorithm
(Section 3): “The Ed25519-SHA256 signing algorithm computes a message
hash as defined in Section 3 of [RFC6376] using SHA-256 [FIPS-180-4-
2015] as the hash-alg.  It signs the hash with the PureEdDSA variant
Ed25519, as defined in RFC 8032, Section 5.1 [RFC8032].”

At https://www.ietf.org/mail-archive/web/dcrup/current/msg00501.html is
stated, that GnuTLS does ED25519 signing of data, but not of hashed —
ED25519 is not meant for the latter.  The answer at 
https://www.ietf.org/mail-archive/web/dcrup/current/msg00502.html says,
that “if the spec says there’s a pure version that doesn’t hash its
input, the library would implement it.”

I asked at https://gitlab.com/gnutls/gnutls/issues/613 to enhance
GnuTLs to sign per RFC 8463.  The answer is, that there is a pure
EdDSA, which can sign data.  A pre-hashed-EdDSA version, which can sign
hashes, is not standardized.

Please join https://gitlab.com/gnutls/gnutls/issues/613 to explain what
signing ED25519 hashes mean and how and shall it be implemented.

Regards
  Дилян