Re: [Trans] v2 SCTs and v1 SCTs distinguishability

Ryan Sleevi <ryan-ietf@sleevi.com> Thu, 12 August 2021 20:55 UTC

Return-Path: <ryan.sleevi@gmail.com>
X-Original-To: trans@ietfa.amsl.com
Delivered-To: trans@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 796453A4975 for <trans@ietfa.amsl.com>; Thu, 12 Aug 2021 13:55:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.646
X-Spam-Level:
X-Spam-Status: No, score=-1.646 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
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 FFSi5RFm8Whb for <trans@ietfa.amsl.com>; Thu, 12 Aug 2021 13:55:54 -0700 (PDT)
Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 DB7783A4971 for <trans@ietf.org>; Thu, 12 Aug 2021 13:55:54 -0700 (PDT)
Received: by mail-pj1-f46.google.com with SMTP id nt11so11941255pjb.2 for <trans@ietf.org>; Thu, 12 Aug 2021 13:55:54 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hPHwprmbmjLlEWXXXTe8TxxneZLAllNHLxN+XOrgig0=; b=aoU5CbmadgzqNV2rSR1qAIEMTUX3XdLbgB9fZ9ZQqSTTYCkaqKBKukbIQw7X8oZlg0 ACWfpMc9Vh8soCi+WS5JUOWGX/7JPTVR6FdQIMmFhFUZyiQDVnxbVVdNrxfVvKMVbFNR /ZkXyL+gGVIJBnpesBq+H6D414GPGK5B8y/6IC4OQ4wN8qn8fd0ZKyduvPYjO4jF7gVX YmccbRGGNXVdzNV/zwNLz51jqKwdJu42xrzFsRdh6SfChmwgxeFQ390Arm7c20fkOvmI nb1FpH7quoH2iiVd14Bb+yiuhMmEdSHWydi0VNk84j0p55Ua9N1xffqFYlJ2pg1pMPct HeYw==
X-Gm-Message-State: AOAM531wlrm4OJeZxI7aB7oAP2DalQxbEMrdbPhryboR5kmr+eqTDe9w JdlZunM1WaLNBiHPZJsx22ZBd6mmcfI=
X-Google-Smtp-Source: ABdhPJyh2cOsL3brOk3OGkzGa8PdjqIm8eecLmX2mbXqFV/ndSjZpRGnNEY73kata6CvszW2ep7kzg==
X-Received: by 2002:a63:6983:: with SMTP id e125mr5485826pgc.389.1628801754062; Thu, 12 Aug 2021 13:55:54 -0700 (PDT)
Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com. [209.85.216.48]) by smtp.gmail.com with ESMTPSA id x19sm4442985pfo.40.2021.08.12.13.55.53 for <trans@ietf.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Aug 2021 13:55:53 -0700 (PDT)
Received: by mail-pj1-f48.google.com with SMTP id 28-20020a17090a031cb0290178dcd8a4d1so9050609pje.0 for <trans@ietf.org>; Thu, 12 Aug 2021 13:55:53 -0700 (PDT)
X-Received: by 2002:a05:6a00:124b:b029:358:fcd2:fa37 with SMTP id u11-20020a056a00124bb0290358fcd2fa37mr5782960pfi.35.1628801753472; Thu, 12 Aug 2021 13:55:53 -0700 (PDT)
MIME-Version: 1.0
References: <1bb0f57710cdf3967fc23a7b8c7e859d@airmail.cc> <157A1E67-8C74-4209-B64E-17F39EEF1524@akamai.com>
In-Reply-To: <157A1E67-8C74-4209-B64E-17F39EEF1524@akamai.com>
From: Ryan Sleevi <ryan-ietf@sleevi.com>
Date: Thu, 12 Aug 2021 16:55:42 -0400
X-Gmail-Original-Message-ID: <CAErg=HHp5AJjSYB87Rq3WcDWj9iMu43D+hjstDpAf8hHGffwZw@mail.gmail.com>
Message-ID: <CAErg=HHp5AJjSYB87Rq3WcDWj9iMu43D+hjstDpAf8hHGffwZw@mail.gmail.com>
To: "Salz, Rich" <rsalz=40akamai.com@dmarc.ietf.org>
Cc: "trains@airmail.cc" <trains@airmail.cc>, "trans@ietf.org" <trans@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000ece30105c962f504"
Archived-At: <https://mailarchive.ietf.org/arch/msg/trans/me_Q3QxbKb-FazDNymlRB7CrfwI>
Subject: Re: [Trans] v2 SCTs and v1 SCTs distinguishability
X-BeenThere: trans@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Public Notary Transparency working group discussion list <trans.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/trans>, <mailto:trans-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/trans/>
List-Post: <mailto:trans@ietf.org>
List-Help: <mailto:trans-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/trans>, <mailto:trans-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Aug 2021 20:56:00 -0000

On Thu, Aug 12, 2021 at 4:22 PM Salz, Rich <rsalz=
40akamai.com@dmarc.ietf.org> wrote:

> I think you are confusing the bytes on-the-network compared.
>
> >So v1 SCTs and v2 structures both still have zero as the first byte,
> unless you change v2 to reserve the range 0x0000 to 0x00FF, not just
> 0x0000.
>
> In the network representation, yes, but not when it's in internal/native
> format.
>

I'm not sure I understand this remark, Rich, but it may be PEBKAC on my
part.

The issue being discussed, if I understand correctly is perhaps best
demonstrated through
https://github.com/google/certificate-transparency-rfcs/commit/ddaff4fc87cb52bbcb84891abec6cdac371d2935

Namely, early on, we distinguished an RFC 6962 SignedCertificateTimestamp (
https://datatracker.ietf.org/doc/html/rfc6962#section-3.2 ) from a 6962-bis
TransItemV2 through the use of the "placeholder" struct - TransItem. The
only overlap a TransItem and a SignedCertificateTimestamp have is the
'version' field, which is a u8 field - 0..255.

6962-bis originally specified a new version v2(1), which indicated the
presence of the completely different fields in a TransItem from those of a
v1(0) SignedCertificateTimestamp.

Following version in 6962's SignedCertificateTimestamp is a LogID (a 32
byte array), while in 6962-bis was the field TransType, a u8 field.

With
https://github.com/google/certificate-transparency-rfcs/commit/919489291b7c9556d70e91e830045d54f7441f1f
, TransType and Version were folded into a u16 field. As a consequence, the
first byte in a 6962 SCT (the "version") no longer distinguishes a 6962-bis
TransItem (the "VersionedTransType"), because a v1 client attempting to
read a byte sequence will read a 0x00 from the network (indicating a v1
SCT), even if the actual enum value is 0x0001

That said, I'm struggling to think that this actually matters, due to the
fact that the TransItem is no longer presented the same as the
SignedCertificateTimestamp - that is, as discussed in
https://www.ietf.org/archive/id/draft-ietf-trans-rfc6962-bis-41.html#name-presenting-scts-inclusions-
, these are conveyed through separate TLS extension (transparency_info), as
well as new X.509 and OCSP extensions (
https://www.ietf.org/archive/id/draft-ietf-trans-rfc6962-bis-41.html#name-transparency-information-x5
), so this overlap in "how to interpret first byte" is no longer relevant.

Is that what you were trying to convey? Did I bodge something?