Re: [Curdle] FW: New Version Notification for draft-ietf-curdle-pkix-04.txt

David Benjamin <davidben@chromium.org> Mon, 08 May 2017 18:06 UTC

Return-Path: <davidben@google.com>
X-Original-To: curdle@ietfa.amsl.com
Delivered-To: curdle@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F210F128AFE for <curdle@ietfa.amsl.com>; Mon, 8 May 2017 11:06:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.org
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 W3o1pCck--ju for <curdle@ietfa.amsl.com>; Mon, 8 May 2017 11:06:29 -0700 (PDT)
Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (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 14083128656 for <curdle@ietf.org>; Mon, 8 May 2017 11:06:29 -0700 (PDT)
Received: by mail-pf0-x22c.google.com with SMTP id m17so7533181pfg.3 for <curdle@ietf.org>; Mon, 08 May 2017 11:06:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tCwqXulTl75dFNSeFC8u2C9Ly45SHxhh7FuA4BqOu6k=; b=Vj952ujP5niAhpmSSARyKdgsALG9uQLprit8/xzXE+Eav52yDD9KGFF6AbcS/bffHh KGTHlr6HRCB0TnJt25kiQp1NAA3fwHTBxhvYKtQ46Vtktm83ZsfobAu0b3i2xKKd3r0H ZU8EKKjpujPBKqj3Sw9/ZqFtPqfioU7Qyg5/8=
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=tCwqXulTl75dFNSeFC8u2C9Ly45SHxhh7FuA4BqOu6k=; b=iOEteuQnVAVAqpVwwvld8eX8dSKfihSb0DMIAI8o6ZxBAV+QRSkv5EH93X7EWLLYgE 1Berf6XtBpj2Sbu6iP+iHh47enF9ANRZ7Z3XSjdugPlNEQ41sofYZDwDVoN/eHHRmJXJ PqbmgaQO2qeR4PWL4zFr1XwkBiJv8oyI2c25gsFfxUKFRHuVOD3ZgXEgx3cdbrQb+etj L5Pc8cdwyehscDPw4NPE9r4+rZYrh3Ok4EYJg8i2FZl3y+xug9ckr2IsZaE0RYHIvTN8 PItsWM1Me3GAPseD2LRWFDDq6vlqU1o+dS7i6CKi0Dg08HnkEEx6nl1HlGvdiOgoN/uu lQoA==
X-Gm-Message-State: AN3rC/514rZWIehvZLR7DHVAHVosm4cyQnpJkx36gVlQ6WVJffWcK0sl pTARDbg16MnjqsD5qLuQy4R9/QkuMgTFeOQ=
X-Received: by 10.98.82.77 with SMTP id g74mr20144257pfb.115.1494266788376; Mon, 08 May 2017 11:06:28 -0700 (PDT)
MIME-Version: 1.0
References: <149073663013.1172.4888065212435317707.idtracker@ietfa.amsl.com> <051401d2a80b$e9bdea90$bd39bfb0$@augustcellars.com> <CAFewVt6-0WSqmwD7xVvKWDg3P9vNpFZDqB-n61hiU9qQp1c2cw@mail.gmail.com> <006d01d2c194$0e99b280$2bcd1780$@augustcellars.com> <CAFewVt4Lj7DMuVszGD6eht-3CJY6twaOao4J6KBTq4mTnYVFUQ@mail.gmail.com> <CAF8qwaCSVLJZMfy1eZ4hF4B3TUZyEdrL3VkkeiQ6TT=5mawUNg@mail.gmail.com> <007001d2c820$6fc202a0$4f4607e0$@augustcellars.com>
In-Reply-To: <007001d2c820$6fc202a0$4f4607e0$@augustcellars.com>
From: David Benjamin <davidben@chromium.org>
Date: Mon, 08 May 2017 18:06:16 +0000
Message-ID: <CAF8qwaBHv3fYVs0DBGsEijJF2w+uo7iqTqy3stXhFasp9zRQPw@mail.gmail.com>
To: Jim Schaad <ietf@augustcellars.com>, Brian Smith <brian@briansmith.org>
Cc: curdle <curdle@ietf.org>
Content-Type: multipart/alternative; boundary="94eb2c035af01fb1f3054f071974"
Archived-At: <https://mailarchive.ietf.org/arch/msg/curdle/8E_h12kIr_Utyoy-SxyiP67LtgU>
Subject: Re: [Curdle] FW: New Version Notification for draft-ietf-curdle-pkix-04.txt
X-BeenThere: curdle@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "List for discussion of potential new security area wg." <curdle.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/curdle>, <mailto:curdle-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/curdle/>
List-Post: <mailto:curdle@ietf.org>
List-Help: <mailto:curdle-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/curdle>, <mailto:curdle-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 08 May 2017 18:06:31 -0000

On Mon, May 8, 2017 at 1:27 PM Jim Schaad <ietf@augustcellars.com> wrote:

> *From:* David Benjamin [mailto:davidben@chromium.org]
>
> *Sent:* Monday, May 1, 2017 9:15 AM
> *To:* Brian Smith <brian@briansmith.org>; Jim Schaad <
> ietf@augustcellars.com>
>
>
> *Cc:* curdle <curdle@ietf.org>
> *Subject:* Re: [Curdle] FW: New Version Notification for
> draft-ietf-curdle-pkix-04.txt
>
>
>
> On Sun, Apr 30, 2017 at 8:17 PM Brian Smith <brian@briansmith.org> wrote:
>
> In particular, I have seen PKCS#8 implementations that reject any v2
> PKCS#8 file instead of ignoring the extra fields.
>
>
>
> As the author of one such PKCS#8 implementation, I'd simply missed that v2
> PKCS#8 existed. Happy to add support (by way of ignoring the field
> probably, yeah). Lacking any useful text about what to do, I interpreted
> the version field to be analogous to RSAPrivateKey, another PKCS spec.
> There, an RFC 2437 implementation that attempted to be forwards-compatible
> (by accepting unknown versions and ignoring appended fields) would have
> been confused come RFC 3447, which decided v1 meant a
> semantically-incompatible otherPrimeInfos field.
>
>
>
> RFC 5958 continues this. It does use ASN.1 extension markers, but X.680
> merely says "The action that is taken in each situation is determined by
> the ASN.1 specifier", and RFC 5958 does not appear to say anything.
>
>
>
> Is the intent that OneAsymmetricKey parsers accept a hypothetical v3 with
> further appended fields, or should they reject those to allow for
> RFC-3447-like changes? If so, how do they handle the version <=> extra
> field correspondence? A numerical comparison? Assume all unknown values are
> newer? The version number used in the ASN.1 tags corresponds to the
> symbolic name of the version constants, rather than the numerical value, so
> it's not obvious whether, say, defining v3(-1) would be acceptable.
>
>
>
> [JLS] I had thought this was going to be an easy answer, but as I did not
> have any of my ASN.1 documents with me last week I decided to defer
> responding until I retrieved them from the backup drives.  I am happy that
> I did as what I thought was the correct answer isn’t.  I had always thought
> that the rules were that any additional fields could be ignored by a prior
> parser when evaluating the content of the decoded object.  The answer from
> the X.680 is – it depends.
>
>
>
> I guess that people are supposed to define what the correct behavior for
> this is when they put the extensibility flag into an ASN.1 structure.  We
> did not do this when we wrote the document for OneSymmetricKey and we
> should have done so.  From what we were doing, I would say that the answer
> is that all future fields can be ignored when parsing one of these
> structures.  This is the philosophy that was adopted for dealing with
> unknown attributes.  It would make sense to file an Errata to this end on
> RFC 5958 so that we can make sure that this says the expected method of
> doing thigs.
>

