Re: [apps-discuss] [pkix] PKIX text encodings

Paul Hoffman <paul.hoffman@vpnc.org> Sat, 28 January 2012 04:29 UTC

Return-Path: <paul.hoffman@vpnc.org>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B1BC621F8508; Fri, 27 Jan 2012 20:29:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.554
X-Spam-Level:
X-Spam-Status: No, score=-102.554 tagged_above=-999 required=5 tests=[AWL=0.045, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a--o+5S0Gyju; Fri, 27 Jan 2012 20:29:30 -0800 (PST)
Received: from hoffman.proper.com (IPv6.Hoffman.Proper.COM [IPv6:2605:8e00:100:41::81]) by ietfa.amsl.com (Postfix) with ESMTP id 2DA4A21F84FF; Fri, 27 Jan 2012 20:29:30 -0800 (PST)
Received: from [10.20.30.103] (50-0-66-4.dsl.dynamic.fusionbroadband.com [50.0.66.4]) (authenticated bits=0) by hoffman.proper.com (8.14.5/8.14.3) with ESMTP id q0S4TRt7084777 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 27 Jan 2012 21:29:28 -0700 (MST) (envelope-from paul.hoffman@vpnc.org)
Mime-Version: 1.0 (Apple Message framework v1251.1)
Content-Type: text/plain; charset="iso-8859-1"
From: Paul Hoffman <paul.hoffman@vpnc.org>
In-Reply-To: <201201280037.q0S0bjqe004577@fs4113.wdf.sap.corp>
Date: Fri, 27 Jan 2012 20:29:27 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <6A5293F6-83A7-48CB-BAA6-FF85F0D6A903@vpnc.org>
References: <201201280037.q0S0bjqe004577@fs4113.wdf.sap.corp>
To: mrex@sap.com
X-Mailer: Apple Mail (2.1251.1)
Cc: simon@josefsson.org, apps-discuss@ietf.org, pkix@ietf.org
Subject: Re: [apps-discuss] [pkix] PKIX text encodings
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 28 Jan 2012 04:29:30 -0000

On Jan 27, 2012, at 4:37 PM, Martin Rex wrote:

> Paul Hoffman wrote:
>> 
>> Martin Rex wrote:
>>> 
>>> the Label that is used within '-----BEGIN <some-label>----'
>>> should be ignored on the receiver side, and all implemented formats
>>> should be tried, that are applicable for the requested operation.
>> 
>> This would cause things like private keys and public keys to be mixed up.
> 
> Not necessarily.  If your ASN.1 decoder can not distinguish your private
> from your public key, then you have a whole different kind of problem.

Indeed, but it is a new problem that you probably didn't plan for. There is no need to introduce the problem at this late date.

>> I propose this is not a good idea from a security perspective.
> 
> Huh?  That textual label is not integrity protected in any way,
> so how should this be a security problem?

These blobs are often handed around out-of-band, so removing a bit of information can indeed introduce a security problem.

> This is really only about convenience for admins.

That's one view, but not the only one.

>> Instead, Simon might add some text saying that some applications
>> sometimes ignore the label in order to be more liberal, but in doing
>> so can cause problems with systems that assume those labels are important.
> 
> HUH?  How could being liberal on *INPUT* possibly cause problems?
> 
> Any reasonable ASN.1 decoder can reliably tell apart
>  - X.509 certificates
>  - private keys
>  - encrypted private keys
>  - pkcs10 requests
>  - crls
>  - pkcs7/cms 
>  - pkcs7/cms as certificate bag
>  - pkcs7/cms as crl bag
>  - pkcs12
> 
> So any implementation that is ignoring the explicit label, will have to
> use the implicit label from successfuly ASN.1 decode of the types
> of objects that are applicable for the requested operation.

You are assuming, I believe incorrectly, that the ASN.1 decoding is happening in the same part of the system as the base64 decoding. That's not a safe assumption. In your code, it might be fine; it is probably not fine in all code. Why throw away valuable information?

> Microsoft seems to ignore the label.  If you double-click on
> a pkcs7 file (extension .p7s or .p7b) it will be PEM-decoded independent
> of what label is used.  Same for certificate (.cer).

Um, so? That's one implementation.

> I find it much more confusing when only a few, but non-unique labels
> are accepted:
> OpenSSL seems to accept certs with "X509 CERTIFICATE" and "CERTIFICATE"
> and PKCS7 as "PKCS7" or "CERTIFICATE" but _not_ "X509 CERTIFICATE"

Fully agree. That's why it is good that someone (Simon!) is doing this work.

>> Just a thought: we define *new* labels that do what we think everyone
>> should do, such as multiple items in the block. There would not be much
>> uptake on those new labels in the short run, but could become the
>> standard 20 years from now.
> 
> For OUTPUT we should try to find an reuse the most commonly used label,
> because the installed base is going to be with us another 10+ years.


You and I live in different universes.

--Paul Hoffman