Re: [pkix] Why is the crlNumber an OCTET STRING?

Niklas Matthies <pkix@nmhq.net> Wed, 21 April 2021 14:23 UTC

Return-Path: <pkix@nmhq.net>
X-Original-To: pkix@ietfa.amsl.com
Delivered-To: pkix@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8DD133A29D8 for <pkix@ietfa.amsl.com>; Wed, 21 Apr 2021 07:23:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham 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 QHCeMNX-BfP1 for <pkix@ietfa.amsl.com>; Wed, 21 Apr 2021 07:23:12 -0700 (PDT)
Received: from mail.nmhq.net (mail.nmhq.net [95.129.49.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F05EB3A29FA for <pkix@ietf.org>; Wed, 21 Apr 2021 07:23:11 -0700 (PDT)
Received: from matthies by mail.nmhq.net with local (Exim 4.89) (envelope-from <pkix@nmhq.net>) id 1lZDkv-0003mE-Id for pkix@ietf.org; Wed, 21 Apr 2021 16:23:05 +0200
Date: Wed, 21 Apr 2021 16:23:05 +0200
From: Niklas Matthies <pkix@nmhq.net>
To: pkix@ietf.org
Message-ID: <20210421142305.moj34p6wx6kyzavt@nmhq.net>
Mail-Followup-To: pkix@ietf.org
References: <3d6d5a6ea9ca4a6a99791da46435b7cf@uxcn13-tdc-d.UoA.auckland.ac.nz> <490638C0-9D93-4998-9F5D-1C9804B8E95C@vigilsec.com> <1618955894307.55564@cs.auckland.ac.nz>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format="flowed"
Content-Disposition: inline
In-Reply-To: <1618955894307.55564@cs.auckland.ac.nz>
X-Clacks-Overhead: GNU Terry Pratchett
X-Editor: VIM - Vi IMproved 8.0
X-Operating-System: Linux 4.4.112 x86_64
User-Agent: NeoMutt/20170113 (1.7.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/pkix/5G0Nq3GBnwiMDCYshSYzJppGSHE>
Subject: Re: [pkix] Why is the crlNumber an OCTET STRING?
X-BeenThere: pkix@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
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: <https://mailarchive.ietf.org/arch/browse/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, 21 Apr 2021 14:23:22 -0000

On Tue 2021-04-20 at 21:58h, Peter Gutmann wrote on pkix:
>Russ Housley <housley@vigilsec.com> writes:
>
>>I see nothing about an OCTET STRING ...
>
>If it's 20 bytes it's an OCTET STRING dressed up as an INTEGER, not a 
>real INTEGER.

One thing that isn't entirely clear is whether the 20-octets limit 
implies a maximum integer value of 2^159 - 1 or of 2^160 - 1. Assuming 
the two's complement integer representation of DER, I would assume the 
former. For serial numbers, this is almost made explicit by the first 
paragraph of Appendix B ("almost" because it is not made explicit that 
the 20-octets limit refers to the DER encoding of the value), but 
there is no corresponding paragraph for CRL numbers, so one has to 
wonder whether there is some intended difference between the two.

The sign bit having to be zero would also imply that you can't use 
just any SHA-1 hash value, besides the monotonicity requirement.

Niklas