[pkix] Signature Verification and DER requirements

Jeffrey Walton <noloader@gmail.com> Wed, 13 May 2015 21:24 UTC

Return-Path: <noloader@gmail.com>
X-Original-To: pkix@ietfa.amsl.com
Delivered-To: pkix@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 98E421ACF04 for <pkix@ietfa.amsl.com>; Wed, 13 May 2015 14:24:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.7
X-Spam-Level:
X-Spam-Status: No, score=0.7 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
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 9ikix1zcbO5c for <pkix@ietfa.amsl.com>; Wed, 13 May 2015 14:24:36 -0700 (PDT)
Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [IPv6:2607:f8b0:4001:c03::22a]) (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 C65FD1ACE16 for <pkix@ietf.org>; Wed, 13 May 2015 14:24:35 -0700 (PDT)
Received: by iecmd7 with SMTP id md7so44328439iec.1 for <pkix@ietf.org>; Wed, 13 May 2015 14:24:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; bh=ejT48UxUoUmiXb5fUXxUAxHHjqmwdWl9CO0kfhEvH4I=; b=G+hNQj6sFHdDI9c5lIE+v3sUykP6EniW7hQdrUSd0mBQ+tSn85HScwm4KzC3agMxEP sfN2j8aRExQDIFi4cKe3F9Vx1rqeFN5qPhPZ/hWdQS6m7GahJ5UGBPeR6y3n3WjuSeFP b2odwYbdp2BE9xH/N5j8HsdKDvZ1QJf8fqOcg76cS3WEKsv5kTnZ0NrnJfHty1zjbvZa dzUEvfO3bxfuzjWpjUjXnqR1zr7qJgLLzeqonO0Snptatw8FLZjwahDOu1pfb4mLgvd/ xwbbmuAoFS3A4/hNKiGuRSWOyz/NMsOXnrAaUD/A5cOYH291s/vrVSsw8mZWUFhm7DIO IOeg==
MIME-Version: 1.0
X-Received: by 10.50.30.69 with SMTP id q5mr2183892igh.11.1431552275320; Wed, 13 May 2015 14:24:35 -0700 (PDT)
Received: by 10.36.77.15 with HTTP; Wed, 13 May 2015 14:24:35 -0700 (PDT)
Date: Wed, 13 May 2015 17:24:35 -0400
Message-ID: <CAH8yC8=yqmAyjQ4VAvwZBGnjmmKaQJ7Fxc3t3xhcJM0MEONeVQ@mail.gmail.com>
From: Jeffrey Walton <noloader@gmail.com>
To: PKIX <pkix@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <http://mailarchive.ietf.org/arch/msg/pkix/5LhsTFqc4fr7dKVMXOqNYpD8ZCU>
Subject: [pkix] Signature Verification and DER requirements
X-BeenThere: pkix@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: noloader@gmail.com
List-Id: PKIX Working Group <pkix.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/pkix>, <mailto:pkix-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/pkix/>
List-Post: <mailto:pkix@ietf.org>
List-Help: <mailto:pkix-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/pkix>, <mailto:pkix-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 13 May 2015 21:24:37 -0000

RFC 5280, 4.1. Basic Certificate Fields, states:

    For signature calculation, the data that is to be
    signed is encoded using the ASN.1
    distinguished encoding rules (DER) [X.690].

One of the implications is attributes in a SET OF must be sorted and
provided in ascending order. Refer to X.690, 11.6 Set-of components.

RFC 6125 does not discuss how to verify the signature over
tbsCertifcate modulo the encoding requirement.

What is the expected behavior when complying software that expects DER
consumes a non-DER encoded certificate during signature verification?
Here, assume the attributes are *not* in ascending order per RFC 5280
and X.690.

Thanks in advance.