Re: [openpgp] Possible ambiguity in description of regular expressions: [^][]

Daniel Kahn Gillmor <dkg@fifthhorseman.net> Thu, 24 December 2020 13:58 UTC

Return-Path: <dkg@fifthhorseman.net>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AC2523A1266 for <openpgp@ietfa.amsl.com>; Thu, 24 Dec 2020 05:58:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=fifthhorseman.net header.b=bI011Wyg; dkim=pass (2048-bit key) header.d=fifthhorseman.net header.b=m2U7eI3D
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 Un_hFtx-o0x9 for <openpgp@ietfa.amsl.com>; Thu, 24 Dec 2020 05:58:23 -0800 (PST)
Received: from che.mayfirst.org (che.mayfirst.org [IPv6:2001:470:1:116::7]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AEC243A1264 for <openpgp@ietf.org>; Thu, 24 Dec 2020 05:58:23 -0800 (PST)
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1608818302; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=4aUQERHdJuYV+VoLkeaYhkKMrUh5Vit93dnVxbWGwOg=; b=bI011WygkZoXBKc0Xvcw70IFGGxQgvvgDixx8ghO73gAzUmAZWQU0Nx5Qq5zPvb1s9zRs Gs/fD+sWcVw1yitDg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1608818302; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=4aUQERHdJuYV+VoLkeaYhkKMrUh5Vit93dnVxbWGwOg=; b=m2U7eI3DIsoofG0ySUzFhpn69lz454jCwz2v4SjGOgmXnS/1VzqpOQ/gEChQAGgRUcpT0 O1QOcjBWZVJwLZP5+cLqS2ieyDO4k0uCqrti4e5kKpY99goDjgU2ljMvyKHv/oIZ7Bi2Z/N ZBo8fev7779ue6oUugi4I8OzWjr20shFM6GuM1qUAPC6UU4Cp8GNHUzgmn3uQOrgsrZ9kbZ tXBPkhB+38ZXZjBxcq47wFMJcvDs1XZR02Ks0twGgFh6hTxbz0A3iALlWf1gmfnqzI8kO2M ilia3OI7iSMrq/Y9vvKQJYbBmorz3s8pA9nyxwT9bfJaPmqAKpRRLkaKMnEw==
Received: from fifthhorseman.net (unknown [108.58.6.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 4453EF9A5; Thu, 24 Dec 2020 08:58:22 -0500 (EST)
Received: by fifthhorseman.net (Postfix, from userid 1000) id 740ED20426; Thu, 24 Dec 2020 08:58:19 -0500 (EST)
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: "Neal H. Walfield" <neal@walfield.org>, openpgp@ietf.org
In-Reply-To: <87r1nguquq.wl-neal@walfield.org>
References: <87r1nguquq.wl-neal@walfield.org>
Autocrypt: addr=dkg@fifthhorseman.net; prefer-encrypt=mutual; keydata= mDMEXEK/AhYJKwYBBAHaRw8BAQdAr/gSROcn+6m8ijTN0DV9AahoHGafy52RRkhCZVwxhEe0K0Rh bmllbCBLYWhuIEdpbGxtb3IgPGRrZ0BmaWZ0aGhvcnNlbWFuLm5ldD6ImQQTFggAQQIbAQULCQgH AgYVCgkICwIEFgIDAQIeAQIXgAIZARYhBMS8Lds4zOlkhevpwvIGkReQOOXGBQJd5Hw3BQkFpJWB AAoJEPIGkReQOOXGDYEA/j0ERjPxDleKMZ2LDcWc/3o5cLFwAVzBKQHppu0Be5IWAP0aeTnyEqlp RTE7M8zugwkhYeUYfYu0BjecDUMnYz6iDLgzBF3kewUWCSsGAQQB2kcPAQEHQK1IuW0GZmcrs2mx CYMl8IHse0tMF8cP7eBNXevrlx2ZiPUEGBYIACYCGwIWIQTEvC3bOMzpZIXr6cLyBpEXkDjlxgUC XeR7TwUJAiGl/gCBdiAEGRYIAB0WIQQsv6x2UaqQJzY+dXHEDyVUMvKBDwUCXeR7BQAKCRDEDyVU MvKBD7KmAQCHs+7588C4jto6fMje0Nu97zzoppjJM7lrGF2rVnbHvwD+MgmGUbHzPSUrTWnZBQDi /QM595bxNrBA4N1CiXhs2AMJEPIGkReQOOXGpp0BAM7YeBnt/UNvxJAGm4DidSfHU7RDMWe6Tgux HrH21cDkAQC9leNFXJsQ7F2ZniRPHa8CkictcQEKPL8VCWpfe8LbArg4BF3ke5wSCisGAQQBl1UB BQEBB0Cf+EiAXtntQMf51xpqb6uZ5O0eCLAZtkg0SXHjA1JlEwMBCAeIfgQYFggAJhYhBMS8Lds4 zOlkhevpwvIGkReQOOXGBQJd5HucAhsMBQkCIaVkAAoJEPIGkReQOOXGdYcBANYnW7VyL2CncKH1 iO4Zr0IwfdIv6rai1PUHL98pVi3cAP9tMh85CKGDa0Xi/fptQH41meollLW5tLb/bEWMuUNuBQ==
Date: Thu, 24 Dec 2020 08:58:18 -0500
Message-ID: <87tusbuwzp.fsf@fifthhorseman.net>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg="pgp-sha256"; protocol="application/pgp-signature"
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/-lvxnXI4z7zStaywNecNlA_Vgak>
Subject: Re: [openpgp] Possible ambiguity in description of regular expressions: [^][]
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: Thu, 24 Dec 2020 13:58:26 -0000

Hi Neal--

nice find!  it's rather ugly, though.

the most straightforward way to resolve it seems to be to say that
sequences in a [] must be non-empty.

This means we don't get to say "[]", but that's ok because we already
have ".", which will handily replace it with the same semantics.  We
also don't get to say "[^]".  While i don't know how to replicate the
"no match" semantics, i'm also unclear where it could possibly be
useful.

Seems like a sufficient clarification would be:

-A range is a sequence of characters enclosed in '[]'.
+A range is a non-empty sequence of characters enclosed in '[]'.

Are there any implementers or users of the regex spec who see this as a
problem?

Neal, perhaps you want to formally file this as an erratum on rfc4880?

    --dkg