[dtn] IPN update text-form and CBOR-form parity with allocator zero

Brian Sipos <brian.sipos+ietf@gmail.com> Sat, 06 April 2024 22:12 UTC

Return-Path: <brian.sipos@gmail.com>
X-Original-To: dtn@ietfa.amsl.com
Delivered-To: dtn@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1BD90C14F5F8 for <dtn@ietfa.amsl.com>; Sat, 6 Apr 2024 15:12:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.094
X-Spam-Level:
X-Spam-Status: No, score=-2.094 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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=gmail.com
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 QVSZjaetfocz for <dtn@ietfa.amsl.com>; Sat, 6 Apr 2024 15:12:44 -0700 (PDT)
Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 45379C14F5ED for <dtn@ietf.org>; Sat, 6 Apr 2024 15:12:44 -0700 (PDT)
Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1e2bbc2048eso26214285ad.3 for <dtn@ietf.org>; Sat, 06 Apr 2024 15:12:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712441563; x=1713046363; darn=ietf.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Ug+rQ6fYeLWU1u39GPAhAh/41puSP6W53Tg3BG+uVmA=; b=Hvd+DsUHUEDz3U6SFbnpfGy/0E0kH6y+QDQaPDshqzO+kvehGch7IGwVUICn/IRTyS 7wuRjC+D/9rbVZ3f7AcX94uARZO7HfTwnP8SRA8cOI2d5LQFp6wAIh4AQzMVKHGzl2rB qCRq33U49Yv5NQNpZ0vyytFyYrGiHaY/eiU/kdXUQmwO//qRSpxcEneAATV70chWMMOD 9PyLGXdISsRbwTiDAZl9mUIPLdVwctE9KGEqgfZCLF0G2zJtoiS3OqWWmXsRqhNmvWWq Y6F4GL8pU/9zRvHmuuGP0W6Gi0J0OQWG8XmGIeyXNxT4DNpqCjKicEoQAvHUR04IIusD n3Ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712441563; x=1713046363; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ug+rQ6fYeLWU1u39GPAhAh/41puSP6W53Tg3BG+uVmA=; b=nsMmx4S9rFx/WW+LIuZjHMZOAFtZsDSfqJ/sdKnjyKAnVjCfH2afhhTbwkvmGqymzr Gd0VQFDOdVg2TRRtbsKV0xRP+MeHabyaHd/+melNnZTnWZcd+c8uSixkQb3nIkgS9DZE qgK/lMP85PAKlAoJyEKyiUO0KIosPhXmhdqQQXt+gQu4X3P2dyCEIChZRwH6+U9x1msX b6T3/qQEjyBgNiVI8caOch1bYeozV+tjibDN1kh+J+FL8GwVinMcxUxtHupQMMH2K0of sabwUc9Er7rYJ1oB7Ugc++ZwvZ46TmYWY8v3CpnwqzwPh3uWGPTsH0Ryhu4hYU105ZHB Y2SA==
X-Gm-Message-State: AOJu0YxdmS75ugRdzrL0iEVi+OpeHueGUqq+vXVXYpE1D7H50Tv+D7UN 496k+OlVFfBVg+HttZn7NGmHtEjW35CbTfc0zolql3NuE/4wzPVkP7QkMkTSXMtlUVraoyjjJsi 7KoK8hCsrc4vvDqO3iBU5uXViXUxvewm1Kcw=
X-Google-Smtp-Source: AGHT+IGbBckcFiXX3rjisFce/MWkwj3lm2QUUoGRUcc1utV00rgEJzDbtGsjOW11Px4Adr2vbPgQ0yL6nnTollUxoXI=
X-Received: by 2002:a17:90a:7289:b0:2a2:a9af:9197 with SMTP id e9-20020a17090a728900b002a2a9af9197mr3943224pjg.3.1712441563172; Sat, 06 Apr 2024 15:12:43 -0700 (PDT)
MIME-Version: 1.0
From: Brian Sipos <brian.sipos+ietf@gmail.com>
Date: Sat, 06 Apr 2024 18:12:32 -0400
Message-ID: <CAM1+-gguR8ASktZUo8i80_Fhf158d4xO9RX1m75+7Mg1DZyxSg@mail.gmail.com>
To: dtn@ietf.org
Content-Type: multipart/alternative; boundary="000000000000125a60061574df01"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dtn/lwwgRKIHRmMTGTfXp1j-NK5Obvw>
Subject: [dtn] IPN update text-form and CBOR-form parity with allocator zero
X-BeenThere: dtn@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Delay Tolerant Networking \(DTN\) discussion list at the IETF." <dtn.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dtn>, <mailto:dtn-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dtn/>
List-Post: <mailto:dtn@ietf.org>
List-Help: <mailto:dtn-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dtn>, <mailto:dtn-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 06 Apr 2024 22:12:48 -0000

Authors of ipn-update draft,
There is a nuance to the text form specified in Appendix A [1] that
prohibits a zero-valued allocator component so that the zero-allocator can
only be represented by the two-component text form. This is in contrast to
the CDDL definition in Appendix C which does allow a zero-valued allocator
component.

A side-effect of this is that there is not a one-to-one correspondence
between text-form and CBOR-form EIDs. Certainly the semantic meaning is the
same between a zero-allocator three-component form and the two-component
form, but the lack of exact correspondence means that a trivial transcoder
needs to have some special cases for this situation. This can be seen in
the discrepancy between EIDs present in Appendix B.1 vs. D.1 and B.3 vs.
D.3. It also means that not all IPN-scheme EIDs can be written in a
three-component canonical form.

Because of this, it is possible that a CBOR-to-text-to-CBOR conversion will
lose information and the output will be different than the input. This will
have implications for things that require guarantees about re-encodings
such as BPSec processing.

I think a simple change in Appendix A from

allocator-identifier = non-zero-number

to

allocator-identifier = number

will resolve this in a way that probably is compatible with existing
three-component EID codec implementations anyway.

This also calls into question the single statement in Section 8.3; there
should probably be a stronger security statement and a requirement that
implementations must preserve the component count when transcoding IPN EIDs.

Apologies for this late feedback, but I think it will avoid a subtle
security issue and potential user headaches.

- Brian S.

[1]
https://www.ietf.org/archive/id/draft-ietf-dtn-ipn-update-10.html#appendix-A