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

Dave Crocker <dcrocker@bbiw.net> Mon, 05 February 2024 16:50 UTC

Return-Path: <dcrocker@bbiw.net>
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 0F441C14F5EE for <ietf-dkim@ietfa.amsl.com>; Mon, 5 Feb 2024 08:50:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.105
X-Spam-Level:
X-Spam-Status: No, score=-2.105 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=bbiw.net header.b="Ywf3e4rQ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="kjgI7pqJ"
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 kjzRVkQHLO0L for <ietf-dkim@ietfa.amsl.com>; Mon, 5 Feb 2024 08:50:44 -0800 (PST)
Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 57A0BC14F60D for <ietf-dkim@ietf.org>; Mon, 5 Feb 2024 08:50:44 -0800 (PST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 314C03200AD9; Mon, 5 Feb 2024 11:50:41 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 05 Feb 2024 11:50:41 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bbiw.net; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1707151840; x=1707238240; bh=2sOg6GFq9Q B2q5AVFtLacG8zRY74Spo0N8iWnv5sCK8=; b=Ywf3e4rQgWj/OtV46azCpn8XgE mgRjaukYOZFFVqQSWdBifLU+QLQvbJkx7vVwlj1LxoVtHorZ8HR1B76GQZ/cOd4e 9HbuRT3wq+z2bOZyD5rVrjtkyjhnHzUhuTBWy8Svod0I2feAGau+e1n+xeBDSNLz U37lVre57+JAaPCSmMYcdhLaCDEW5GQ7HIyUjRJVamkgh5va4ETDoWDBTCLSM9uN r+WYupjD47uAVHr2E5zSbR31tCBx8Q43RrxIEZpfz8Cn+KCAz6nyohNujrYNVzNZ BkqET8pPoraSUp8EHCnGUh4aYr0biUYtzJShbLiDDTyuICaBXt5Aeg9R5a2w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1707151840; x=1707238240; bh=2sOg6GFq9QB2q5AVFtLacG8zRY74 Spo0N8iWnv5sCK8=; b=kjgI7pqJTI2KaNOFYjFaz3Uq8rp6+8i/4ANxKAIW8OJ3 vM+xCc+kUcEnbLLNk4CwfWgJne7n26yJ8c34d3Q/28LhaCbZwFH3BbOU/EFTgG9D ne62VAK2rXAKoAQQksyGS8PlcdSnnlSATsKOqOLFxo2HplcX49I4ilqSSjvdUvyc LmKk6vl/UWuTJfye/0GuDUkFn+wAABFUxgx4Z1XgQUazQJKzGiwNwg5/sMLFDwAm j2/d8E+j7SKpBe1mqPNnOXvJ8UE/anqzbDdako/h90bms/8A62YTikwIQbNt2TuS Miau/sy37rcru+p5+0f+wk7F2BWuJpJzLjCUwH1Ssw==
X-ME-Sender: <xms:4BHBZa-F2gwuKwf5-43rIDHXCy-4047Um9r63LIMGD2z9VFgcuGLJQ> <xme:4BHBZatBcBSmFChWppZItijdRyduP07dlqntcthkbxOfgaRT-5uQ-DEZ8UMR2f8k5 81w0NqCyvtvINpvOw>
X-ME-Received: <xmr:4BHBZQDwz1kvHNCESxqQ3iyQ231LKtegPja9Tz0z82BjYbAJu8Dh0LVpY82ziYf4XLGcyh8ab9d5w45gebp_kJbQvCUzCGyzS6EDWe_V>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedvuddgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegtkfffgggfuffvvehfhfhojgesrg dtreertddvjeenucfhrhhomhepffgrvhgvucevrhhotghkvghruceouggtrhhotghkvghr segssghifidrnhgvtheqnecuggftrfgrthhtvghrnhepvefhgeefleelffdvgeegueehke euleegffetveduvddvteetkeeifeevhefgleehnecuffhomhgrihhnpegssghifidrnhgv thenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegutg hrohgtkhgvrhessggsihifrdhnvght
X-ME-Proxy: <xmx:4BHBZSecDJTezAiWxRzGYckTb-jdmhsUODpUQf8Zc9-8y2jzsrr51A> <xmx:4BHBZfNK4V8cwarA2vizJ4QV6b4lTVKJZXC2DBXyYlzqGWhKtB-DXQ> <xmx:4BHBZcnXLY9tDeMUsfEwjiEuPo7EEKjlk9hNImTe1svvEPfc6KHE0w> <xmx:4BHBZRUNK5LNmrYT5Hp4LuNuIF90gGRu3kdJD4-e3AMS6DCLtB64aw>
Feedback-ID: i16d9478d:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Feb 2024 11:50:40 -0500 (EST)
Content-Type: multipart/alternative; boundary="------------h0waZAIJ12HskxKIbTFz07jG"
Message-ID: <663ff8e7-4a6f-4ce4-965f-52bdfe8bb090@bbiw.net>
Date: Mon, 05 Feb 2024 08:50:40 -0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "Murray S. Kucherawy" <superuser@gmail.com>
Cc: ietf-dkim@ietf.org
References: <20240202043446.AAF26820F0AD@ary.qy> <f9c11d1a-7799-4946-b95e-7c9c682d60ba@dcrocker.net> <CAL0qLwZyXV11ZeULceA5sQbStky4ashJgBVmr_=8vaKZkykSiQ@mail.gmail.com>
From: Dave Crocker <dcrocker@bbiw.net>
Organization: Brandenburg InternetWorking
In-Reply-To: <CAL0qLwZyXV11ZeULceA5sQbStky4ashJgBVmr_=8vaKZkykSiQ@mail.gmail.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ietf-dkim/uH5ODLjXLjpeapD-WXX9Uus94VI>
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: Mon, 05 Feb 2024 16:50:49 -0000

On 2/3/2024 1:13 PM, Murray S. Kucherawy wrote:
> I generally agree with the idea that there's a layering problem here, 
> i.e., that a DKIM filter should be able to safely presume that its 
> input will comply with RFC5322 and not alter the message at all other 
> than adding the signature.  But on review, it seems like I've tiptoed 
> over that line from time to time in support of robustness in some form 
> or another.  For instance:

The 'problem' is the difference between the abstract networking 
architecture, which can -- and for DKIM does -- have clean interfaces, 
versus software implementation that might have all sorts of local 
optimizations for efficiency, robustness, or the like.(*)

Keeping very clear about this difference is how we can get a simple, 
correct standards specification that permit the widest reasonable range 
of implementation choices.

The only danger in local optimizations is that they might embed requires 
on the world outside of DKIM that won't be remembered if/when that 
outside world changes.  (I'm sure /you/ wouldn't be guilty of that, of 
course, but most of us aren't from Canada.)


> OpenDKIM will not sign a message that fails basic RFC5322 header 
> checks (e.g., "From" or "Date" is missing), but will place an 
> Authentication-Results field indicating the message is malformed.  At 
> some point, though, someone talked me into making it possible to 
> bounce such a message in the filter.  I wish I could remember the full 
> context.

So you are enforcing an RFC5322 requirement for From and Date to be 
present, although the DKIM spec only requires signing From.

Why are you doing that?

Imagine RFC5322++ removes the requirement for Date. (In fact I had not 
remembered Date is required, going all the way back to RFC733. sigh.)  
That requires remembering and changing DKIM code.

I understand the desire to do this extra checking, but not the 
justification for giving in to it, inside DKIM.


> It also allows for specification of things that are likely to be 
> rewritten downstream (e.g., address canonicalization), which it can 
> then simulate when computing its hashes, in order to make validation 
> of the signature at the verifier more likely to succeed.[*]

"likely to be rewritten downstream" is clearly part of local 
implementation design choices.

While possibly quite reasonable to make for the implementation, they 
have nothing to do with the standards specification, other than to 
encourage writing standards that neither require nor inhibit such choices.

d/


(*) Lon ago, Knuth visited UCLA when I was there, and 'structured 
programming' was a hot topic.  He did a presentation to test a 
perspective that he later wrote up.  He observed that fully structured 
programs, without gotos, could sometimes make code /worse/.  He shows 
some code without any gotos that was correct but extremely difficult to 
read and understand.  Then he showed a version, with two loops -- one 
after the other -- and inside each was a goto into the other.  OMG.  But 
this code was clear, concise and easy to understand.

-- 
Dave Crocker
Brandenburg InternetWorking
bbiw.net
mast:@dcrocker@mastodon.social