Re: [Ietf-dkim] Question about lone CR / LF

Steffen Nurpmeso <steffen@sdaoden.eu> Sat, 03 February 2024 22:00 UTC

Return-Path: <steffen@sdaoden.eu>
X-Original-To: ietf-dkim@ietfa.amsl.com
Delivered-To: ietf-dkim@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A34EAC14F68B for <ietf-dkim@ietfa.amsl.com>; Sat, 3 Feb 2024 14:00:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aBEROwOqLkYs for <ietf-dkim@ietfa.amsl.com>; Sat, 3 Feb 2024 14:00:29 -0800 (PST)
Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 36739C14F600 for <ietf-dkim@ietf.org>; Sat, 3 Feb 2024 14:00:27 -0800 (PST)
Date: Sat, 03 Feb 2024 23:00:24 +0100
Author: Steffen Nurpmeso <steffen@sdaoden.eu>
From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: Dave Crocker <dhc@dcrocker.net>
Cc: John R Levine <johnl@taugh.com>, ietf-dkim@ietf.org
Message-ID: <20240203220024.WkBcJTkt@steffen%sdaoden.eu>
In-Reply-To: <117c5879-7255-43cb-bfee-2ca9413be4d5@dcrocker.net>
References: <20240202043446.AAF26820F0AD@ary.qy> <52b5c2f3-e52f-403f-becf-813bbaf7b870@bbiw.net> <479a6ba4-db35-0305-a1bb-03dc1c9ec722@taugh.com> <46b0e4e6-898a-4ab3-a51c-cc54abb14891@bbiw.net> <117c5879-7255-43cb-bfee-2ca9413be4d5@dcrocker.net>
Mail-Followup-To: Dave Crocker <dhc@dcrocker.net>, John R Levine <johnl@taugh.com>, ietf-dkim@ietf.org
User-Agent: s-nail v14.9.24-596-g7894190075
OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt
BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs.
Archived-At: <https://mailarchive.ietf.org/arch/msg/ietf-dkim/VrKPhRtA9zb8K05NnEXGjS8DAM8>
Subject: Re: [Ietf-dkim] Question about lone CR / LF
X-BeenThere: ietf-dkim@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: IETF DKIM List <ietf-dkim.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf-dkim>, <mailto:ietf-dkim-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ietf-dkim/>
List-Post: <mailto:ietf-dkim@ietf.org>
List-Help: <mailto:ietf-dkim-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf-dkim>, <mailto:ietf-dkim-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 03 Feb 2024 22:00:31 -0000

Dave Crocker wrote in
 <117c5879-7255-43cb-bfee-2ca9413be4d5@dcrocker.net>:
 |On 2/3/2024 11:29 AM, Dave Crocker wrote:
 |> DKIM is not a general message parsing engine
 |
 |btw, one might imagine a parsing engine that mixes a number of 
 |functions, such as general message parsing AND DKIM validation.
 |
 |For such an engine, where a bare CR or bare LF might be illegal -- 
 |though it now appears they aren't -- the error to raise is for the 
 |general message processing, not for DKIM.
 |
 |This nicely demonstrates the importance of distinguishing between the 
 |abstractions needed for public networking specifications, from various 
 |local implementation choices a programmer might make.

I want to remark that my original question, if i recall correctly,
was whether a lone CR or LF shall be treated as whitespace, or
not.  Because relaxed DKIM parsing normalizes adjacent whitespace.
But CR and LF are not WSP, only CRLF is.

The RFC 5322 parser i have written simply skips over such as
whitespace, but the little DKIM thing must either treat them as
literal bytes (what i have done now), or as "invalid" whitespace
(what i was and am inclined to do, practically).

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)