From patchwork Thu Apr 19 06:11:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Winnie Chang X-Patchwork-Id: 10349149 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E820260365 for ; Thu, 19 Apr 2018 06:12:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C778228903 for ; Thu, 19 Apr 2018 06:12:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB3BF28929; Thu, 19 Apr 2018 06:12:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51BD428917 for ; Thu, 19 Apr 2018 06:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753245AbeDSGMR (ORCPT ); Thu, 19 Apr 2018 02:12:17 -0400 Received: from mail-cys01nam02on0109.outbound.protection.outlook.com ([104.47.37.109]:43952 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752380AbeDSGMN (ORCPT ); Thu, 19 Apr 2018 02:12:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cycorp.onmicrosoft.com; s=selector1-cypress-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LeAxy7pOX4jY4M9E0Vg5rn9vgj0Rk+s7iy+DhV87oc8=; b=DSwObWKN+XIXdQg+HNN3QD0/Jo3zocPF3pge6rTWle0H6Te+aIL0AIU5+OtbUjLg++7kaKTHwI/OsnjTVJc0hivmKDNhwfDUsm18ONSpXIXj+gsre2kVQWHCPOWgYhq+8U8bWiwXXP6JGX4+/jj3iMPItGsw0Xxoi8DW6i3PKyo= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from aremote01.aus.cypress.com (12.110.209.245) by DM2PR06MB688.namprd06.prod.outlook.com (2a01:111:e400:244e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.14; Thu, 19 Apr 2018 06:12:10 +0000 Date: Thu, 19 Apr 2018 01:11:58 -0500 From: Winnie Chang To: backports@vger.kernel.org Cc: chln@cypress.com Subject: [PATCH] backports: rename *-asn1.[ch] to *.asn1.[ch] Message-ID: <20180419061146.GA22072@aremote01.aus.cypress.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-Originating-IP: [12.110.209.245] X-ClientProxiedBy: SN6PR15CA0008.namprd15.prod.outlook.com (2603:10b6:805:16::21) To DM2PR06MB688.namprd06.prod.outlook.com (2a01:111:e400:244e::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989080)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(8990040)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DM2PR06MB688; X-Microsoft-Exchange-Diagnostics: 1; DM2PR06MB688; 3:FPPM7zyKMqn62YAInHu4amIkKLWyiqNA8TzBNagG+rmrpJMxhnS+7qeGotxEum3DgLmZjsiNbXVPqBF6fr3jHzLX02iy9WYSzkdXK8RNcctVd+pfJ+PWI0IC8c2EzJ7X7aEroiHCkdHGNEtOoYxSBSIk9ce/kfkiIe4PJk7c/EY+zkOLFrZ9tHfDRtrZMI9PPnHBTT18DHC5fW4tsX7CYzk5xsp4LATzFTP75STT2i6toWcZ2uC/eixS84EcBN43; 25:tNHOkVAEYGuLMf27jBwuGEW6QY5BNLCvY2KzkAqus1iq3ffyB392jpWI/Fq/D9WreeaKls2Emu2psAXqPWfsYqtNJ4iVaGhZ8rN+baAFgoDqUnqhBtOT0zRm3oU+mIUYSuQ0YA+Ea7uJRYiDDHu1ZoyGBm130TQH5TTeTW+04mbzgFIt8alMgkMa+T8XWJN/YdYLxKtNJyJ08mgh5tu1LDJbpxdi3Q/XmGocEEC1/deG/zjZX/87WuWuudCyYgsQKay8QLyn2hr8IPdthMg3j6g7JScjQ4N/0b/Jk2Hu66OLfHoZCLbY6ILFMi2X/BaCqgQD5/jEdWx/0u5ITFlKaQ==; 31:pvThtWUUnYVpHWxPYW3iWe8ng+wSws0V8nM9oLf1iEoKaanRcW8/qCMoKfaymVEuhb/0jWlfH0UE/tgNbnxy4nlL9F0V2XGN3YkBL/no89RNSFx0MZrwuMLTd4R1x+9YJDIFU4g31J37uF+MK8dssqpRyWaQx4Ll8E4QVoAk9NhcABe4xmaYiGCLeiJ+ywT1djGrjImjGDJzV7MgWsTLz+aPx5OfT1nDB/MQ102+Mzs= X-MS-TrafficTypeDiagnostic: DM2PR06MB688: X-Microsoft-Exchange-Diagnostics: 1; DM2PR06MB688; 20:XX7GNHk8C++xO+st+JaOwHSLEH8Q5WYr6J9Oza7BfSP9BI0DdJAuc7uES5HZXx8TK4aNC6JAEUFTjrdQEnkEcQoHqsh8+V++4zr+shMomJzofmIVM5KfmSSJeWhrQnIexJmSVlXBML1kXqJxQdhel4HfuyHo0jgphm/4CYqYY0BWFLRRd2rDrgNFQAwS4gUd+waIxlMohQwb1Oxh0/bEJLC9J1ZkGlLD88lQRHo1P8CzzB3CNfoQ/vHzS6yWVVEiPb/cei2rR9XbbwN6pC6NviO5DVT6JtHrygje7JdQSOI2yYU4TkavBGQswS/l9Hti71DG98pu15/Dv0vMY1Z/VT3JfIxGGxPAfym5yZP0a3zUpEP9gvdnAZBT6DvE2P3uKIzkapc74jJXLLAfSCS4uMXcibkgUmYugwalYB1DRMAEJ/5y1fA4ouS50REfLc7KJMAvmYVBjIdwvDOHG87u9AwO4VTTsnmEaao4HHbEtknoX/epUN7IsZVGDhlfY4/V; 4:pgTDiI6uhFlREfs7WTpNILQZDpcIDf+IzbBi46t/Uyt2IVqkdCjD3tcZKbtqEWZwdWrgYSoIaqva5ZU61V171PNiREYLtcjduW+f7aB0ToGFpH4sKUsHFCNPsIGx6PUUaWTL6ZxFegTpKSHo6qusy98YkLEYUoi4UWp5ws1RS1Bkis86z3RKzFYXBassp2VGJnWA7iwte/LABUyRR7SJf4ukw+Wl8rd8EdhMSBxpvz/+M2E1NnI9Gf91S0n5wpWPBJsOZuURy5y5Rgj+b9dEMw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231232)(944501327)(52105095)(3002001)(6055026)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:DM2PR06MB688; BCL:0; PCL:0; RULEID:; SRVR:DM2PR06MB688; X-Forefront-PRVS: 0647963F84 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(39380400002)(39860400002)(366004)(346002)(376002)(23726003)(58126008)(476003)(107886003)(50466002)(1857600001)(3846002)(6116002)(53936002)(16586007)(53946003)(33656002)(2906002)(1076002)(86362001)(956004)(2351001)(55016002)(316002)(5660300001)(16526019)(2361001)(478600001)(186003)(4326008)(66066001)(59450400001)(26005)(81166006)(72206003)(305945005)(7736002)(25786009)(7696005)(8936002)(44832011)(8676002)(6916009)(52116002)(386003)(18370500001)(579004)(559001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR06MB688; H:aremote01.aus.cypress.com; FPR:; SPF:None; LANG:en; MLV:sfv; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR06MB688; 23:nkyuTf/jlHLplpG4IwH3CdU0uSnKjT3GRemiCLUBY+?= =?us-ascii?Q?+MK1vSfsBahjtRphe9OVzf9Oj8YDcEQEs9fHPGSTbcQ7xOV8dKCq4qHI+zh5?= =?us-ascii?Q?reY6Jdz/xyEKupqs1K6xuigsnb6VLfoDpRqq/I1ZM6vomdlAxxi5pLvpnI77?= =?us-ascii?Q?ENn+Q/9/tyrJfj2xTqg7evfnE6U8dmlmHwEAU+PD23X9dwyD7aj83Mhlnt6t?= =?us-ascii?Q?lAKa+qe9AadeQA+0DVz8jkIAaiOx9jJQt+5SJnYKXFB42vc2HUCdH+E4d1W5?= =?us-ascii?Q?UHgfk3ic/T8KgStAXvr7TVyL/VUIMQs0AV5qaMJz1PWoZzS3tQg837BAaBxv?= =?us-ascii?Q?hx0y2mO7C1rXK6WE69uRAdhcg5ZX6aTWBrUc0mOjEisK159JTSf3cT6J9CX5?= =?us-ascii?Q?AViqrgZPrbBalvsB9UOdYpX6izCsEc20dpxfVP95yLhHCdpjHldizjXMgwh4?= =?us-ascii?Q?xbcYUN7NZLPG2Iy0OACfW3snPoBPaDaSAGFmyA5IP34HS80utpDf6qGERvd4?= =?us-ascii?Q?cnsiUnQEeM7xhjwweBwlTeF3MNBqRDXWDplw4yHGcGRz2rwfb/KWM4Bq64xt?= =?us-ascii?Q?yPtrAo3jeQ9hI6gcnqlx8TIgzH1n9o9H0wiJyqixkfJDRNOWT3sokkDtKaN7?= =?us-ascii?Q?Cm99lDjN1SpMiCqIJw5Ib/UoTATRkxJu23jePb5zNcOLXD6sMrJNGOCvpe0V?= =?us-ascii?Q?VzscTuABXHXOvtzRa3xSvQiXKZ8RUUcTv+M6g3eNYll55k0uwXFW58QPchXl?= =?us-ascii?Q?iCpSUq8szmmW4BbDzpH6C9lJdTABMO/XKuig01QsDGDH+6aru96baookNr2D?= =?us-ascii?Q?RIzOUCx/HnVpGuiOoZomLjbz44FHLlX6XcYBy9erUj48ITVqjjPjr4A1fb/+?= =?us-ascii?Q?GkgDt3L9eSVF9FOR7dyCcykAWfHNqKVR27amRBEEARs9Cz1nGrC0X6vsp3p/?= =?us-ascii?Q?D3FVmXqGfygd+SVAUe5NA6uOYhKd+pqiZJC5M7CNm0eiachHbPpKuOTTcPDf?= =?us-ascii?Q?9hYpHx1FehBorjEE7cHu9D8nMplQfcZMv/v+cwSf/uWuGtq7LNu2HZyU6Hxr?= =?us-ascii?Q?mk9Wjbkf7N0AdwCwPY9OWVdA6a8Y9X11qNWEHKkguKd31/GmS74QvDhTXOqH?= =?us-ascii?Q?6fArp9uIQ=3D?= X-Microsoft-Antispam-Message-Info: HHK45kzCH3vIxaXTnx2dNg9K36EeYIM9ccKnoPHOSyscVNpk3AlXSg3S/ROMNWwDWb62K1Ldby9dk900pEkwT5gRB36cdGk5PVFa4rrxxQSI2TtnZDvhpM07q1sVqrgne2FTvm+l3ESh0tOffo0eVAvTGoilGXmKqKUdDHnwNEJSsSIJN+GmIOhVx7umV6+A X-Microsoft-Exchange-Diagnostics: 1; DM2PR06MB688; 6:soo+62/IZHKyfT1DE8JHWWUvFOVHw0KJ4SeblCR7VX5IzItNatxQXesD+jGkMgqmRI2/r9v+URMIreDCzZLi09VIGEmIUSTAqbWhXaci1Hk5ieQBH+YrzjwuKKIZ3jWiqGEbnkrPwVofecYW3qezd4mfSzjQFU66U5sIUBO3mKZQImXoS7m3NYAXRBCikYcoVBzHwbIbHeOERFoMUt8zQbwMeNef03b7dRCMnogwbTKfhC/mxTUZX2B2ZxaOwCyGUz2EqPYUJjoRE2n7xHxWpCJpSyLsiyAHyTjPmMd/SViNXIOPmHotn5xHfvKSfsSN0wT2fvjpjv9IdCaDEA8eTRMiwNfJlV/4lSFFy8LeIfEa2wZaEuJB04xnX31fyQtIbpTjDlzyrRJr0WhARMp2L3KxS++5oBRKlasU+uBi3+x7WzAefsjxRxjZ0sihBYbXAQMIrbLihy/ZKbfBlVEbDw==; 5:bnOQt+fwiXIzw7mrrUWoRGRksIuLG9MC0CHzIu4N9Q0NvoGp3UJsnfs9xUBbGFEZ4nMVPqUrNXeOnI34T0kcMvFes/Q0DNShxvSuQEp3dVi8P9O2/Cl+XUwNq4rGW8tX1w3HA1o/ijoGCuj+WrNCEXjD30Q4aXBVXNzVMuDLaS8=; 24:pcEeDnAcCk879ME3NYHQPMRao2Js66vf070mvYJZ9xEDYPad+pHsf3h3tqOTi9AbGi5LQeh/dgjaE576xP2xpD1fUsz6rq4VxGI831lQh18= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR06MB688; 7:lG0PsidCQpOJBIccxLsyZkNq0On9GFku/2CcJrX+q+yCeeQUy6XgCLTwuhnbB6u49j1hyGmlDnZFt8pqQpcXwTcw0FujsyurHam+GhGkim8/4NEEX/lKDEwptzNKggvkql60nip3TzMlUvFgDH0gtyeD5VABGhrUF2raIf+GMd1wOZWyQHPkXYxqG8QZi1xQHHlw9XDqh13YEyFlxjB5k0goZlj0Mk+1hKAVNegoy6+ACaA7QGLRyc9VUZbDG3IO X-MS-Office365-Filtering-Correlation-Id: 5458440e-f8ec-40b5-521e-08d5a5bc7c9f X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2018 06:12:10.4168 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5458440e-f8ec-40b5-521e-08d5a5bc7c9f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR06MB688 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP linux-stable 4fa8bc949de11c99ee2433c602d43f87c452f4f2 renamed *-asn1.[ch] files to *.asn1.[ch]. Make the corresponding change for backports. --- backport/compat/Makefile | 8 +- backport/compat/verification/pkcs7-asn1.c | 355 -------------------------- backport/compat/verification/pkcs7-asn1.h | 27 -- backport/compat/verification/pkcs7.asn1.c | 355 ++++++++++++++++++++++++++ backport/compat/verification/pkcs7.asn1.h | 27 ++ backport/compat/verification/public_key.c | 2 +- backport/compat/verification/rsapubkey-asn1.c | 38 --- backport/compat/verification/rsapubkey-asn1.h | 15 -- backport/compat/verification/rsapubkey.asn1.c | 38 +++ backport/compat/verification/rsapubkey.asn1.h | 15 ++ backport/compat/verification/x509-asn1.c | 182 ------------- backport/compat/verification/x509-asn1.h | 22 -- backport/compat/verification/x509.asn1.c | 182 +++++++++++++ backport/compat/verification/x509.asn1.h | 22 ++ backport/compat/verification/x509_akid-asn1.c | 144 ----------- backport/compat/verification/x509_akid-asn1.h | 15 -- backport/compat/verification/x509_akid.asn1.c | 144 +++++++++++ backport/compat/verification/x509_akid.asn1.h | 15 ++ 18 files changed, 803 insertions(+), 803 deletions(-) delete mode 100644 backport/compat/verification/pkcs7-asn1.c delete mode 100644 backport/compat/verification/pkcs7-asn1.h create mode 100644 backport/compat/verification/pkcs7.asn1.c create mode 100644 backport/compat/verification/pkcs7.asn1.h delete mode 100644 backport/compat/verification/rsapubkey-asn1.c delete mode 100644 backport/compat/verification/rsapubkey-asn1.h create mode 100644 backport/compat/verification/rsapubkey.asn1.c create mode 100644 backport/compat/verification/rsapubkey.asn1.h delete mode 100644 backport/compat/verification/x509-asn1.c delete mode 100644 backport/compat/verification/x509-asn1.h create mode 100644 backport/compat/verification/x509.asn1.c create mode 100644 backport/compat/verification/x509.asn1.h delete mode 100644 backport/compat/verification/x509_akid-asn1.c delete mode 100644 backport/compat/verification/x509_akid-asn1.h create mode 100644 backport/compat/verification/x509_akid.asn1.c create mode 100644 backport/compat/verification/x509_akid.asn1.h diff --git a/backport/compat/Makefile b/backport/compat/Makefile index ac70aaf..12c4121 100644 --- a/backport/compat/Makefile +++ b/backport/compat/Makefile @@ -41,11 +41,11 @@ compat-$(CPTCFG_KERNEL_4_12) += backport-4.12.o compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/verify.o -compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7-asn1.o +compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7.asn1.o compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7_verify.o compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7_parser.o -compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/x509-asn1.o -compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/x509_akid-asn1.o +compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/x509.asn1.o +compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/x509_akid.asn1.o compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/x509_cert_parser.o compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/x509_public_key.o compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7_trust.o @@ -58,7 +58,7 @@ compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/md_wrap.o compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/sha256.o compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/oid.o compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/asn1parse.o -compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/rsapubkey-asn1.o +compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/rsapubkey.asn1.o $(obj)/lib-oid_registry.o: $(obj)/oid_registry_data.c diff --git a/backport/compat/verification/pkcs7-asn1.c b/backport/compat/verification/pkcs7-asn1.c deleted file mode 100644 index 9073fd9..0000000 --- a/backport/compat/verification/pkcs7-asn1.c +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Automatically generated by asn1_compiler. Do not edit - * - * ASN.1 parser for pkcs7 - */ -#include -#include "pkcs7-asn1.h" - -enum pkcs7_actions { - ACT_pkcs7_check_content_type = 0, - ACT_pkcs7_extract_cert = 1, - ACT_pkcs7_note_OID = 2, - ACT_pkcs7_note_certificate_list = 3, - ACT_pkcs7_note_content = 4, - ACT_pkcs7_note_data = 5, - ACT_pkcs7_note_signed_info = 6, - ACT_pkcs7_note_signeddata_version = 7, - ACT_pkcs7_note_signerinfo_version = 8, - ACT_pkcs7_sig_note_authenticated_attr = 9, - ACT_pkcs7_sig_note_digest_algo = 10, - ACT_pkcs7_sig_note_issuer = 11, - ACT_pkcs7_sig_note_pkey_algo = 12, - ACT_pkcs7_sig_note_serial = 13, - ACT_pkcs7_sig_note_set_of_authattrs = 14, - ACT_pkcs7_sig_note_signature = 15, - ACT_pkcs7_sig_note_skid = 16, - NR__pkcs7_actions = 17 -}; - -static const asn1_action_t pkcs7_action_table[NR__pkcs7_actions] = { - [ 0] = pkcs7_check_content_type, - [ 1] = pkcs7_extract_cert, - [ 2] = pkcs7_note_OID, - [ 3] = pkcs7_note_certificate_list, - [ 4] = pkcs7_note_content, - [ 5] = pkcs7_note_data, - [ 6] = pkcs7_note_signed_info, - [ 7] = pkcs7_note_signeddata_version, - [ 8] = pkcs7_note_signerinfo_version, - [ 9] = pkcs7_sig_note_authenticated_attr, - [ 10] = pkcs7_sig_note_digest_algo, - [ 11] = pkcs7_sig_note_issuer, - [ 12] = pkcs7_sig_note_pkey_algo, - [ 13] = pkcs7_sig_note_serial, - [ 14] = pkcs7_sig_note_set_of_authattrs, - [ 15] = pkcs7_sig_note_signature, - [ 16] = pkcs7_sig_note_skid, -}; - -static const unsigned char pkcs7_machine[] = { - // PKCS7ContentInfo - [ 0] = ASN1_OP_MATCH, - [ 1] = _tag(UNIV, CONS, SEQ), - // ContentType - [ 2] = ASN1_OP_MATCH_ACT, - [ 3] = _tag(UNIV, PRIM, OID), - [ 4] = _action(ACT_pkcs7_note_OID), - [ 5] = ASN1_OP_ACT, - [ 6] = _action(ACT_pkcs7_check_content_type), - [ 7] = ASN1_OP_MATCH_JUMP_OR_SKIP, // content - [ 8] = _tagn(CONT, CONS, 0), - [ 9] = _jump_target(12), - [ 10] = ASN1_OP_END_SEQ, - [ 11] = ASN1_OP_COMPLETE, - - // SignedData - [ 12] = ASN1_OP_MATCH, - [ 13] = _tag(UNIV, CONS, SEQ), - [ 14] = ASN1_OP_MATCH_ACT, // version - [ 15] = _tag(UNIV, PRIM, INT), - [ 16] = _action(ACT_pkcs7_note_signeddata_version), - // DigestAlgorithmIdentifiers - [ 17] = ASN1_OP_MATCH_JUMP_OR_SKIP, // daSet - [ 18] = _tag(UNIV, CONS, SET), - [ 19] = _jump_target(61), - [ 20] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // daSequence - [ 21] = _tag(UNIV, CONS, SEQ), - [ 22] = _jump_target(67), - [ 23] = ASN1_OP_COND_FAIL, - // ContentInfo - [ 24] = ASN1_OP_MATCH, - [ 25] = _tag(UNIV, CONS, SEQ), - // ContentType - [ 26] = ASN1_OP_MATCH_ACT, - [ 27] = _tag(UNIV, PRIM, OID), - [ 28] = _action(ACT_pkcs7_note_OID), - [ 29] = ASN1_OP_ACT, - [ 30] = _action(ACT_pkcs7_note_OID), - [ 31] = ASN1_OP_MATCH_JUMP_OR_SKIP, // content - [ 32] = _tagn(CONT, CONS, 0), - [ 33] = _jump_target(73), - [ 34] = ASN1_OP_END_SEQ, - [ 35] = ASN1_OP_ACT, - [ 36] = _action(ACT_pkcs7_note_content), - // ExtendedCertificatesAndCertificates - [ 37] = ASN1_OP_MATCH_JUMP_OR_SKIP, // certSet - [ 38] = _tagn(CONT, CONS, 0), - [ 39] = _jump_target(77), // --> ExtendedCertificatesAndCertificates - // Certificates - [ 40] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // certSequence - [ 41] = _tagn(CONT, CONS, 2), - [ 42] = _jump_target(85), // --> Certificates - [ 43] = ASN1_OP_ACT, - [ 44] = _action(ACT_pkcs7_note_certificate_list), - // CertificateRevocationLists - [ 45] = ASN1_OP_MATCH_JUMP_OR_SKIP, // crlSet - [ 46] = _tagn(CONT, CONS, 1), - [ 47] = _jump_target(90), // --> CertificateRevocationLists - // CRLSequence - [ 48] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // crlSequence - [ 49] = _tagn(CONT, CONS, 3), - [ 50] = _jump_target(96), // --> CRLSequence - // SignerInfos - [ 51] = ASN1_OP_MATCH_JUMP_OR_SKIP, // siSet - [ 52] = _tag(UNIV, CONS, SET), - [ 53] = _jump_target(102), - [ 54] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // siSequence - [ 55] = _tag(UNIV, CONS, SEQ), - [ 56] = _jump_target(108), - [ 57] = ASN1_OP_COND_FAIL, - [ 58] = ASN1_OP_END_SEQ, - [ 59] = ASN1_OP_END_SEQ, - [ 60] = ASN1_OP_RETURN, - - // DigestAlgorithmIdentifier - [ 61] = ASN1_OP_MATCH_JUMP, - [ 62] = _tag(UNIV, CONS, SEQ), - [ 63] = _jump_target(114), // --> DigestAlgorithmIdentifier - [ 64] = ASN1_OP_END_SET_OF, - [ 65] = _jump_target(61), - [ 66] = ASN1_OP_RETURN, - - // DigestAlgorithmIdentifier - [ 67] = ASN1_OP_MATCH_JUMP, - [ 68] = _tag(UNIV, CONS, SEQ), - [ 69] = _jump_target(114), // --> DigestAlgorithmIdentifier - [ 70] = ASN1_OP_END_SEQ_OF, - [ 71] = _jump_target(67), - [ 72] = ASN1_OP_RETURN, - - // Data - [ 73] = ASN1_OP_MATCH_ANY_ACT, - [ 74] = _action(ACT_pkcs7_note_data), - [ 75] = ASN1_OP_END_SEQ, - [ 76] = ASN1_OP_RETURN, - - // ExtendedCertificateOrCertificate - // Certificate - [ 77] = ASN1_OP_MATCH_ANY_ACT_OR_SKIP, - [ 78] = _action(ACT_pkcs7_extract_cert), - // ExtendedCertificate - // Certificate - [ 79] = ASN1_OP_COND_MATCH_ANY_ACT_OR_SKIP, - [ 80] = _action(ACT_pkcs7_extract_cert), - [ 81] = ASN1_OP_COND_FAIL, - [ 82] = ASN1_OP_END_SET_OF, - [ 83] = _jump_target(77), - [ 84] = ASN1_OP_RETURN, - - // Certificate - [ 85] = ASN1_OP_MATCH_ANY_ACT, - [ 86] = _action(ACT_pkcs7_extract_cert), - [ 87] = ASN1_OP_END_SEQ_OF, - [ 88] = _jump_target(85), - [ 89] = ASN1_OP_RETURN, - - // CertificateList - [ 90] = ASN1_OP_MATCH_JUMP, - [ 91] = _tag(UNIV, CONS, SEQ), - [ 92] = _jump_target(120), // --> CertificateList - [ 93] = ASN1_OP_END_SET_OF, - [ 94] = _jump_target(90), - [ 95] = ASN1_OP_RETURN, - - // CertificateList - [ 96] = ASN1_OP_MATCH_JUMP, - [ 97] = _tag(UNIV, CONS, SEQ), - [ 98] = _jump_target(120), // --> CertificateList - [ 99] = ASN1_OP_END_SEQ_OF, - [ 100] = _jump_target(96), - [ 101] = ASN1_OP_RETURN, - - // SignerInfo - [ 102] = ASN1_OP_MATCH_JUMP, - [ 103] = _tag(UNIV, CONS, SEQ), - [ 104] = _jump_target(125), // --> SignerInfo - [ 105] = ASN1_OP_END_SET_OF, - [ 106] = _jump_target(102), - [ 107] = ASN1_OP_RETURN, - - // SignerInfo - [ 108] = ASN1_OP_MATCH_JUMP, - [ 109] = _tag(UNIV, CONS, SEQ), - [ 110] = _jump_target(125), // --> SignerInfo - [ 111] = ASN1_OP_END_SEQ_OF, - [ 112] = _jump_target(108), - [ 113] = ASN1_OP_RETURN, - - [ 114] = ASN1_OP_MATCH_ACT, // algorithm - [ 115] = _tag(UNIV, PRIM, OID), - [ 116] = _action(ACT_pkcs7_note_OID), - [ 117] = ASN1_OP_MATCH_ANY_OR_SKIP, // parameters - [ 118] = ASN1_OP_END_SEQ, - [ 119] = ASN1_OP_RETURN, - - // Certificate - [ 120] = ASN1_OP_MATCH_ANY_ACT, - [ 121] = _action(ACT_pkcs7_extract_cert), - [ 122] = ASN1_OP_END_SEQ_OF, - [ 123] = _jump_target(120), - [ 124] = ASN1_OP_RETURN, - - [ 125] = ASN1_OP_MATCH_ACT, // version - [ 126] = _tag(UNIV, PRIM, INT), - [ 127] = _action(ACT_pkcs7_note_signerinfo_version), - // SignerIdentifier - // IssuerAndSerialNumber - [ 128] = ASN1_OP_MATCH_JUMP_OR_SKIP, // issuerAndSerialNumber - [ 129] = _tag(UNIV, CONS, SEQ), - [ 130] = _jump_target(169), // --> IssuerAndSerialNumber - // SubjectKeyIdentifier - [ 131] = ASN1_OP_COND_MATCH_ACT_OR_SKIP, // subjectKeyIdentifier - [ 132] = _tagn(CONT, PRIM, 0), - [ 133] = _action(ACT_pkcs7_sig_note_skid), - [ 134] = ASN1_OP_COND_FAIL, - // DigestAlgorithmIdentifier - [ 135] = ASN1_OP_MATCH_JUMP, - [ 136] = _tag(UNIV, CONS, SEQ), - [ 137] = _jump_target(114), // --> DigestAlgorithmIdentifier - [ 138] = ASN1_OP_ACT, - [ 139] = _action(ACT_pkcs7_sig_note_digest_algo), - // SetOfAuthenticatedAttribute - [ 140] = ASN1_OP_MATCH_JUMP_OR_SKIP, // aaSet - [ 141] = _tagn(CONT, CONS, 0), - [ 142] = _jump_target(192), // --> SetOfAuthenticatedAttribute - [ 143] = ASN1_OP_MAYBE_ACT, - [ 144] = _action(ACT_pkcs7_sig_note_set_of_authattrs), - [ 145] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // aaSequence - [ 146] = _tagn(CONT, CONS, 2), - [ 147] = _jump_target(198), - // DigestEncryptionAlgorithmIdentifier - [ 148] = ASN1_OP_MATCH, - [ 149] = _tag(UNIV, CONS, SEQ), - [ 150] = ASN1_OP_MATCH_ACT, // algorithm - [ 151] = _tag(UNIV, PRIM, OID), - [ 152] = _action(ACT_pkcs7_note_OID), - [ 153] = ASN1_OP_MATCH_ANY_OR_SKIP, // parameters - [ 154] = ASN1_OP_END_SEQ, - [ 155] = ASN1_OP_ACT, - [ 156] = _action(ACT_pkcs7_sig_note_pkey_algo), - // EncryptedDigest - [ 157] = ASN1_OP_MATCH_ACT, - [ 158] = _tag(UNIV, PRIM, OTS), - [ 159] = _action(ACT_pkcs7_sig_note_signature), - [ 160] = ASN1_OP_MATCH_JUMP_OR_SKIP, // uaSet - [ 161] = _tagn(CONT, CONS, 1), - [ 162] = _jump_target(207), - [ 163] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // uaSequence - [ 164] = _tagn(CONT, CONS, 3), - [ 165] = _jump_target(213), - [ 166] = ASN1_OP_END_SEQ_ACT, - [ 167] = _action(ACT_pkcs7_note_signed_info), - [ 168] = ASN1_OP_RETURN, - - // Name - [ 169] = ASN1_OP_MATCH, - [ 170] = _tag(UNIV, CONS, SEQ), - // RelativeDistinguishedName - [ 171] = ASN1_OP_MATCH, - [ 172] = _tag(UNIV, CONS, SET), - // AttributeValueAssertion - [ 173] = ASN1_OP_MATCH, - [ 174] = _tag(UNIV, CONS, SEQ), - [ 175] = ASN1_OP_MATCH_ACT, // attributeType - [ 176] = _tag(UNIV, PRIM, OID), - [ 177] = _action(ACT_pkcs7_note_OID), - [ 178] = ASN1_OP_MATCH_ANY, // attributeValue - [ 179] = ASN1_OP_END_SEQ, - [ 180] = ASN1_OP_END_SET_OF, - [ 181] = _jump_target(173), - [ 182] = ASN1_OP_END_SEQ_OF, - [ 183] = _jump_target(171), - [ 184] = ASN1_OP_ACT, - [ 185] = _action(ACT_pkcs7_sig_note_issuer), - // CertificateSerialNumber - [ 186] = ASN1_OP_MATCH, - [ 187] = _tag(UNIV, PRIM, INT), - [ 188] = ASN1_OP_ACT, - [ 189] = _action(ACT_pkcs7_sig_note_serial), - [ 190] = ASN1_OP_END_SEQ, - [ 191] = ASN1_OP_RETURN, - - // AuthenticatedAttribute - [ 192] = ASN1_OP_MATCH_JUMP, - [ 193] = _tag(UNIV, CONS, SEQ), - [ 194] = _jump_target(219), // --> AuthenticatedAttribute - [ 195] = ASN1_OP_END_SET_OF, - [ 196] = _jump_target(192), - [ 197] = ASN1_OP_RETURN, - - [ 198] = ASN1_OP_MATCH, // aaSequence - [ 199] = _tag(UNIV, CONS, SEQ), - // AuthenticatedAttribute - [ 200] = ASN1_OP_MATCH_JUMP, - [ 201] = _tag(UNIV, CONS, SEQ), - [ 202] = _jump_target(219), // --> AuthenticatedAttribute - [ 203] = ASN1_OP_END_SEQ_OF, - [ 204] = _jump_target(200), - [ 205] = ASN1_OP_END_SEQ, - [ 206] = ASN1_OP_RETURN, - - // UnauthenticatedAttribute - [ 207] = ASN1_OP_MATCH_JUMP, - [ 208] = _tag(UNIV, CONS, SEQ), - [ 209] = _jump_target(230), // --> UnauthenticatedAttribute - [ 210] = ASN1_OP_END_SET_OF, - [ 211] = _jump_target(207), - [ 212] = ASN1_OP_RETURN, - - // UnauthenticatedAttribute - [ 213] = ASN1_OP_MATCH_JUMP, - [ 214] = _tag(UNIV, CONS, SEQ), - [ 215] = _jump_target(230), // --> UnauthenticatedAttribute - [ 216] = ASN1_OP_END_SEQ_OF, - [ 217] = _jump_target(213), - [ 218] = ASN1_OP_RETURN, - - [ 219] = ASN1_OP_MATCH_ACT, // type - [ 220] = _tag(UNIV, PRIM, OID), - [ 221] = _action(ACT_pkcs7_note_OID), - [ 222] = ASN1_OP_MATCH, // values - [ 223] = _tag(UNIV, CONS, SET), - [ 224] = ASN1_OP_MATCH_ANY_ACT, - [ 225] = _action(ACT_pkcs7_sig_note_authenticated_attr), - [ 226] = ASN1_OP_END_SET_OF, - [ 227] = _jump_target(224), - [ 228] = ASN1_OP_END_SEQ, - [ 229] = ASN1_OP_RETURN, - - [ 230] = ASN1_OP_MATCH, // type - [ 231] = _tag(UNIV, PRIM, OID), - [ 232] = ASN1_OP_MATCH, // values - [ 233] = _tag(UNIV, CONS, SET), - [ 234] = ASN1_OP_MATCH_ANY, - [ 235] = ASN1_OP_END_SET_OF, - [ 236] = _jump_target(234), - [ 237] = ASN1_OP_END_SEQ, - [ 238] = ASN1_OP_RETURN, -}; - -const struct asn1_decoder pkcs7_decoder = { - .machine = pkcs7_machine, - .machlen = sizeof(pkcs7_machine), - .actions = pkcs7_action_table, -}; diff --git a/backport/compat/verification/pkcs7-asn1.h b/backport/compat/verification/pkcs7-asn1.h deleted file mode 100644 index b34e160..0000000 --- a/backport/compat/verification/pkcs7-asn1.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Automatically generated by asn1_compiler. Do not edit - * - * ASN.1 parser for pkcs7 - */ -#include - -extern const struct asn1_decoder pkcs7_decoder; - -extern int pkcs7_check_content_type(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_extract_cert(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_note_OID(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_note_certificate_list(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_note_content(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_note_data(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_note_signed_info(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_note_signeddata_version(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_note_signerinfo_version(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_sig_note_authenticated_attr(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_sig_note_digest_algo(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_sig_note_issuer(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_sig_note_pkey_algo(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_sig_note_serial(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_sig_note_set_of_authattrs(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_sig_note_signature(void *, size_t, unsigned char, const void *, size_t); -extern int pkcs7_sig_note_skid(void *, size_t, unsigned char, const void *, size_t); - diff --git a/backport/compat/verification/pkcs7.asn1.c b/backport/compat/verification/pkcs7.asn1.c new file mode 100644 index 0000000..d8c91f5 --- /dev/null +++ b/backport/compat/verification/pkcs7.asn1.c @@ -0,0 +1,355 @@ +/* + * Automatically generated by asn1_compiler. Do not edit + * + * ASN.1 parser for pkcs7 + */ +#include +#include "pkcs7.asn1.h" + +enum pkcs7_actions { + ACT_pkcs7_check_content_type = 0, + ACT_pkcs7_extract_cert = 1, + ACT_pkcs7_note_OID = 2, + ACT_pkcs7_note_certificate_list = 3, + ACT_pkcs7_note_content = 4, + ACT_pkcs7_note_data = 5, + ACT_pkcs7_note_signed_info = 6, + ACT_pkcs7_note_signeddata_version = 7, + ACT_pkcs7_note_signerinfo_version = 8, + ACT_pkcs7_sig_note_authenticated_attr = 9, + ACT_pkcs7_sig_note_digest_algo = 10, + ACT_pkcs7_sig_note_issuer = 11, + ACT_pkcs7_sig_note_pkey_algo = 12, + ACT_pkcs7_sig_note_serial = 13, + ACT_pkcs7_sig_note_set_of_authattrs = 14, + ACT_pkcs7_sig_note_signature = 15, + ACT_pkcs7_sig_note_skid = 16, + NR__pkcs7_actions = 17 +}; + +static const asn1_action_t pkcs7_action_table[NR__pkcs7_actions] = { + [ 0] = pkcs7_check_content_type, + [ 1] = pkcs7_extract_cert, + [ 2] = pkcs7_note_OID, + [ 3] = pkcs7_note_certificate_list, + [ 4] = pkcs7_note_content, + [ 5] = pkcs7_note_data, + [ 6] = pkcs7_note_signed_info, + [ 7] = pkcs7_note_signeddata_version, + [ 8] = pkcs7_note_signerinfo_version, + [ 9] = pkcs7_sig_note_authenticated_attr, + [ 10] = pkcs7_sig_note_digest_algo, + [ 11] = pkcs7_sig_note_issuer, + [ 12] = pkcs7_sig_note_pkey_algo, + [ 13] = pkcs7_sig_note_serial, + [ 14] = pkcs7_sig_note_set_of_authattrs, + [ 15] = pkcs7_sig_note_signature, + [ 16] = pkcs7_sig_note_skid, +}; + +static const unsigned char pkcs7_machine[] = { + // PKCS7ContentInfo + [ 0] = ASN1_OP_MATCH, + [ 1] = _tag(UNIV, CONS, SEQ), + // ContentType + [ 2] = ASN1_OP_MATCH_ACT, + [ 3] = _tag(UNIV, PRIM, OID), + [ 4] = _action(ACT_pkcs7_note_OID), + [ 5] = ASN1_OP_ACT, + [ 6] = _action(ACT_pkcs7_check_content_type), + [ 7] = ASN1_OP_MATCH_JUMP_OR_SKIP, // content + [ 8] = _tagn(CONT, CONS, 0), + [ 9] = _jump_target(12), + [ 10] = ASN1_OP_END_SEQ, + [ 11] = ASN1_OP_COMPLETE, + + // SignedData + [ 12] = ASN1_OP_MATCH, + [ 13] = _tag(UNIV, CONS, SEQ), + [ 14] = ASN1_OP_MATCH_ACT, // version + [ 15] = _tag(UNIV, PRIM, INT), + [ 16] = _action(ACT_pkcs7_note_signeddata_version), + // DigestAlgorithmIdentifiers + [ 17] = ASN1_OP_MATCH_JUMP_OR_SKIP, // daSet + [ 18] = _tag(UNIV, CONS, SET), + [ 19] = _jump_target(61), + [ 20] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // daSequence + [ 21] = _tag(UNIV, CONS, SEQ), + [ 22] = _jump_target(67), + [ 23] = ASN1_OP_COND_FAIL, + // ContentInfo + [ 24] = ASN1_OP_MATCH, + [ 25] = _tag(UNIV, CONS, SEQ), + // ContentType + [ 26] = ASN1_OP_MATCH_ACT, + [ 27] = _tag(UNIV, PRIM, OID), + [ 28] = _action(ACT_pkcs7_note_OID), + [ 29] = ASN1_OP_ACT, + [ 30] = _action(ACT_pkcs7_note_OID), + [ 31] = ASN1_OP_MATCH_JUMP_OR_SKIP, // content + [ 32] = _tagn(CONT, CONS, 0), + [ 33] = _jump_target(73), + [ 34] = ASN1_OP_END_SEQ, + [ 35] = ASN1_OP_ACT, + [ 36] = _action(ACT_pkcs7_note_content), + // ExtendedCertificatesAndCertificates + [ 37] = ASN1_OP_MATCH_JUMP_OR_SKIP, // certSet + [ 38] = _tagn(CONT, CONS, 0), + [ 39] = _jump_target(77), // --> ExtendedCertificatesAndCertificates + // Certificates + [ 40] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // certSequence + [ 41] = _tagn(CONT, CONS, 2), + [ 42] = _jump_target(85), // --> Certificates + [ 43] = ASN1_OP_ACT, + [ 44] = _action(ACT_pkcs7_note_certificate_list), + // CertificateRevocationLists + [ 45] = ASN1_OP_MATCH_JUMP_OR_SKIP, // crlSet + [ 46] = _tagn(CONT, CONS, 1), + [ 47] = _jump_target(90), // --> CertificateRevocationLists + // CRLSequence + [ 48] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // crlSequence + [ 49] = _tagn(CONT, CONS, 3), + [ 50] = _jump_target(96), // --> CRLSequence + // SignerInfos + [ 51] = ASN1_OP_MATCH_JUMP_OR_SKIP, // siSet + [ 52] = _tag(UNIV, CONS, SET), + [ 53] = _jump_target(102), + [ 54] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // siSequence + [ 55] = _tag(UNIV, CONS, SEQ), + [ 56] = _jump_target(108), + [ 57] = ASN1_OP_COND_FAIL, + [ 58] = ASN1_OP_END_SEQ, + [ 59] = ASN1_OP_END_SEQ, + [ 60] = ASN1_OP_RETURN, + + // DigestAlgorithmIdentifier + [ 61] = ASN1_OP_MATCH_JUMP, + [ 62] = _tag(UNIV, CONS, SEQ), + [ 63] = _jump_target(114), // --> DigestAlgorithmIdentifier + [ 64] = ASN1_OP_END_SET_OF, + [ 65] = _jump_target(61), + [ 66] = ASN1_OP_RETURN, + + // DigestAlgorithmIdentifier + [ 67] = ASN1_OP_MATCH_JUMP, + [ 68] = _tag(UNIV, CONS, SEQ), + [ 69] = _jump_target(114), // --> DigestAlgorithmIdentifier + [ 70] = ASN1_OP_END_SEQ_OF, + [ 71] = _jump_target(67), + [ 72] = ASN1_OP_RETURN, + + // Data + [ 73] = ASN1_OP_MATCH_ANY_ACT, + [ 74] = _action(ACT_pkcs7_note_data), + [ 75] = ASN1_OP_END_SEQ, + [ 76] = ASN1_OP_RETURN, + + // ExtendedCertificateOrCertificate + // Certificate + [ 77] = ASN1_OP_MATCH_ANY_ACT_OR_SKIP, + [ 78] = _action(ACT_pkcs7_extract_cert), + // ExtendedCertificate + // Certificate + [ 79] = ASN1_OP_COND_MATCH_ANY_ACT_OR_SKIP, + [ 80] = _action(ACT_pkcs7_extract_cert), + [ 81] = ASN1_OP_COND_FAIL, + [ 82] = ASN1_OP_END_SET_OF, + [ 83] = _jump_target(77), + [ 84] = ASN1_OP_RETURN, + + // Certificate + [ 85] = ASN1_OP_MATCH_ANY_ACT, + [ 86] = _action(ACT_pkcs7_extract_cert), + [ 87] = ASN1_OP_END_SEQ_OF, + [ 88] = _jump_target(85), + [ 89] = ASN1_OP_RETURN, + + // CertificateList + [ 90] = ASN1_OP_MATCH_JUMP, + [ 91] = _tag(UNIV, CONS, SEQ), + [ 92] = _jump_target(120), // --> CertificateList + [ 93] = ASN1_OP_END_SET_OF, + [ 94] = _jump_target(90), + [ 95] = ASN1_OP_RETURN, + + // CertificateList + [ 96] = ASN1_OP_MATCH_JUMP, + [ 97] = _tag(UNIV, CONS, SEQ), + [ 98] = _jump_target(120), // --> CertificateList + [ 99] = ASN1_OP_END_SEQ_OF, + [ 100] = _jump_target(96), + [ 101] = ASN1_OP_RETURN, + + // SignerInfo + [ 102] = ASN1_OP_MATCH_JUMP, + [ 103] = _tag(UNIV, CONS, SEQ), + [ 104] = _jump_target(125), // --> SignerInfo + [ 105] = ASN1_OP_END_SET_OF, + [ 106] = _jump_target(102), + [ 107] = ASN1_OP_RETURN, + + // SignerInfo + [ 108] = ASN1_OP_MATCH_JUMP, + [ 109] = _tag(UNIV, CONS, SEQ), + [ 110] = _jump_target(125), // --> SignerInfo + [ 111] = ASN1_OP_END_SEQ_OF, + [ 112] = _jump_target(108), + [ 113] = ASN1_OP_RETURN, + + [ 114] = ASN1_OP_MATCH_ACT, // algorithm + [ 115] = _tag(UNIV, PRIM, OID), + [ 116] = _action(ACT_pkcs7_note_OID), + [ 117] = ASN1_OP_MATCH_ANY_OR_SKIP, // parameters + [ 118] = ASN1_OP_END_SEQ, + [ 119] = ASN1_OP_RETURN, + + // Certificate + [ 120] = ASN1_OP_MATCH_ANY_ACT, + [ 121] = _action(ACT_pkcs7_extract_cert), + [ 122] = ASN1_OP_END_SEQ_OF, + [ 123] = _jump_target(120), + [ 124] = ASN1_OP_RETURN, + + [ 125] = ASN1_OP_MATCH_ACT, // version + [ 126] = _tag(UNIV, PRIM, INT), + [ 127] = _action(ACT_pkcs7_note_signerinfo_version), + // SignerIdentifier + // IssuerAndSerialNumber + [ 128] = ASN1_OP_MATCH_JUMP_OR_SKIP, // issuerAndSerialNumber + [ 129] = _tag(UNIV, CONS, SEQ), + [ 130] = _jump_target(169), // --> IssuerAndSerialNumber + // SubjectKeyIdentifier + [ 131] = ASN1_OP_COND_MATCH_ACT_OR_SKIP, // subjectKeyIdentifier + [ 132] = _tagn(CONT, PRIM, 0), + [ 133] = _action(ACT_pkcs7_sig_note_skid), + [ 134] = ASN1_OP_COND_FAIL, + // DigestAlgorithmIdentifier + [ 135] = ASN1_OP_MATCH_JUMP, + [ 136] = _tag(UNIV, CONS, SEQ), + [ 137] = _jump_target(114), // --> DigestAlgorithmIdentifier + [ 138] = ASN1_OP_ACT, + [ 139] = _action(ACT_pkcs7_sig_note_digest_algo), + // SetOfAuthenticatedAttribute + [ 140] = ASN1_OP_MATCH_JUMP_OR_SKIP, // aaSet + [ 141] = _tagn(CONT, CONS, 0), + [ 142] = _jump_target(192), // --> SetOfAuthenticatedAttribute + [ 143] = ASN1_OP_MAYBE_ACT, + [ 144] = _action(ACT_pkcs7_sig_note_set_of_authattrs), + [ 145] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // aaSequence + [ 146] = _tagn(CONT, CONS, 2), + [ 147] = _jump_target(198), + // DigestEncryptionAlgorithmIdentifier + [ 148] = ASN1_OP_MATCH, + [ 149] = _tag(UNIV, CONS, SEQ), + [ 150] = ASN1_OP_MATCH_ACT, // algorithm + [ 151] = _tag(UNIV, PRIM, OID), + [ 152] = _action(ACT_pkcs7_note_OID), + [ 153] = ASN1_OP_MATCH_ANY_OR_SKIP, // parameters + [ 154] = ASN1_OP_END_SEQ, + [ 155] = ASN1_OP_ACT, + [ 156] = _action(ACT_pkcs7_sig_note_pkey_algo), + // EncryptedDigest + [ 157] = ASN1_OP_MATCH_ACT, + [ 158] = _tag(UNIV, PRIM, OTS), + [ 159] = _action(ACT_pkcs7_sig_note_signature), + [ 160] = ASN1_OP_MATCH_JUMP_OR_SKIP, // uaSet + [ 161] = _tagn(CONT, CONS, 1), + [ 162] = _jump_target(207), + [ 163] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // uaSequence + [ 164] = _tagn(CONT, CONS, 3), + [ 165] = _jump_target(213), + [ 166] = ASN1_OP_END_SEQ_ACT, + [ 167] = _action(ACT_pkcs7_note_signed_info), + [ 168] = ASN1_OP_RETURN, + + // Name + [ 169] = ASN1_OP_MATCH, + [ 170] = _tag(UNIV, CONS, SEQ), + // RelativeDistinguishedName + [ 171] = ASN1_OP_MATCH, + [ 172] = _tag(UNIV, CONS, SET), + // AttributeValueAssertion + [ 173] = ASN1_OP_MATCH, + [ 174] = _tag(UNIV, CONS, SEQ), + [ 175] = ASN1_OP_MATCH_ACT, // attributeType + [ 176] = _tag(UNIV, PRIM, OID), + [ 177] = _action(ACT_pkcs7_note_OID), + [ 178] = ASN1_OP_MATCH_ANY, // attributeValue + [ 179] = ASN1_OP_END_SEQ, + [ 180] = ASN1_OP_END_SET_OF, + [ 181] = _jump_target(173), + [ 182] = ASN1_OP_END_SEQ_OF, + [ 183] = _jump_target(171), + [ 184] = ASN1_OP_ACT, + [ 185] = _action(ACT_pkcs7_sig_note_issuer), + // CertificateSerialNumber + [ 186] = ASN1_OP_MATCH, + [ 187] = _tag(UNIV, PRIM, INT), + [ 188] = ASN1_OP_ACT, + [ 189] = _action(ACT_pkcs7_sig_note_serial), + [ 190] = ASN1_OP_END_SEQ, + [ 191] = ASN1_OP_RETURN, + + // AuthenticatedAttribute + [ 192] = ASN1_OP_MATCH_JUMP, + [ 193] = _tag(UNIV, CONS, SEQ), + [ 194] = _jump_target(219), // --> AuthenticatedAttribute + [ 195] = ASN1_OP_END_SET_OF, + [ 196] = _jump_target(192), + [ 197] = ASN1_OP_RETURN, + + [ 198] = ASN1_OP_MATCH, // aaSequence + [ 199] = _tag(UNIV, CONS, SEQ), + // AuthenticatedAttribute + [ 200] = ASN1_OP_MATCH_JUMP, + [ 201] = _tag(UNIV, CONS, SEQ), + [ 202] = _jump_target(219), // --> AuthenticatedAttribute + [ 203] = ASN1_OP_END_SEQ_OF, + [ 204] = _jump_target(200), + [ 205] = ASN1_OP_END_SEQ, + [ 206] = ASN1_OP_RETURN, + + // UnauthenticatedAttribute + [ 207] = ASN1_OP_MATCH_JUMP, + [ 208] = _tag(UNIV, CONS, SEQ), + [ 209] = _jump_target(230), // --> UnauthenticatedAttribute + [ 210] = ASN1_OP_END_SET_OF, + [ 211] = _jump_target(207), + [ 212] = ASN1_OP_RETURN, + + // UnauthenticatedAttribute + [ 213] = ASN1_OP_MATCH_JUMP, + [ 214] = _tag(UNIV, CONS, SEQ), + [ 215] = _jump_target(230), // --> UnauthenticatedAttribute + [ 216] = ASN1_OP_END_SEQ_OF, + [ 217] = _jump_target(213), + [ 218] = ASN1_OP_RETURN, + + [ 219] = ASN1_OP_MATCH_ACT, // type + [ 220] = _tag(UNIV, PRIM, OID), + [ 221] = _action(ACT_pkcs7_note_OID), + [ 222] = ASN1_OP_MATCH, // values + [ 223] = _tag(UNIV, CONS, SET), + [ 224] = ASN1_OP_MATCH_ANY_ACT, + [ 225] = _action(ACT_pkcs7_sig_note_authenticated_attr), + [ 226] = ASN1_OP_END_SET_OF, + [ 227] = _jump_target(224), + [ 228] = ASN1_OP_END_SEQ, + [ 229] = ASN1_OP_RETURN, + + [ 230] = ASN1_OP_MATCH, // type + [ 231] = _tag(UNIV, PRIM, OID), + [ 232] = ASN1_OP_MATCH, // values + [ 233] = _tag(UNIV, CONS, SET), + [ 234] = ASN1_OP_MATCH_ANY, + [ 235] = ASN1_OP_END_SET_OF, + [ 236] = _jump_target(234), + [ 237] = ASN1_OP_END_SEQ, + [ 238] = ASN1_OP_RETURN, +}; + +const struct asn1_decoder pkcs7_decoder = { + .machine = pkcs7_machine, + .machlen = sizeof(pkcs7_machine), + .actions = pkcs7_action_table, +}; diff --git a/backport/compat/verification/pkcs7.asn1.h b/backport/compat/verification/pkcs7.asn1.h new file mode 100644 index 0000000..b34e160 --- /dev/null +++ b/backport/compat/verification/pkcs7.asn1.h @@ -0,0 +1,27 @@ +/* + * Automatically generated by asn1_compiler. Do not edit + * + * ASN.1 parser for pkcs7 + */ +#include + +extern const struct asn1_decoder pkcs7_decoder; + +extern int pkcs7_check_content_type(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_extract_cert(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_note_OID(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_note_certificate_list(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_note_content(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_note_data(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_note_signed_info(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_note_signeddata_version(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_note_signerinfo_version(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_sig_note_authenticated_attr(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_sig_note_digest_algo(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_sig_note_issuer(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_sig_note_pkey_algo(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_sig_note_serial(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_sig_note_set_of_authattrs(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_sig_note_signature(void *, size_t, unsigned char, const void *, size_t); +extern int pkcs7_sig_note_skid(void *, size_t, unsigned char, const void *, size_t); + diff --git a/backport/compat/verification/public_key.c b/backport/compat/verification/public_key.c index 10d1672..83a6935 100644 --- a/backport/compat/verification/public_key.c +++ b/backport/compat/verification/public_key.c @@ -18,7 +18,7 @@ #include #include #include -#include "rsapubkey-asn1.h" +#include "rsapubkey.asn1.h" #include "mbedtls/rsa.h" #include "mbedtls/md.h" diff --git a/backport/compat/verification/rsapubkey-asn1.c b/backport/compat/verification/rsapubkey-asn1.c deleted file mode 100644 index 84ab7f4..0000000 --- a/backport/compat/verification/rsapubkey-asn1.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Automatically generated by asn1_compiler. Do not edit - * - * ASN.1 parser for rsapubkey - */ -#include -#include "rsapubkey-asn1.h" - -enum rsapubkey_actions { - ACT_rsa_get_e = 0, - ACT_rsa_get_n = 1, - NR__rsapubkey_actions = 2 -}; - -static const asn1_action_t rsapubkey_action_table[NR__rsapubkey_actions] = { - [ 0] = rsa_get_e, - [ 1] = rsa_get_n, -}; - -static const unsigned char rsapubkey_machine[] = { - // RsaPubKey - [ 0] = ASN1_OP_MATCH, - [ 1] = _tag(UNIV, CONS, SEQ), - [ 2] = ASN1_OP_MATCH_ACT, // n - [ 3] = _tag(UNIV, PRIM, INT), - [ 4] = _action(ACT_rsa_get_n), - [ 5] = ASN1_OP_MATCH_ACT, // e - [ 6] = _tag(UNIV, PRIM, INT), - [ 7] = _action(ACT_rsa_get_e), - [ 8] = ASN1_OP_END_SEQ, - [ 9] = ASN1_OP_COMPLETE, -}; - -const struct asn1_decoder rsapubkey_decoder = { - .machine = rsapubkey_machine, - .machlen = sizeof(rsapubkey_machine), - .actions = rsapubkey_action_table, -}; diff --git a/backport/compat/verification/rsapubkey-asn1.h b/backport/compat/verification/rsapubkey-asn1.h deleted file mode 100644 index 81a82d4..0000000 --- a/backport/compat/verification/rsapubkey-asn1.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Automatically generated by asn1_compiler. Do not edit - * - * ASN.1 parser for rsapubkey - */ -#include - -extern const struct asn1_decoder rsapubkey_decoder; - -#define rsa_get_e LINUX_BACKPORT(rsa_get_e) -#define rsa_get_n LINUX_BACKPORT(rsa_get_n) - -extern int rsa_get_e(void *, size_t, unsigned char, const void *, size_t); -extern int rsa_get_n(void *, size_t, unsigned char, const void *, size_t); - diff --git a/backport/compat/verification/rsapubkey.asn1.c b/backport/compat/verification/rsapubkey.asn1.c new file mode 100644 index 0000000..6bb1994 --- /dev/null +++ b/backport/compat/verification/rsapubkey.asn1.c @@ -0,0 +1,38 @@ +/* + * Automatically generated by asn1_compiler. Do not edit + * + * ASN.1 parser for rsapubkey + */ +#include +#include "rsapubkey.asn1.h" + +enum rsapubkey_actions { + ACT_rsa_get_e = 0, + ACT_rsa_get_n = 1, + NR__rsapubkey_actions = 2 +}; + +static const asn1_action_t rsapubkey_action_table[NR__rsapubkey_actions] = { + [ 0] = rsa_get_e, + [ 1] = rsa_get_n, +}; + +static const unsigned char rsapubkey_machine[] = { + // RsaPubKey + [ 0] = ASN1_OP_MATCH, + [ 1] = _tag(UNIV, CONS, SEQ), + [ 2] = ASN1_OP_MATCH_ACT, // n + [ 3] = _tag(UNIV, PRIM, INT), + [ 4] = _action(ACT_rsa_get_n), + [ 5] = ASN1_OP_MATCH_ACT, // e + [ 6] = _tag(UNIV, PRIM, INT), + [ 7] = _action(ACT_rsa_get_e), + [ 8] = ASN1_OP_END_SEQ, + [ 9] = ASN1_OP_COMPLETE, +}; + +const struct asn1_decoder rsapubkey_decoder = { + .machine = rsapubkey_machine, + .machlen = sizeof(rsapubkey_machine), + .actions = rsapubkey_action_table, +}; diff --git a/backport/compat/verification/rsapubkey.asn1.h b/backport/compat/verification/rsapubkey.asn1.h new file mode 100644 index 0000000..81a82d4 --- /dev/null +++ b/backport/compat/verification/rsapubkey.asn1.h @@ -0,0 +1,15 @@ +/* + * Automatically generated by asn1_compiler. Do not edit + * + * ASN.1 parser for rsapubkey + */ +#include + +extern const struct asn1_decoder rsapubkey_decoder; + +#define rsa_get_e LINUX_BACKPORT(rsa_get_e) +#define rsa_get_n LINUX_BACKPORT(rsa_get_n) + +extern int rsa_get_e(void *, size_t, unsigned char, const void *, size_t); +extern int rsa_get_n(void *, size_t, unsigned char, const void *, size_t); + diff --git a/backport/compat/verification/x509-asn1.c b/backport/compat/verification/x509-asn1.c deleted file mode 100644 index 89aaa66..0000000 --- a/backport/compat/verification/x509-asn1.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Automatically generated by asn1_compiler. Do not edit - * - * ASN.1 parser for x509 - */ -#include -#include "x509-asn1.h" - -enum x509_actions { - ACT_x509_extract_key_data = 0, - ACT_x509_extract_name_segment = 1, - ACT_x509_note_OID = 2, - ACT_x509_note_issuer = 3, - ACT_x509_note_not_after = 4, - ACT_x509_note_not_before = 5, - ACT_x509_note_pkey_algo = 6, - ACT_x509_note_serial = 7, - ACT_x509_note_signature = 8, - ACT_x509_note_subject = 9, - ACT_x509_note_tbs_certificate = 10, - ACT_x509_process_extension = 11, - NR__x509_actions = 12 -}; - -static const asn1_action_t x509_action_table[NR__x509_actions] = { - [ 0] = x509_extract_key_data, - [ 1] = x509_extract_name_segment, - [ 2] = x509_note_OID, - [ 3] = x509_note_issuer, - [ 4] = x509_note_not_after, - [ 5] = x509_note_not_before, - [ 6] = x509_note_pkey_algo, - [ 7] = x509_note_serial, - [ 8] = x509_note_signature, - [ 9] = x509_note_subject, - [ 10] = x509_note_tbs_certificate, - [ 11] = x509_process_extension, -}; - -static const unsigned char x509_machine[] = { - // Certificate - [ 0] = ASN1_OP_MATCH, - [ 1] = _tag(UNIV, CONS, SEQ), - // TBSCertificate - [ 2] = ASN1_OP_MATCH, - [ 3] = _tag(UNIV, CONS, SEQ), - [ 4] = ASN1_OP_MATCH_JUMP_OR_SKIP, // version - [ 5] = _tagn(CONT, CONS, 0), - [ 6] = _jump_target(70), - // CertificateSerialNumber - [ 7] = ASN1_OP_MATCH, - [ 8] = _tag(UNIV, PRIM, INT), - [ 9] = ASN1_OP_ACT, - [ 10] = _action(ACT_x509_note_serial), - // AlgorithmIdentifier - [ 11] = ASN1_OP_MATCH_JUMP, - [ 12] = _tag(UNIV, CONS, SEQ), - [ 13] = _jump_target(74), // --> AlgorithmIdentifier - [ 14] = ASN1_OP_ACT, - [ 15] = _action(ACT_x509_note_pkey_algo), - // Name - [ 16] = ASN1_OP_MATCH_JUMP, - [ 17] = _tag(UNIV, CONS, SEQ), - [ 18] = _jump_target(80), // --> Name - [ 19] = ASN1_OP_ACT, - [ 20] = _action(ACT_x509_note_issuer), - // Validity - [ 21] = ASN1_OP_MATCH, - [ 22] = _tag(UNIV, CONS, SEQ), - // Time - [ 23] = ASN1_OP_MATCH_OR_SKIP, // utcTime - [ 24] = _tag(UNIV, PRIM, UNITIM), - [ 25] = ASN1_OP_COND_MATCH_OR_SKIP, // generalTime - [ 26] = _tag(UNIV, PRIM, GENTIM), - [ 27] = ASN1_OP_COND_FAIL, - [ 28] = ASN1_OP_ACT, - [ 29] = _action(ACT_x509_note_not_before), - // Time - [ 30] = ASN1_OP_MATCH_OR_SKIP, // utcTime - [ 31] = _tag(UNIV, PRIM, UNITIM), - [ 32] = ASN1_OP_COND_MATCH_OR_SKIP, // generalTime - [ 33] = _tag(UNIV, PRIM, GENTIM), - [ 34] = ASN1_OP_COND_FAIL, - [ 35] = ASN1_OP_ACT, - [ 36] = _action(ACT_x509_note_not_after), - [ 37] = ASN1_OP_END_SEQ, - // Name - [ 38] = ASN1_OP_MATCH_JUMP, - [ 39] = _tag(UNIV, CONS, SEQ), - [ 40] = _jump_target(80), // --> Name - [ 41] = ASN1_OP_ACT, - [ 42] = _action(ACT_x509_note_subject), - // SubjectPublicKeyInfo - [ 43] = ASN1_OP_MATCH, - [ 44] = _tag(UNIV, CONS, SEQ), - // AlgorithmIdentifier - [ 45] = ASN1_OP_MATCH_JUMP, - [ 46] = _tag(UNIV, CONS, SEQ), - [ 47] = _jump_target(74), // --> AlgorithmIdentifier - [ 48] = ASN1_OP_MATCH_ACT, // subjectPublicKey - [ 49] = _tag(UNIV, PRIM, BTS), - [ 50] = _action(ACT_x509_extract_key_data), - [ 51] = ASN1_OP_END_SEQ, - // UniqueIdentifier - [ 52] = ASN1_OP_MATCH_OR_SKIP, // issuerUniqueID - [ 53] = _tagn(CONT, PRIM, 1), - // UniqueIdentifier - [ 54] = ASN1_OP_MATCH_OR_SKIP, // subjectUniqueID - [ 55] = _tagn(CONT, PRIM, 2), - [ 56] = ASN1_OP_MATCH_JUMP_OR_SKIP, // extensions - [ 57] = _tagn(CONT, CONS, 3), - [ 58] = _jump_target(95), - [ 59] = ASN1_OP_END_SEQ, - [ 60] = ASN1_OP_ACT, - [ 61] = _action(ACT_x509_note_tbs_certificate), - // AlgorithmIdentifier - [ 62] = ASN1_OP_MATCH_JUMP, - [ 63] = _tag(UNIV, CONS, SEQ), - [ 64] = _jump_target(74), // --> AlgorithmIdentifier - [ 65] = ASN1_OP_MATCH_ACT, // signature - [ 66] = _tag(UNIV, PRIM, BTS), - [ 67] = _action(ACT_x509_note_signature), - [ 68] = ASN1_OP_END_SEQ, - [ 69] = ASN1_OP_COMPLETE, - - // Version - [ 70] = ASN1_OP_MATCH, - [ 71] = _tag(UNIV, PRIM, INT), - [ 72] = ASN1_OP_END_SEQ, - [ 73] = ASN1_OP_RETURN, - - [ 74] = ASN1_OP_MATCH_ACT, // algorithm - [ 75] = _tag(UNIV, PRIM, OID), - [ 76] = _action(ACT_x509_note_OID), - [ 77] = ASN1_OP_MATCH_ANY_OR_SKIP, // parameters - [ 78] = ASN1_OP_END_SEQ, - [ 79] = ASN1_OP_RETURN, - - // RelativeDistinguishedName - [ 80] = ASN1_OP_MATCH, - [ 81] = _tag(UNIV, CONS, SET), - // AttributeValueAssertion - [ 82] = ASN1_OP_MATCH, - [ 83] = _tag(UNIV, CONS, SEQ), - [ 84] = ASN1_OP_MATCH_ACT, // attributeType - [ 85] = _tag(UNIV, PRIM, OID), - [ 86] = _action(ACT_x509_note_OID), - [ 87] = ASN1_OP_MATCH_ANY_ACT, // attributeValue - [ 88] = _action(ACT_x509_extract_name_segment), - [ 89] = ASN1_OP_END_SEQ, - [ 90] = ASN1_OP_END_SET_OF, - [ 91] = _jump_target(82), - [ 92] = ASN1_OP_END_SEQ_OF, - [ 93] = _jump_target(80), - [ 94] = ASN1_OP_RETURN, - - // Extensions - [ 95] = ASN1_OP_MATCH, - [ 96] = _tag(UNIV, CONS, SEQ), - // Extension - [ 97] = ASN1_OP_MATCH, - [ 98] = _tag(UNIV, CONS, SEQ), - [ 99] = ASN1_OP_MATCH_ACT, // extnid - [ 100] = _tag(UNIV, PRIM, OID), - [ 101] = _action(ACT_x509_note_OID), - [ 102] = ASN1_OP_MATCH_OR_SKIP, // critical - [ 103] = _tag(UNIV, PRIM, BOOL), - [ 104] = ASN1_OP_MATCH_ACT, // extnValue - [ 105] = _tag(UNIV, PRIM, OTS), - [ 106] = _action(ACT_x509_process_extension), - [ 107] = ASN1_OP_END_SEQ, - [ 108] = ASN1_OP_END_SEQ_OF, - [ 109] = _jump_target(97), - [ 110] = ASN1_OP_END_SEQ, - [ 111] = ASN1_OP_RETURN, -}; - -const struct asn1_decoder x509_decoder = { - .machine = x509_machine, - .machlen = sizeof(x509_machine), - .actions = x509_action_table, -}; diff --git a/backport/compat/verification/x509-asn1.h b/backport/compat/verification/x509-asn1.h deleted file mode 100644 index 4f32a25..0000000 --- a/backport/compat/verification/x509-asn1.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Automatically generated by asn1_compiler. Do not edit - * - * ASN.1 parser for x509 - */ -#include - -extern const struct asn1_decoder x509_decoder; - -extern int x509_extract_key_data(void *, size_t, unsigned char, const void *, size_t); -extern int x509_extract_name_segment(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_OID(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_issuer(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_not_after(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_not_before(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_pkey_algo(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_serial(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_signature(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_subject(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_tbs_certificate(void *, size_t, unsigned char, const void *, size_t); -extern int x509_process_extension(void *, size_t, unsigned char, const void *, size_t); - diff --git a/backport/compat/verification/x509.asn1.c b/backport/compat/verification/x509.asn1.c new file mode 100644 index 0000000..316c10e --- /dev/null +++ b/backport/compat/verification/x509.asn1.c @@ -0,0 +1,182 @@ +/* + * Automatically generated by asn1_compiler. Do not edit + * + * ASN.1 parser for x509 + */ +#include +#include "x509.asn1.h" + +enum x509_actions { + ACT_x509_extract_key_data = 0, + ACT_x509_extract_name_segment = 1, + ACT_x509_note_OID = 2, + ACT_x509_note_issuer = 3, + ACT_x509_note_not_after = 4, + ACT_x509_note_not_before = 5, + ACT_x509_note_pkey_algo = 6, + ACT_x509_note_serial = 7, + ACT_x509_note_signature = 8, + ACT_x509_note_subject = 9, + ACT_x509_note_tbs_certificate = 10, + ACT_x509_process_extension = 11, + NR__x509_actions = 12 +}; + +static const asn1_action_t x509_action_table[NR__x509_actions] = { + [ 0] = x509_extract_key_data, + [ 1] = x509_extract_name_segment, + [ 2] = x509_note_OID, + [ 3] = x509_note_issuer, + [ 4] = x509_note_not_after, + [ 5] = x509_note_not_before, + [ 6] = x509_note_pkey_algo, + [ 7] = x509_note_serial, + [ 8] = x509_note_signature, + [ 9] = x509_note_subject, + [ 10] = x509_note_tbs_certificate, + [ 11] = x509_process_extension, +}; + +static const unsigned char x509_machine[] = { + // Certificate + [ 0] = ASN1_OP_MATCH, + [ 1] = _tag(UNIV, CONS, SEQ), + // TBSCertificate + [ 2] = ASN1_OP_MATCH, + [ 3] = _tag(UNIV, CONS, SEQ), + [ 4] = ASN1_OP_MATCH_JUMP_OR_SKIP, // version + [ 5] = _tagn(CONT, CONS, 0), + [ 6] = _jump_target(70), + // CertificateSerialNumber + [ 7] = ASN1_OP_MATCH, + [ 8] = _tag(UNIV, PRIM, INT), + [ 9] = ASN1_OP_ACT, + [ 10] = _action(ACT_x509_note_serial), + // AlgorithmIdentifier + [ 11] = ASN1_OP_MATCH_JUMP, + [ 12] = _tag(UNIV, CONS, SEQ), + [ 13] = _jump_target(74), // --> AlgorithmIdentifier + [ 14] = ASN1_OP_ACT, + [ 15] = _action(ACT_x509_note_pkey_algo), + // Name + [ 16] = ASN1_OP_MATCH_JUMP, + [ 17] = _tag(UNIV, CONS, SEQ), + [ 18] = _jump_target(80), // --> Name + [ 19] = ASN1_OP_ACT, + [ 20] = _action(ACT_x509_note_issuer), + // Validity + [ 21] = ASN1_OP_MATCH, + [ 22] = _tag(UNIV, CONS, SEQ), + // Time + [ 23] = ASN1_OP_MATCH_OR_SKIP, // utcTime + [ 24] = _tag(UNIV, PRIM, UNITIM), + [ 25] = ASN1_OP_COND_MATCH_OR_SKIP, // generalTime + [ 26] = _tag(UNIV, PRIM, GENTIM), + [ 27] = ASN1_OP_COND_FAIL, + [ 28] = ASN1_OP_ACT, + [ 29] = _action(ACT_x509_note_not_before), + // Time + [ 30] = ASN1_OP_MATCH_OR_SKIP, // utcTime + [ 31] = _tag(UNIV, PRIM, UNITIM), + [ 32] = ASN1_OP_COND_MATCH_OR_SKIP, // generalTime + [ 33] = _tag(UNIV, PRIM, GENTIM), + [ 34] = ASN1_OP_COND_FAIL, + [ 35] = ASN1_OP_ACT, + [ 36] = _action(ACT_x509_note_not_after), + [ 37] = ASN1_OP_END_SEQ, + // Name + [ 38] = ASN1_OP_MATCH_JUMP, + [ 39] = _tag(UNIV, CONS, SEQ), + [ 40] = _jump_target(80), // --> Name + [ 41] = ASN1_OP_ACT, + [ 42] = _action(ACT_x509_note_subject), + // SubjectPublicKeyInfo + [ 43] = ASN1_OP_MATCH, + [ 44] = _tag(UNIV, CONS, SEQ), + // AlgorithmIdentifier + [ 45] = ASN1_OP_MATCH_JUMP, + [ 46] = _tag(UNIV, CONS, SEQ), + [ 47] = _jump_target(74), // --> AlgorithmIdentifier + [ 48] = ASN1_OP_MATCH_ACT, // subjectPublicKey + [ 49] = _tag(UNIV, PRIM, BTS), + [ 50] = _action(ACT_x509_extract_key_data), + [ 51] = ASN1_OP_END_SEQ, + // UniqueIdentifier + [ 52] = ASN1_OP_MATCH_OR_SKIP, // issuerUniqueID + [ 53] = _tagn(CONT, PRIM, 1), + // UniqueIdentifier + [ 54] = ASN1_OP_MATCH_OR_SKIP, // subjectUniqueID + [ 55] = _tagn(CONT, PRIM, 2), + [ 56] = ASN1_OP_MATCH_JUMP_OR_SKIP, // extensions + [ 57] = _tagn(CONT, CONS, 3), + [ 58] = _jump_target(95), + [ 59] = ASN1_OP_END_SEQ, + [ 60] = ASN1_OP_ACT, + [ 61] = _action(ACT_x509_note_tbs_certificate), + // AlgorithmIdentifier + [ 62] = ASN1_OP_MATCH_JUMP, + [ 63] = _tag(UNIV, CONS, SEQ), + [ 64] = _jump_target(74), // --> AlgorithmIdentifier + [ 65] = ASN1_OP_MATCH_ACT, // signature + [ 66] = _tag(UNIV, PRIM, BTS), + [ 67] = _action(ACT_x509_note_signature), + [ 68] = ASN1_OP_END_SEQ, + [ 69] = ASN1_OP_COMPLETE, + + // Version + [ 70] = ASN1_OP_MATCH, + [ 71] = _tag(UNIV, PRIM, INT), + [ 72] = ASN1_OP_END_SEQ, + [ 73] = ASN1_OP_RETURN, + + [ 74] = ASN1_OP_MATCH_ACT, // algorithm + [ 75] = _tag(UNIV, PRIM, OID), + [ 76] = _action(ACT_x509_note_OID), + [ 77] = ASN1_OP_MATCH_ANY_OR_SKIP, // parameters + [ 78] = ASN1_OP_END_SEQ, + [ 79] = ASN1_OP_RETURN, + + // RelativeDistinguishedName + [ 80] = ASN1_OP_MATCH, + [ 81] = _tag(UNIV, CONS, SET), + // AttributeValueAssertion + [ 82] = ASN1_OP_MATCH, + [ 83] = _tag(UNIV, CONS, SEQ), + [ 84] = ASN1_OP_MATCH_ACT, // attributeType + [ 85] = _tag(UNIV, PRIM, OID), + [ 86] = _action(ACT_x509_note_OID), + [ 87] = ASN1_OP_MATCH_ANY_ACT, // attributeValue + [ 88] = _action(ACT_x509_extract_name_segment), + [ 89] = ASN1_OP_END_SEQ, + [ 90] = ASN1_OP_END_SET_OF, + [ 91] = _jump_target(82), + [ 92] = ASN1_OP_END_SEQ_OF, + [ 93] = _jump_target(80), + [ 94] = ASN1_OP_RETURN, + + // Extensions + [ 95] = ASN1_OP_MATCH, + [ 96] = _tag(UNIV, CONS, SEQ), + // Extension + [ 97] = ASN1_OP_MATCH, + [ 98] = _tag(UNIV, CONS, SEQ), + [ 99] = ASN1_OP_MATCH_ACT, // extnid + [ 100] = _tag(UNIV, PRIM, OID), + [ 101] = _action(ACT_x509_note_OID), + [ 102] = ASN1_OP_MATCH_OR_SKIP, // critical + [ 103] = _tag(UNIV, PRIM, BOOL), + [ 104] = ASN1_OP_MATCH_ACT, // extnValue + [ 105] = _tag(UNIV, PRIM, OTS), + [ 106] = _action(ACT_x509_process_extension), + [ 107] = ASN1_OP_END_SEQ, + [ 108] = ASN1_OP_END_SEQ_OF, + [ 109] = _jump_target(97), + [ 110] = ASN1_OP_END_SEQ, + [ 111] = ASN1_OP_RETURN, +}; + +const struct asn1_decoder x509_decoder = { + .machine = x509_machine, + .machlen = sizeof(x509_machine), + .actions = x509_action_table, +}; diff --git a/backport/compat/verification/x509.asn1.h b/backport/compat/verification/x509.asn1.h new file mode 100644 index 0000000..4f32a25 --- /dev/null +++ b/backport/compat/verification/x509.asn1.h @@ -0,0 +1,22 @@ +/* + * Automatically generated by asn1_compiler. Do not edit + * + * ASN.1 parser for x509 + */ +#include + +extern const struct asn1_decoder x509_decoder; + +extern int x509_extract_key_data(void *, size_t, unsigned char, const void *, size_t); +extern int x509_extract_name_segment(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_OID(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_issuer(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_not_after(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_not_before(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_pkey_algo(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_serial(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_signature(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_subject(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_tbs_certificate(void *, size_t, unsigned char, const void *, size_t); +extern int x509_process_extension(void *, size_t, unsigned char, const void *, size_t); + diff --git a/backport/compat/verification/x509_akid-asn1.c b/backport/compat/verification/x509_akid-asn1.c deleted file mode 100644 index dd3c6c2..0000000 --- a/backport/compat/verification/x509_akid-asn1.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Automatically generated by asn1_compiler. Do not edit - * - * ASN.1 parser for x509_akid - */ -#include -#include "x509_akid-asn1.h" - -enum x509_akid_actions { - ACT_x509_akid_note_kid = 0, - ACT_x509_akid_note_name = 1, - ACT_x509_akid_note_serial = 2, - ACT_x509_extract_name_segment = 3, - ACT_x509_note_OID = 4, - NR__x509_akid_actions = 5 -}; - -static const asn1_action_t x509_akid_action_table[NR__x509_akid_actions] = { - [ 0] = x509_akid_note_kid, - [ 1] = x509_akid_note_name, - [ 2] = x509_akid_note_serial, - [ 3] = x509_extract_name_segment, - [ 4] = x509_note_OID, -}; - -static const unsigned char x509_akid_machine[] = { - // AuthorityKeyIdentifier - [ 0] = ASN1_OP_MATCH, - [ 1] = _tag(UNIV, CONS, SEQ), - // KeyIdentifier - [ 2] = ASN1_OP_MATCH_ACT_OR_SKIP, // keyIdentifier - [ 3] = _tagn(CONT, PRIM, 0), - [ 4] = _action(ACT_x509_akid_note_kid), - // GeneralNames - [ 5] = ASN1_OP_MATCH_JUMP_OR_SKIP, // authorityCertIssuer - [ 6] = _tagn(CONT, CONS, 1), - [ 7] = _jump_target(13), // --> GeneralNames - // CertificateSerialNumber - [ 8] = ASN1_OP_MATCH_ACT_OR_SKIP, // authorityCertSerialNumber - [ 9] = _tagn(CONT, PRIM, 2), - [ 10] = _action(ACT_x509_akid_note_serial), - [ 11] = ASN1_OP_END_SEQ, - [ 12] = ASN1_OP_COMPLETE, - - // GeneralName - [ 13] = ASN1_OP_MATCH_JUMP_OR_SKIP, // otherName - [ 14] = _tagn(CONT, CONS, 0), - [ 15] = _jump_target(44), - [ 16] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // rfc822Name - [ 17] = _tagn(CONT, CONS, 1), - [ 18] = _jump_target(47), - [ 19] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // dNSName - [ 20] = _tagn(CONT, CONS, 2), - [ 21] = _jump_target(51), - [ 22] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // x400Address - [ 23] = _tagn(CONT, CONS, 3), - [ 24] = _jump_target(55), - [ 25] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // directoryName - [ 26] = _tagn(CONT, CONS, 4), - [ 27] = _jump_target(58), - [ 28] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // ediPartyName - [ 29] = _tagn(CONT, CONS, 5), - [ 30] = _jump_target(78), - [ 31] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // uniformResourceIdentifier - [ 32] = _tagn(CONT, CONS, 6), - [ 33] = _jump_target(81), - [ 34] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // iPAddress - [ 35] = _tagn(CONT, CONS, 7), - [ 36] = _jump_target(85), - [ 37] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // registeredID - [ 38] = _tagn(CONT, CONS, 8), - [ 39] = _jump_target(89), - [ 40] = ASN1_OP_COND_FAIL, - [ 41] = ASN1_OP_END_SEQ_OF, - [ 42] = _jump_target(13), - [ 43] = ASN1_OP_RETURN, - - [ 44] = ASN1_OP_MATCH_ANY, // otherName - [ 45] = ASN1_OP_END_SEQ, - [ 46] = ASN1_OP_RETURN, - - [ 47] = ASN1_OP_MATCH, // rfc822Name - [ 48] = _tag(UNIV, PRIM, IA5STR), - [ 49] = ASN1_OP_END_SEQ, - [ 50] = ASN1_OP_RETURN, - - [ 51] = ASN1_OP_MATCH, // dNSName - [ 52] = _tag(UNIV, PRIM, IA5STR), - [ 53] = ASN1_OP_END_SEQ, - [ 54] = ASN1_OP_RETURN, - - [ 55] = ASN1_OP_MATCH_ANY, // x400Address - [ 56] = ASN1_OP_END_SEQ, - [ 57] = ASN1_OP_RETURN, - - // Name - [ 58] = ASN1_OP_MATCH, - [ 59] = _tag(UNIV, CONS, SEQ), - // RelativeDistinguishedName - [ 60] = ASN1_OP_MATCH, - [ 61] = _tag(UNIV, CONS, SET), - // AttributeValueAssertion - [ 62] = ASN1_OP_MATCH, - [ 63] = _tag(UNIV, CONS, SEQ), - [ 64] = ASN1_OP_MATCH_ACT, // attributeType - [ 65] = _tag(UNIV, PRIM, OID), - [ 66] = _action(ACT_x509_note_OID), - [ 67] = ASN1_OP_MATCH_ANY_ACT, // attributeValue - [ 68] = _action(ACT_x509_extract_name_segment), - [ 69] = ASN1_OP_END_SEQ, - [ 70] = ASN1_OP_END_SET_OF, - [ 71] = _jump_target(62), - [ 72] = ASN1_OP_END_SEQ_OF, - [ 73] = _jump_target(60), - [ 74] = ASN1_OP_ACT, - [ 75] = _action(ACT_x509_akid_note_name), - [ 76] = ASN1_OP_END_SEQ, - [ 77] = ASN1_OP_RETURN, - - [ 78] = ASN1_OP_MATCH_ANY, // ediPartyName - [ 79] = ASN1_OP_END_SEQ, - [ 80] = ASN1_OP_RETURN, - - [ 81] = ASN1_OP_MATCH, // uniformResourceIdentifier - [ 82] = _tag(UNIV, PRIM, IA5STR), - [ 83] = ASN1_OP_END_SEQ, - [ 84] = ASN1_OP_RETURN, - - [ 85] = ASN1_OP_MATCH, // iPAddress - [ 86] = _tag(UNIV, PRIM, OTS), - [ 87] = ASN1_OP_END_SEQ, - [ 88] = ASN1_OP_RETURN, - - [ 89] = ASN1_OP_MATCH, // registeredID - [ 90] = _tag(UNIV, PRIM, OID), - [ 91] = ASN1_OP_END_SEQ, - [ 92] = ASN1_OP_RETURN, -}; - -const struct asn1_decoder x509_akid_decoder = { - .machine = x509_akid_machine, - .machlen = sizeof(x509_akid_machine), - .actions = x509_akid_action_table, -}; diff --git a/backport/compat/verification/x509_akid-asn1.h b/backport/compat/verification/x509_akid-asn1.h deleted file mode 100644 index 92914da..0000000 --- a/backport/compat/verification/x509_akid-asn1.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Automatically generated by asn1_compiler. Do not edit - * - * ASN.1 parser for x509_akid - */ -#include - -extern const struct asn1_decoder x509_akid_decoder; - -extern int x509_akid_note_kid(void *, size_t, unsigned char, const void *, size_t); -extern int x509_akid_note_name(void *, size_t, unsigned char, const void *, size_t); -extern int x509_akid_note_serial(void *, size_t, unsigned char, const void *, size_t); -extern int x509_extract_name_segment(void *, size_t, unsigned char, const void *, size_t); -extern int x509_note_OID(void *, size_t, unsigned char, const void *, size_t); - diff --git a/backport/compat/verification/x509_akid.asn1.c b/backport/compat/verification/x509_akid.asn1.c new file mode 100644 index 0000000..10f4802 --- /dev/null +++ b/backport/compat/verification/x509_akid.asn1.c @@ -0,0 +1,144 @@ +/* + * Automatically generated by asn1_compiler. Do not edit + * + * ASN.1 parser for x509_akid + */ +#include +#include "x509_akid.asn1.h" + +enum x509_akid_actions { + ACT_x509_akid_note_kid = 0, + ACT_x509_akid_note_name = 1, + ACT_x509_akid_note_serial = 2, + ACT_x509_extract_name_segment = 3, + ACT_x509_note_OID = 4, + NR__x509_akid_actions = 5 +}; + +static const asn1_action_t x509_akid_action_table[NR__x509_akid_actions] = { + [ 0] = x509_akid_note_kid, + [ 1] = x509_akid_note_name, + [ 2] = x509_akid_note_serial, + [ 3] = x509_extract_name_segment, + [ 4] = x509_note_OID, +}; + +static const unsigned char x509_akid_machine[] = { + // AuthorityKeyIdentifier + [ 0] = ASN1_OP_MATCH, + [ 1] = _tag(UNIV, CONS, SEQ), + // KeyIdentifier + [ 2] = ASN1_OP_MATCH_ACT_OR_SKIP, // keyIdentifier + [ 3] = _tagn(CONT, PRIM, 0), + [ 4] = _action(ACT_x509_akid_note_kid), + // GeneralNames + [ 5] = ASN1_OP_MATCH_JUMP_OR_SKIP, // authorityCertIssuer + [ 6] = _tagn(CONT, CONS, 1), + [ 7] = _jump_target(13), // --> GeneralNames + // CertificateSerialNumber + [ 8] = ASN1_OP_MATCH_ACT_OR_SKIP, // authorityCertSerialNumber + [ 9] = _tagn(CONT, PRIM, 2), + [ 10] = _action(ACT_x509_akid_note_serial), + [ 11] = ASN1_OP_END_SEQ, + [ 12] = ASN1_OP_COMPLETE, + + // GeneralName + [ 13] = ASN1_OP_MATCH_JUMP_OR_SKIP, // otherName + [ 14] = _tagn(CONT, CONS, 0), + [ 15] = _jump_target(44), + [ 16] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // rfc822Name + [ 17] = _tagn(CONT, CONS, 1), + [ 18] = _jump_target(47), + [ 19] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // dNSName + [ 20] = _tagn(CONT, CONS, 2), + [ 21] = _jump_target(51), + [ 22] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // x400Address + [ 23] = _tagn(CONT, CONS, 3), + [ 24] = _jump_target(55), + [ 25] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // directoryName + [ 26] = _tagn(CONT, CONS, 4), + [ 27] = _jump_target(58), + [ 28] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // ediPartyName + [ 29] = _tagn(CONT, CONS, 5), + [ 30] = _jump_target(78), + [ 31] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // uniformResourceIdentifier + [ 32] = _tagn(CONT, CONS, 6), + [ 33] = _jump_target(81), + [ 34] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // iPAddress + [ 35] = _tagn(CONT, CONS, 7), + [ 36] = _jump_target(85), + [ 37] = ASN1_OP_COND_MATCH_JUMP_OR_SKIP, // registeredID + [ 38] = _tagn(CONT, CONS, 8), + [ 39] = _jump_target(89), + [ 40] = ASN1_OP_COND_FAIL, + [ 41] = ASN1_OP_END_SEQ_OF, + [ 42] = _jump_target(13), + [ 43] = ASN1_OP_RETURN, + + [ 44] = ASN1_OP_MATCH_ANY, // otherName + [ 45] = ASN1_OP_END_SEQ, + [ 46] = ASN1_OP_RETURN, + + [ 47] = ASN1_OP_MATCH, // rfc822Name + [ 48] = _tag(UNIV, PRIM, IA5STR), + [ 49] = ASN1_OP_END_SEQ, + [ 50] = ASN1_OP_RETURN, + + [ 51] = ASN1_OP_MATCH, // dNSName + [ 52] = _tag(UNIV, PRIM, IA5STR), + [ 53] = ASN1_OP_END_SEQ, + [ 54] = ASN1_OP_RETURN, + + [ 55] = ASN1_OP_MATCH_ANY, // x400Address + [ 56] = ASN1_OP_END_SEQ, + [ 57] = ASN1_OP_RETURN, + + // Name + [ 58] = ASN1_OP_MATCH, + [ 59] = _tag(UNIV, CONS, SEQ), + // RelativeDistinguishedName + [ 60] = ASN1_OP_MATCH, + [ 61] = _tag(UNIV, CONS, SET), + // AttributeValueAssertion + [ 62] = ASN1_OP_MATCH, + [ 63] = _tag(UNIV, CONS, SEQ), + [ 64] = ASN1_OP_MATCH_ACT, // attributeType + [ 65] = _tag(UNIV, PRIM, OID), + [ 66] = _action(ACT_x509_note_OID), + [ 67] = ASN1_OP_MATCH_ANY_ACT, // attributeValue + [ 68] = _action(ACT_x509_extract_name_segment), + [ 69] = ASN1_OP_END_SEQ, + [ 70] = ASN1_OP_END_SET_OF, + [ 71] = _jump_target(62), + [ 72] = ASN1_OP_END_SEQ_OF, + [ 73] = _jump_target(60), + [ 74] = ASN1_OP_ACT, + [ 75] = _action(ACT_x509_akid_note_name), + [ 76] = ASN1_OP_END_SEQ, + [ 77] = ASN1_OP_RETURN, + + [ 78] = ASN1_OP_MATCH_ANY, // ediPartyName + [ 79] = ASN1_OP_END_SEQ, + [ 80] = ASN1_OP_RETURN, + + [ 81] = ASN1_OP_MATCH, // uniformResourceIdentifier + [ 82] = _tag(UNIV, PRIM, IA5STR), + [ 83] = ASN1_OP_END_SEQ, + [ 84] = ASN1_OP_RETURN, + + [ 85] = ASN1_OP_MATCH, // iPAddress + [ 86] = _tag(UNIV, PRIM, OTS), + [ 87] = ASN1_OP_END_SEQ, + [ 88] = ASN1_OP_RETURN, + + [ 89] = ASN1_OP_MATCH, // registeredID + [ 90] = _tag(UNIV, PRIM, OID), + [ 91] = ASN1_OP_END_SEQ, + [ 92] = ASN1_OP_RETURN, +}; + +const struct asn1_decoder x509_akid_decoder = { + .machine = x509_akid_machine, + .machlen = sizeof(x509_akid_machine), + .actions = x509_akid_action_table, +}; diff --git a/backport/compat/verification/x509_akid.asn1.h b/backport/compat/verification/x509_akid.asn1.h new file mode 100644 index 0000000..92914da --- /dev/null +++ b/backport/compat/verification/x509_akid.asn1.h @@ -0,0 +1,15 @@ +/* + * Automatically generated by asn1_compiler. Do not edit + * + * ASN.1 parser for x509_akid + */ +#include + +extern const struct asn1_decoder x509_akid_decoder; + +extern int x509_akid_note_kid(void *, size_t, unsigned char, const void *, size_t); +extern int x509_akid_note_name(void *, size_t, unsigned char, const void *, size_t); +extern int x509_akid_note_serial(void *, size_t, unsigned char, const void *, size_t); +extern int x509_extract_name_segment(void *, size_t, unsigned char, const void *, size_t); +extern int x509_note_OID(void *, size_t, unsigned char, const void *, size_t); +