Re: [Dcrup] DKIM-Signing hashes with Ed25519

Jeremy Harris <jgh@wizmail.org> Wed, 14 November 2018 23:28 UTC

Return-Path: <jgh@wizmail.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 2F3CD130DFC for <dcrup@ietfa.amsl.com>; Wed, 14 Nov 2018 15:28:52 -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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=wizmail.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 s-Fdlu842Iwv for <dcrup@ietfa.amsl.com>; Wed, 14 Nov 2018 15:28:50 -0800 (PST)
Received: from wizmail.org (wizmail.org [IPv6:2a00:1940:107::2:0:0]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CE2B5130DFD for <dcrup@ietf.org>; Wed, 14 Nov 2018 15:28:49 -0800 (PST)
ARC-Seal: i=1; cv=none; a=rsa-sha256; d=wizmail.org; s=r201803; t=1542238129; b=E7ajeo4xnok+ONaMp32WXdGHQ9qNyZ+wXOjG03uHX66RDD71Hu4tQD0qo7O7G9873CwIngN4zG UvzHvgKXHHYUMqwLz5Md8PnP0Ot3J0XW0p4U0lWiEOQPvTqyYhzocJ5RZ5Ctf5KFn/C/BP5oKQ +NX4GiYJGwZsqs2lpInk1oI=;
ARC-Authentication-Results: i=1; wizmail.org; iprev=pass (vgate18.wizint.net) smtp.remote-ip=2a00:1940:107::1:2f:0; auth=pass (PLAIN) smtp.auth=jgh@wizmail.org
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=wizmail.org; s=r201803; t=1542238129; bh=FkHMFzYRUGx0lSbF/lpalML5XzRglFeC7TAlmFetfBI=; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:DKIM-Signature; b=p+1J9UTzVmrn9iaAbxjaHDrBcXM7Oc2hfKu1aWt19h+AB289CMMpMpXchu621XSQwDLeubb56k NBJtWaYyfOYIOBnr8d4P6q63SoTZNIgy1fex6k4ZxK3zMi+gdNi33ddvGDW21QwI1hwxp4WTId e8oTRb5LF59Lfmu8oxJIPKc=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=wizmail.org ; s=r201803; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:From:Sender:Reply-To: Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=aovcH0WF5QDAhacu5VT8kQt7REN2CExhIPB3knWYzqY=; b=n knxRghTGoeIEKBee2lQIyU5WWwHb4FiffkCremg8N8vnp3wCeC+2HV6J33NXJp5ok2oKrg0ScVYte e+xAB/pn7HB2//smdS4cmc8aCkAgkzFTIhSAgFsIg5zokqCKdCoPPfHOVlHVE4Eg/mHmDJUbIcAgD ry4sV+KTKypuyYvc=;
Authentication-Results: wizmail.org; iprev=pass (vgate18.wizint.net) smtp.remote-ip=2a00:1940:107::1:2f:0; auth=pass (PLAIN) smtp.auth=jgh@wizmail.org
Received: from vgate18.wizint.net ([2a00:1940:107::1:2f:0] helo=lap.dom.ain) by wizmail.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91.116) id 1gN4aV-0007m5-TY for dcrup@ietf.org (return-path <jgh@wizmail.org>); Wed, 14 Nov 2018 23:28:48 +0000
To: dcrup@ietf.org
References: <1b32eeb225568185b52691d684ea59e0b2f9f26d.camel@aegee.org>
From: Jeremy Harris <jgh@wizmail.org>
Openpgp: preference=signencrypt
Autocrypt: addr=jgh@wizmail.org; prefer-encrypt=mutual; keydata= xsBNBFWABsQBCADTFfb9EHGGiDel/iFzU0ag1RuoHfL/09z1y7iQlLynOAQTRRNwCWezmqpD p6zDFOf1Ldp0EdEQtUXva5g2lm3o56o+mnXrEQr11uZIcsfGIck7yV/y/17I7ApgXMPg/mcj ifOTM9C7+Ptghf3jUhj4ErYMFQLelBGEZZifnnAoHLOEAH70DENCI08PfYRRG6lZDB09nPW7 vVG8RbRUWjQyxQUWwXuq4gQohSFDqF4NE8zDHE/DgPJ/yFy+wFr2ab90DsE7vOYb42y95keK tTBp98/Y7/2xbzi8EYrXC+291dwZELMHnYLF5sO/fDcrDdwrde2cbZ+wtpJwtSYPNvVxABEB AAHNJkplcmVteSBIYXJyaXMgKG5vbmUpIDxqZ2hAd2l6bWFpbC5vcmc+wsB7BBMBAgAlAhsD BgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAUCVYAYBAIZAQAKCRC85YyM5B8y34iFB/9wozIY RogNdY1aejFFixb6++y4b1riyjMvWEULeEzDlQ0lMT6Z3PxXhZILD4y4aP7Kzx0ozXa5qaKy 41EAPKQoPipnRAH04QytJbIERvz8Tot/LeCVKUc0G9DVxOPBD03czTgqgz4EjV2qvnLF+rTU 0YBevrNCluKosGSd+3RvLWVu0hBhn9pELKfXJNSQXZb+TpHDhSDZ/gCrglBEOhA6YWbDb/4g z+5TFKdk+B++iAQZSHv7zISabjN+BPYgI47A+MU4JycoXaAUnMc0l5ba6fGNaIrzruE4aAZr lP5o+7mlU9Mm0QJqdqYxYPAiplJGrZv+YXH1fp5ueEK3l+NGzsBNBFWABsQBCADphLHaKToR uR/E7THerBiCjDatwCaETOKOTY2zRBQpaQ32p/F2XIGLS8Cc27+grZSKQ6ZX0ZN47O+AFyFH F8DH90IXZFpJR3Rb8zgXT8jnLX08DM31eECZHnRzFhGlOmq6WAUlqB3GKCPUCY2c4eTRXyoX LteTxrXCYoj45y/YmvlZrlonBNjPBAyHiO/LNz+V7fZtNsN7N/XGrnLbcdNfNd+SD1ENmbLJ 8RvyymxguTyB/ka9JdjHHIoQEJ6L166B3hhfCHpt8iC0GPZkti9IMl0NoJ029jJm3Jq1qEce EBn5H5QMGn6Fq64iXwTsO1TMNUwpWx8pjvV7wVIxjI8ZABEBAAHCwF8EGAECAAkFAlWABsQC GwwACgkQvOWMjOQfMt9N6Af8CS2CTrMQFdhkGEtBXmL4ifD8UHFkBRBGmM8ZL2fWUBTZXT8m rdRMOK6tcPnKWaCvWvKr0knt970j/DyAgFmH8hgOi3yctigFecVDjjilAeCJMq38s1tYKYiL DbBdHWtdkA9uHZwq3lfd3QxcEEO3QamQF+dO7h8gAOXlG+po87Hm+E0wz4swIB8+S37Jzrx9 uu0LSFDfJCTK+TIKGa5Un8LxPxyq9WnnNDh72zK7BiRidk/s40KcNod83NM4Hn/sbGfyLa8s S0F3ME0S+ocSMOiu/ZHHOiwpLYNbwTJ7stZxGsrguWeT9P+amxbA/YlK95LedstwvN+WcHZ7 d++Arg==
Message-ID: <db0f70f4-7d9c-b81e-9e57-35295eeedb19@wizmail.org>
Date: Wed, 14 Nov 2018 23:28:43 +0000
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0
MIME-Version: 1.0
In-Reply-To: <1b32eeb225568185b52691d684ea59e0b2f9f26d.camel@aegee.org>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Pcms-Received-Sender: vgate18.wizint.net ([2a00:1940:107::1:2f:0] helo=lap.dom.ain) with esmtpsa
Archived-At: <https://mailarchive.ietf.org/arch/msg/dcrup/JfOiIgvhxp_V3W1JeoQWKpanU-U>
Subject: Re: [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 23:28:52 -0000

On 14/11/2018 21:44, Дилян Палаузов wrote:
> 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.

It certainly confused me when I was implementing it for Exim.  Despite
being called "pure" it does a hash on the data, and signs the hash.
You can't sign raw data, and you can't sign a separately computed
hash.  What DKIM requires is that you precompute a sha256 hash
(just like you would for RSA-signing) and then feed it to this
(oddly-named) "pure" routine for signing.

So you get the signature of a SHA512-hash of a SHA256-hash of the
headers.  Yup, hashed twice.  No, I don't know why.

But you _can_ do it with the provided interfaces in both GnuTLS and
OpenSSL.
-- 
Cheers,
  Jeremy