Message ID | 20231010212530.63470-1-dimitri.ledkov@canonical.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp145210vqb; Tue, 10 Oct 2023 14:26:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQ1YIRxpTA2zHdU9GoN3NbmKmPqFpAlpRHx/0nflKXMbPQeVDAWUU/LHZQdKyK0uPnghgs X-Received: by 2002:a17:902:f54e:b0:1bb:d7d4:e2b with SMTP id h14-20020a170902f54e00b001bbd7d40e2bmr21895541plf.0.1696973160547; Tue, 10 Oct 2023 14:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696973160; cv=none; d=google.com; s=arc-20160816; b=P5zrGIMh8BCvXNJf106CYA6VGw5ttYx7j2+R3bgL2ftpgP8m8vBIHuy63IUUHQpL/n 8RL8B4DZRmoakXKt7lh+j1XR26tYUdAZpeYbcIySL7gj9nqxfxEOLzQlg1BOT8dmuLbz 1O7A8T0/A5UoTWWYTS389AmAFgg3dw7FRJOf1aRVSUx7WTiDlDE+sB0BFPxuZy4EaXuX arbJdyEXgZjakTU80yPdJ7mYa8bbAPG7H4YSkVbN8oKVyS4s9SMLn9yYANpkNRn5jAgW DF8ZPW3SdFDSf1GuPSpqz9WhxsXhZeFcGh1ZwoCFb5oUCg9I9JSus3x638rFVkIAowzE LBLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4UvItTACB+h7HBV2ug6VBd/ji6l7lMzN70Cv1HLypsg=; fh=B7VNejsDDTSdN+dI5qPztSK8Q7vmONWV7hb4odaY41w=; b=ZjJ/jxwZweIZmRnFtWEnQZdXelVdqxeqIWMVDX2H0zaN3NcIuhJ3u88dXF2JGEI2Ui xkaOPPAKyvExaycECIofySA2EUHHz8qiGffws76HEMLv8AtoD2RrPO2+FdLQeXW/FkAc /b4Alwl44qR/llQbR5lbPnof0mV5fsWVNBwOaxekqb8DZkdDl9jjjYllgdffzCBxY3EU sKYiCwlMJsZUzzH+v1J46n4J3kBToCEhqo0vn/6YeiykG/EMvwrfcyD1uv0dpz2KMtbo ZWqmP830VmcOPt8oSJ4JNVYBXBiJozus+yAZgmBv87Ku44UrPauGjq5RhuAoYzlWT1nl xCMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=sm5He0OY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id z17-20020a170903019100b001bb8c4279f5si9819138plg.148.2023.10.10.14.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 14:26:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=sm5He0OY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 64D388263E84; Tue, 10 Oct 2023 14:25:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229547AbjJJVZo (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Tue, 10 Oct 2023 17:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232348AbjJJVZm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 10 Oct 2023 17:25:42 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C236294 for <linux-kernel@vger.kernel.org>; Tue, 10 Oct 2023 14:25:40 -0700 (PDT) Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id D50DD40342 for <linux-kernel@vger.kernel.org>; Tue, 10 Oct 2023 21:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1696973138; bh=4UvItTACB+h7HBV2ug6VBd/ji6l7lMzN70Cv1HLypsg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=sm5He0OYV60PLj3ngvt0TcDQmF1CYL/mjpsimEJpizp+e/tirBGPuuznwTbZhcl9b DhttDb1SOY8bpLFYun3cUteYb3+IZrt8/e7vr1C96NqDp17yV1bhsYIG1QSFg5ahsO a0x/cLyZHKWCy9dIwe/BRLru3Vkf7z3iRwI96xLlWcpRuRfurhBBytUuHV7BibgW/6 Pj1fcyBaheQCJNW09vVN3ghl6bsjLl8/GcrDUijfk7iV4GVVAUfMvtU7FTp3bLdpOi lZ8wahns1UUwEhTDnFf03tfs+aeRYT4dufZZI2xfkal3FpXA6AzyYNnFdkzyDitqi4 i7tYZWeo35C/w== Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-1c9c92c4aaeso2852495ad.1 for <linux-kernel@vger.kernel.org>; Tue, 10 Oct 2023 14:25:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696973137; x=1697577937; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4UvItTACB+h7HBV2ug6VBd/ji6l7lMzN70Cv1HLypsg=; b=xF6AZZ2YcnqLp8C8xI+nshch+AzwPP2Qjrnb5DLyNUCsyQ/xatQTNugYWp9JPg1vVM inq4U9Zjs27Eq0rGrj02p1bmDfd12m1WkWgYpMJ9VeYt/ACUigYRbM5gvNYJ1npzhuat yzfR01zBUCJsX/9o47qFwGqVVKqqVVCplmyX7iQnFpfvqvKxCokX2OHfzTKzhehZDogx vlcKt613IKWipstxbDwLhakEGc/SJjFbRRl965TArtmjTxtd6Abmlkg+0zfm8higbcSz jZzrXOrvn8SuIl4RDjKt7N3DLgzuWY3O6RXuuLs2sX00gdyw0Vx2Xd0ynQ6bWUPhrqcg xozg== X-Gm-Message-State: AOJu0Yw1p8XtEloBJVoN3SiGUUGe9Jiob68DYnY7ycqJiWdScZigNtDW +aK7TA3eZQAxcgpNEAhuTj80t2S6gcl/740xFG2RzU/9NOFONd77qUdlkxu4mH9HQ+uhx1fs9kO suhherYx7xEhj5JAjMnqDkmTWTqCrYP6bgQZgdJDyCQ== X-Received: by 2002:a17:902:e549:b0:1c5:70d3:f193 with SMTP id n9-20020a170902e54900b001c570d3f193mr22210208plf.10.1696973137449; Tue, 10 Oct 2023 14:25:37 -0700 (PDT) X-Received: by 2002:a17:902:e549:b0:1c5:70d3:f193 with SMTP id n9-20020a170902e54900b001c570d3f193mr22210195plf.10.1696973137142; Tue, 10 Oct 2023 14:25:37 -0700 (PDT) Received: from localhost ([2001:67c:1560:8007::aac:c15c]) by smtp.gmail.com with ESMTPSA id a4-20020a170902ecc400b001bdc3768ca5sm12222073plh.254.2023.10.10.14.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 14:25:36 -0700 (PDT) From: Dimitri John Ledkov <dimitri.ledkov@canonical.com> To: David Howells <dhowells@redhat.com>, Herbert Xu <herbert@gondor.apana.org.au>, "David S. Miller" <davem@davemloft.net> Cc: keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: mscode_parser: remove sha224 authenticode support Date: Tue, 10 Oct 2023 22:25:29 +0100 Message-Id: <20231010212530.63470-1-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 14:25:58 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779405329211564222 X-GMAIL-MSGID: 1779405329211564222 |
Series |
crypto: mscode_parser: remove sha224 authenticode support
|
|
Commit Message
Dimitri John Ledkov
Oct. 10, 2023, 9:25 p.m. UTC
It is possible to stand up own certificates and sign PE-COFF binaries
using SHA-224. However it never became popular or needed since it has
similar costs as SHA-256. Windows Authenticode infrastructure never
had support for SHA-224, and all secureboot keys used fro linux
vmlinuz have always been using at least SHA-256.
Given the point of mscode_parser is to support interoperatiblity with
typical de-facto hashes, remove support for SHA-224 to avoid
posibility of creating interoperatibility issues with rhboot/shim,
grub, and non-linux systems trying to sign or verify vmlinux.
SHA-224 itself is not removed from the kernel, as it is truncated
SHA-256. If requested I can write patches to remove SHA-224 support
across all of the drivers.
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
---
crypto/asymmetric_keys/mscode_parser.c | 3 ---
1 file changed, 3 deletions(-)
Comments
On Tue, 10 Oct 2023 at 23:25, Dimitri John Ledkov <dimitri.ledkov@canonical.com> wrote: > > It is possible to stand up own certificates and sign PE-COFF binaries > using SHA-224. However it never became popular or needed since it has > similar costs as SHA-256. Windows Authenticode infrastructure never > had support for SHA-224, and all secureboot keys used fro linux fro > vmlinuz have always been using at least SHA-256. > > Given the point of mscode_parser is to support interoperatiblity with interoperatibility > typical de-facto hashes, remove support for SHA-224 to avoid > posibility the possibility > of creating interoperatibility interoperability > issues with rhboot/shim, > grub, and non-linux systems trying to sign or verify vmlinux. > > SHA-224 itself is not removed from the kernel, as it is truncated > SHA-256. If requested I can write patches to remove SHA-224 support > across all of the drivers. > We can stop using it but we cannot remove it. As you say, it is just SHA-256 with a different initial state and a truncated hash, so removing support entirely achieves very little. And there are plenty of other algorithms we'd be happy to remove first if we were only sure that nobody was relying on them. (Note that AF_ALG supports AEAD so someone somewhere could be using the kernel's sha224 from user space) > Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> > --- > crypto/asymmetric_keys/mscode_parser.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/crypto/asymmetric_keys/mscode_parser.c b/crypto/asymmetric_keys/mscode_parser.c > index 6416bded0e..855cbc46a9 100644 > --- a/crypto/asymmetric_keys/mscode_parser.c > +++ b/crypto/asymmetric_keys/mscode_parser.c > @@ -84,9 +84,6 @@ int mscode_note_digest_algo(void *context, size_t hdrlen, > case OID_sha512: > ctx->digest_algo = "sha512"; > break; > - case OID_sha224: > - ctx->digest_algo = "sha224"; > - break; > > case OID__NR: > sprint_oid(value, vlen, buffer, sizeof(buffer)); > -- > 2.34.1 >
On Tue, Oct 10, 2023 at 10:25:29PM +0100, Dimitri John Ledkov wrote: > It is possible to stand up own certificates and sign PE-COFF binaries > using SHA-224. However it never became popular or needed since it has > similar costs as SHA-256. Windows Authenticode infrastructure never > had support for SHA-224, and all secureboot keys used fro linux > vmlinuz have always been using at least SHA-256. > > Given the point of mscode_parser is to support interoperatiblity with > typical de-facto hashes, remove support for SHA-224 to avoid > posibility of creating interoperatibility issues with rhboot/shim, > grub, and non-linux systems trying to sign or verify vmlinux. > > SHA-224 itself is not removed from the kernel, as it is truncated > SHA-256. If requested I can write patches to remove SHA-224 support > across all of the drivers. > > Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com> > --- > crypto/asymmetric_keys/mscode_parser.c | 3 --- > 1 file changed, 3 deletions(-) Patch applied. Thanks.
diff --git a/crypto/asymmetric_keys/mscode_parser.c b/crypto/asymmetric_keys/mscode_parser.c index 6416bded0e..855cbc46a9 100644 --- a/crypto/asymmetric_keys/mscode_parser.c +++ b/crypto/asymmetric_keys/mscode_parser.c @@ -84,9 +84,6 @@ int mscode_note_digest_algo(void *context, size_t hdrlen, case OID_sha512: ctx->digest_algo = "sha512"; break; - case OID_sha224: - ctx->digest_algo = "sha224"; - break; case OID__NR: sprint_oid(value, vlen, buffer, sizeof(buffer));