[lamps] Encoding errors in draft-ietf-lamps-samples-01
"David A. Cooper" <david.cooper@nist.gov> Tue, 11 May 2021 14:37 UTC
Return-Path: <david.cooper@nist.gov>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5AE8D3A1A15 for <spasm@ietfa.amsl.com>; Tue, 11 May 2021 07:37:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.799
X-Spam-Level:
X-Spam-Status: No, score=-2.799 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.698, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_GOV_DKIM_AU=-0.001, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nist.gov
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 gPBpNBKfmMGW for <spasm@ietfa.amsl.com>; Tue, 11 May 2021 07:37:11 -0700 (PDT)
Received: from GCC02-BL0-obe.outbound.protection.outlook.com (mail-bl2gcc02on2107.outbound.protection.outlook.com [40.107.89.107]) (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 E67E83A1A01 for <spasm@ietf.org>; Tue, 11 May 2021 07:37:10 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=blkqIUVwM10MKMbcaHUMFhn6n/gBIGdzz5LgRhL781/QswgiGl7Uj29F+n3fky5eJsa5RclY80C+LgO9cNRsFvKSDv7JhlOpRTTGXDThjVPMMhfpBSXJajvjfMqOgCESJX89f5aIyHiZU5VgnOYmRMWQLC8eyaa7WdGjIYP83R+6rHw6C+keCNLAOtlV3fM0Ir54/XUMqKWHmu1iUypMzmdrBLAvREuMJnkye/7gNOl4mo3ibicSG7NP2k+En8A/r+Imdn8jCxij8DnfQpKjLENgOsV3shAtqzH4NER+UDNPHsSpHALLr04qmBReo1ipXlrhcUIIdHaEs0KVl459Hg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+jeJdxlVqYQvHGrQfSlNqkATmfyg3hJ43c7TpkszmC4=; b=DqE6N0j53H1eo2o1TbYCPTOv2u8MSel7ZNUgSkcDu2cDV9+X1ApR0orZNkD0TLMt3y1+74W6nciSxZ6ScW+9HV6ON0SSqd0t4DqNRlwu8fofdc0d73nSC/XASRXk/LMrzZ3I7UC1QOvNoJGRTg8lATi8/1bI3dG/t/YeVQwTPjF4OxzFz8EYEWtJobGhu3MQn8slzYP6BpTwW95WeJbSdyR1BcGtMtnDlfpEIMenLMUNRuOiPyLBnwkAmIn9wLMEh6B6i8j/gfIazXb1OtdJA1UOByji3H3CfSyKNaFU1i/9yz+3X70vM6DEETSznQNfjjQgZaGswhUIvqMaMAvISg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 129.6.16.228) smtp.rcpttodomain=ietf.org smtp.mailfrom=nist.gov; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nist.gov; dkim=none (message not signed); arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nist.gov; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+jeJdxlVqYQvHGrQfSlNqkATmfyg3hJ43c7TpkszmC4=; b=ra2vPmfeE3NzWY5EXwkm+wgh2sOXM4i8cl89nniZyWYJ5yirSy3eC63JtzIvkg3stk1gtpaxjO0buIZHVfmgXd4QFiGarGHWrHWH8thDteRt54ZASkVRY5qwofrmKQV6lTd44e7qCbloCiLUJ2wewzm9+ZZ8gOkJnKuKVCnlUd8=
Received: from DM6PR09CA0033.namprd09.prod.outlook.com (2603:10b6:5:160::46) by BLAPR09MB6081.namprd09.prod.outlook.com (2603:10b6:208:2a5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Tue, 11 May 2021 14:35:50 +0000
Received: from BL0GCC02FT007.eop-gcc02.prod.protection.outlook.com (2a01:111:f400:7d05::209) by DM6PR09CA0033.outlook.office365.com (2603:10b6:5:160::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Tue, 11 May 2021 14:35:49 +0000
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 129.6.16.228) smtp.mailfrom=nist.gov; ietf.org; dkim=none (message not signed) header.d=none;ietf.org; dmarc=pass action=none header.from=nist.gov;
Received-SPF: Pass (protection.outlook.com: domain of nist.gov designates 129.6.16.228 as permitted sender) receiver=protection.outlook.com; client-ip=129.6.16.228; helo=smtp1.nist.gov;
Received: from smtp1.nist.gov (129.6.16.228) by BL0GCC02FT007.mail.protection.outlook.com (10.97.10.173) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Tue, 11 May 2021 14:35:49 +0000
Received: from PN105734.campus.nist.gov ([129.6.165.242]) by smtp1.nist.gov with Microsoft SMTPSVC(10.0.14393.4169); Tue, 11 May 2021 10:35:48 -0400
References: <abbd1824-c0f2-9a74-c36c-eafcb3636255@nist.gov>
From: "David A. Cooper" <david.cooper@nist.gov>
To: spasm@ietf.org
X-Forwarded-Message-Id: <abbd1824-c0f2-9a74-c36c-eafcb3636255@nist.gov>
Message-ID: <4c75ae6e-dc83-be55-4ec0-60157c444d9f@nist.gov>
Date: Tue, 11 May 2021 10:35:48 -0400
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1
MIME-Version: 1.0
In-Reply-To: <abbd1824-c0f2-9a74-c36c-eafcb3636255@nist.gov>
Content-Type: multipart/alternative; boundary="------------301F3C3320D16451AD82959C"
Content-Language: en-US
X-OriginalArrivalTime: 11 May 2021 14:35:48.0771 (UTC) FILETIME=[EF6B1F30:01D74672]
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: c3e1653e-3abe-4069-7f89-08d9148a1223
X-MS-TrafficTypeDiagnostic: BLAPR09MB6081:
X-Microsoft-Antispam-PRVS: <BLAPR09MB6081B6284516BF0C47223ADBFE539@BLAPR09MB6081.namprd09.prod.outlook.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:9508;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: JPsY6H4JboQ2N9uAVafb0MUZ1VJWOTchAYUW3YW2uaoPKhIsIyx3ZlFpgzCd87xD493kpfukqkcBfoJrq0ThcnmGSqxcnPAkZHSpG621BfuiY0L/Il7JZM/LQqtb8X27yxsQROA3Z3WbS6CefqUi8M4eE5lG6OMzPYbq0nLHXkPkTIMSgR+9iRKiHCEYvRkJ079b29yEUlnlO56GDSbWemlv17teaoncnOrT3UvnveQg3nBMZO/FGS0AKBc2Amhrv8pW0XDRzgIF6PVGiswnU6eyOeHHzgD7ew0qk2FTZ5tL/nJACUZcgvXp5SVMnIzu375ZV7eV2WQs4FImP/It4GSFeyeiQQSoGieWWU6CQbbPGtABPxQvQw7gmxse979Q7ZPH5XCuh77d2BXy7tBYFzkPTB8Uu1dyqn8Ie8q3xuMrq32LryJCW52j1x6QUdPpAPq5J7eyqkK59MqEErHIP7Ex9f6Enc2AS4wqB/Skdjh5at0wRpMwYfASHnwsTLeal8ewkMVUYOWKweKCiKW0Uj5fivV+dGo0JY+4o1At8k4nF3f02G8tUzW38NpTLHW6TmT6a0EzsiGkp5jz+o/31Z6dVezWefcEliwq5zAxEwppHFhgsOKQzfB3pOo2Py1UlerAANHz26uvEe1NUx1ZYu3LBGKii+db/BAF7HGugv6zfzQ15JKY421fdasszSLDyucmM1p7HSOE5jmgh4Ozmn4n9mSUIh1KnXmV0IZs5rQ=
X-Forefront-Antispam-Report: CIP:129.6.16.228; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:smtp1.nist.gov; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(31696002)(36756003)(47076005)(82310400003)(70206006)(70586007)(86362001)(36860700001)(83380400001)(356005)(81166007)(2616005)(2906002)(6916009)(8676002)(426003)(956004)(36906005)(186003)(8936002)(33964004)(5660300002)(26005)(31686004)(336012)(498600001)(7696005)(43740500002)(36900700001); DIR:OUT; SFP:1102;
X-OriginatorOrg: nist.gov
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2021 14:35:49.1904 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c3e1653e-3abe-4069-7f89-08d9148a1223
X-MS-Exchange-CrossTenant-Id: 2ab5d82f-d8fa-4797-a93e-054655c61dec
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=2ab5d82f-d8fa-4797-a93e-054655c61dec; Ip=[129.6.16.228]; Helo=[smtp1.nist.gov]
X-MS-Exchange-CrossTenant-AuthSource: BL0GCC02FT007.eop-gcc02.prod.protection.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR09MB6081
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/fy6ilJRnqBaXiZctVyHJELQMmK8>
Subject: [lamps] Encoding errors in draft-ietf-lamps-samples-01
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is a venue for discussion of doing Some Pkix And SMime \(spasm\) work." <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 11 May 2021 14:37:20 -0000
I ran the ten sample certificates in draft-ietf-lamps-samples-01 through
a certificate checker that I wrote several years ago and it highlighted
a couple of issues with the sample certificates.
The first issue is that the keyUsage extensions in the certificates are
not DER encoded. The keyUsage extensions in the certificates are all
encoded in the form "03 03 07 XX 00."
It seems that the developer of the encoder mistakenly believed that the
bit string should always be 9 bits long in order to correspond to the
definition of keyUsage:
KeyUsage ::= BIT STRING {
digitalSignature (0),
nonRepudiation (1), -- recent editions of X.509
have
-- renamed this bit to
contentCommitment
keyEncipherment (2),
dataEncipherment (3),
keyAgreement (4),
keyCertSign (5),
cRLSign (6),
encipherOnly (7),
decipherOnly (8) }
However, X.680 and X.690 specify that when encoding a named bit list,
such as above, any trailing zeros must be removed. So, a keyUsage
extension with just digitalSignature and nonRepudiation set would be
encoded as a bit string that is only two bits long ('11') and a keyUsage
extension with just keyAgreement set would be encoded as a bit string
that is five bits long ('00001').
So, the correct encoding for the keyUsage extension would be:
* "03 02 01 06" for the CA certificate
* "03 02 06 C0" for the digital signature certificates
* "03 02 05 20" for the encryption certificates
* "03 02 03 08" for the key agreement certificates
The second issue the program highlighted is that the certificates in
Sections 4.1, 4.3, 7.3, and 8.1 contain negative serial numbers. While
this is permitted by X.509, Section 4.1.2.2 of RFC 5280 requires
conforming CAs to use positive integers as serial numbers.
Thanks,
David Cooper
- [lamps] Encoding errors in draft-ietf-lamps-sampl… David A. Cooper
- Re: [lamps] X.509 certificate linting [was: Re: E… David A. Cooper
- [lamps] Fwd: X.509 certificate linting David A. Cooper
- Re: [lamps] X.509 certificate linting [was: Re: E… Daniel Kahn Gillmor
- Re: [lamps] Encoding errors in draft-ietf-lamps-s… Daniel Kahn Gillmor
- Re: [lamps] Fwd: X.509 certificate linting Rob Stradling
- [lamps] X.509 certificate linting [was: Re: Encod… Daniel Kahn Gillmor
- Re: [lamps] Fwd: X.509 certificate linting Russ Housley
- Re: [lamps] X.509 certificate linting [was: Re: E… Salz, Rich
- Re: [lamps] X.509 certificate linting [was: Re: E… Rob Stradling
- Re: [lamps] X.509 certificate linting Daniel Kahn Gillmor