Re: [Cbor] draft-ietf-cbor-network-addresses: tag validity; deterministic encoding

Brian E Carpenter <brian.e.carpenter@gmail.com> Sat, 09 October 2021 02:55 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2CD8E3A0FCF for <cbor@ietfa.amsl.com>; Fri, 8 Oct 2021 19:55:36 -0700 (PDT)
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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, 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=pass (2048-bit key) header.d=gmail.com
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 wy3vEXOI4tQx for <cbor@ietfa.amsl.com>; Fri, 8 Oct 2021 19:55:31 -0700 (PDT)
Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9E79B3A0FD0 for <cbor@ietf.org>; Fri, 8 Oct 2021 19:55:31 -0700 (PDT)
Received: by mail-pl1-x62d.google.com with SMTP id 21so1124784plo.13 for <cbor@ietf.org>; Fri, 08 Oct 2021 19:55:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=74KNGUneqTJweMzDVXNC3w1rPkJsheZ20MgeAMHc+aQ=; b=pXypLB8rAFJkF/92njMJ/v6tE8vyV9A/L7E7e1XNCs+jSC+kFpbR+uXmuFRhKf58m2 F6YzBt/Ygjg7W220DpPPhaCoZD5t8DsaqN+1hjZVWhRAfcJMXhreuGMBdtR65unhUgAP 5AhkVQTSjfewHDDgvkI3SMpNKMkaUd2KHe9v0L+MhYkbSUt8teK+nl5lnLYDlPI+uLJo naapkh3YHAe/nnQJdYA0AcsNtimF1NK3qTHT3RquU1EHoZ1rNowRhytsVTFCPFRrGCN3 Trk1gXM6KLAvFNTg22c7cisqnEAglVzRcOBT9iHI/0J2zdoZD8drNVLX1oRytfeTIB+K l9CQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=74KNGUneqTJweMzDVXNC3w1rPkJsheZ20MgeAMHc+aQ=; b=T9bdbd3bSJsrZLyssXGgCCVTrscE1cPOonef/0nvWdFt8s2/OyZHotQ/GaF+YsgSlH w8miSpLwrne6Yguw2BmhSWQlE+gvxGcmuYMrC8MPHSEIXrMI86rpVucMlWcE1alFLc5J hDSiKztIgsOwzBJ7bpv+npxMBLUrQq2UNmopjwDsk8xPTKE1WARAVqON081DsuCXdUdl tiXqpArzMV94Z3mZh31sqi9cZDvBiesHeBIw5nqjq3JSxsA1svGi0yFV6v/pqhvrBdTJ 911uarCu4HQcrNiAVeZuhjchR1ynMlj7YCczqhvmKTZv6U+gjNtuIjiGVntfwGdvp0ut KBmg==
X-Gm-Message-State: AOAM531PUFD5s/vE1XszQF/79rc8BB4UXhlNSLbWC/QEYnK4dHl2lWCi Lhx/CvI109IEKtN+ftAjXKXN9DFJ7sk0ag==
X-Google-Smtp-Source: ABdhPJxsif/H9rJ1d6tHr75yXuUXqSdWCEAz/Abxd+/0XQMjYluzQ9r+IBmGcPaqlOGFOqkslJc7vQ==
X-Received: by 2002:a17:902:bb81:b0:12d:a7ec:3d85 with SMTP id m1-20020a170902bb8100b0012da7ec3d85mr12911850pls.17.1633748130528; Fri, 08 Oct 2021 19:55:30 -0700 (PDT)
Received: from ?IPv6:2406:e003:1018:b901:db7:d041:a2d:ce65? ([2406:e003:1018:b901:db7:d041:a2d:ce65]) by smtp.gmail.com with ESMTPSA id c192sm566184pfb.110.2021.10.08.19.55.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Oct 2021 19:55:29 -0700 (PDT)
To: Carsten Bormann <cabo@tzi.org>
Cc: cbor@ietf.org, Michael Richardson <mcr+ietf@sandelman.ca>
References: <891995AA-2854-431E-9242-98FFCDA5E161@tzi.org> <dab25fe3-43c4-865e-2c7a-54b24340c295@gmail.com> <5CC4E130-6061-4EC8-A259-BA782BB131C7@tzi.org>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Message-ID: <c083753e-0115-2941-ea41-b10410ad93bb@gmail.com>
Date: Sat, 09 Oct 2021 15:55:26 +1300
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0
MIME-Version: 1.0
In-Reply-To: <5CC4E130-6061-4EC8-A259-BA782BB131C7@tzi.org>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/5G04dp08E-srmoV15Fc680EhltE>
Subject: Re: [Cbor] draft-ietf-cbor-network-addresses: tag validity; deterministic encoding
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Oct 2021 02:55:36 -0000

On 09-Oct-21 12:07, Carsten Bormann wrote:
> On 9. Oct 2021, at 00:40, Brian E Carpenter <brian.e.carpenter@gmail.com> wrote:
>>
>> I think 'recommendation' is a bit strong.
> 
> It’s just “A recommendation” :-)
> 
> Better text that achieves “do this if you don’t know what you are doing” without insulting the reader gladly appreciated.

Oh, we can certainly let this slide. Indeed, my code does expand the bytes object out to 4 or 16 bytes. The spec is fine and entirely implementable in Python3, which is what I wanted to check.

Not midnight here, just Saturday afternoon so maybe this was not the best 
use of my time, but I had to re-debug my code. It took me a while to realise that with one module using cbor.py calling another one using cbor2.py, the tag handling is slightly different. It's not good if one module thinks the type is cbor.cbor.Tag and the other thinks it's cbor.CBORTag.

   Brian