That works for me. What would you then say is the intended interpretation
of the version field? Going from PrivateKeyInfo to OneAsymmetricKey makes
sense to bump the version because it is arguably a semi-incompatible
change. (And, regardless, it's too late to undo that.) I would maybe argue
that future versions of OneAsymmetricKey should *not* bump the version
number. It's not clear to me it serves any purpose in this context since a
parser can't do anything useful with unknown values. So perhaps:

- When serializing without publicKey, serializing code SHOULD use v1
(PrivateKeyInfo). v2 (OneAsymmetricKey) would also work, but this will be
less compatible.
- When serializing with publicKey, serializing code MUST use v2,
- When parsing and the version is v1, parse as PrivateKeyInfo (i.e.
non-extensible and publicKey does not exist).
- When parsing and the version is v2, parse as OneAsymmetricKey. When
parsing as OneAsymmetricKey, one MUST ignore trailing fields after the
OPTIONAL publicKey.
- When parsing and the version is anything else, reject. This is some
invalid thing.

I'm also equally fine with some variant of Brian's stricter interpretation,
which effectively means removing the X.680 extensibility markers. I don't
think this is a context where extensibility is needed and, regardless,
we've already got that attributes field. (OneAsymmetricKey itself could
probably have been skipped in favor of defining a publicKey attribute.)

David