From patchwork Sat Oct 21 00:16:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 156374 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp47630vqx; Fri, 20 Oct 2023 17:18:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQFI9CgLw7OU2RZ9LxAJvzwaBWVaS2PC6CAhds98VARC0eGTOCu+PvT37YQMy8+k6iAjr/ X-Received: by 2002:a17:903:18f:b0:1ca:7a4c:8344 with SMTP id z15-20020a170903018f00b001ca7a4c8344mr3264358plg.21.1697847497402; Fri, 20 Oct 2023 17:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697847497; cv=none; d=google.com; s=arc-20160816; b=fP42V783V8KkMSTH9e/b1sCdHBEDGHZ1Z9kC+de9om34hX8ODn+v+J2kte+W0tD6p8 kturbfYDpkDwB+yi61/gDMrtB8tz5jVvqawdO6iP4blXiSKtjIcOQXbGB1ZLSOShFRSU G32WE4gYjs+Jyz2tb07a43Z3oMwSY5Ic7KkgU47DN86seiO9tYmVkBRRs0a0f8+OFz0J x2ryH7iQptd1wKsMGlmIzqH6EiwCTRGXqujry/dXbFKeI1xGaJrZjOpHK4kINLsdh4a+ Yo+xsBCdhjNTMfV+6E2Lj1z0Ww4hA1ZcAIuZCqvA0qAfbVeYsQZrrynUAjZdXycvw+Qo Z6zw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PuueNGchp+/Mt3jvaX6HDVjE2P5ULCrANke79lmr0h0=; fh=B7VNejsDDTSdN+dI5qPztSK8Q7vmONWV7hb4odaY41w=; b=KMuDfN1Y9TpmdVASE3rSr6ktdZE06Qo7mFfrtY5Gc2WZEV6VkHNxNU6n1lDWPPM1Bq 4Y7XDOh8z3ltCGK9lG3Nys4OpIdJw3mWlUcHwrdKVifg83UPsETcn7YOV3tkINedkOO5 1y01aRIrPKPldjzYDqnz2qpY4JxQSGjyYkvo9kifKLGbs7yoexLH1YPmeeZju+7q1O0y r2p1OEURynaETFObXcDJ3eHvQBcgacUE2hSUHDVEqPyvPC5FJvYJJeeTKDD45rm+doi0 qp4oa1mO2Rn7ofq4icifZP6IRcNz7APdFrkAc8ZBZfmsbOYd83cF+c+kZnhL6+53cy6I O9YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=vAW6ACwY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001c74d1da69csi2734549plh.362.2023.10.20.17.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 17:18:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=vAW6ACwY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 2AA26807C75A; Fri, 20 Oct 2023 17:18:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230405AbjJUARe (ORCPT + 26 others); Fri, 20 Oct 2023 20:17:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230318AbjJUARc (ORCPT ); Fri, 20 Oct 2023 20:17:32 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9E1ED6B for ; Fri, 20 Oct 2023 17:17:27 -0700 (PDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (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-0.canonical.com (Postfix) with ESMTPS id C4F303FD39 for ; Sat, 21 Oct 2023 00:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1697847445; bh=PuueNGchp+/Mt3jvaX6HDVjE2P5ULCrANke79lmr0h0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vAW6ACwYm/p5qfD4+DdDj++9EZsew0tHbK7Bb84CWNohgedzuy/u7vmyUdkSMW2xh exlH4p2BjDMA6s65HujKCx/L9u+7YDd00T2ZpmP9HvK3jZ0dhAiDmQGyDa2NUgET5k JF9xiy7OTiWQv0IH066gNQId85bMhc7bOoWutidO+1XtacPm5qcMBsqz9SMkUYtV2v TOKLwdbAnbEeC7U6BbkJ1NIiURAZPQjkijZBonKOJTQ8YIBsb+KDU+xsHxq0cxzJmp CAPb09zEXntfCGu8/Vzrv1LsoAJ8PaO/sztDQZoNWdqPDZlPmspLaYs3uxvDfoODmm XaILB2yNDUVhw== Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-408212415abso7933865e9.2 for ; Fri, 20 Oct 2023 17:17:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697847445; x=1698452245; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PuueNGchp+/Mt3jvaX6HDVjE2P5ULCrANke79lmr0h0=; b=bQav1Ps6p6J2sU3w5NP4vjJmOUokV+AWYjneSjRo5nW89ehWVJ/iiRbSBxurbLy84C DaRCKog0Td08HYoPgoBAjJjK0GM3hvfdOIIrAZorzEMkH8mG1Ee6dFwHtqVm0hbzHIn8 ZtU9KoAg6RdlEUx5P8ndnmK+T90+ERNwhdb37XX1R8rzcO1UMHrqrPKhr90duPUWJUE/ iBUqRBvT1HR26x8BDbKNQqyo75cFcJfYAqYsuf5b+vTIU3lHMvkmH7HlulD25yp0NTqn gKd3eoJPlAT/WWZ1b5K9RDEEWErml55wZr8zgLCr59uFMVL5O7XlticzVpBoR4ou8g75 sJmQ== X-Gm-Message-State: AOJu0YzMhWKMY9GoWiukvvRewZHwrfDn7TyJb0B1GeCCQODrJaySfxwp bTAvEnIM44QzLO8kIgatsF6zakkBxdZ4zQ2b6FEFhoLzcahHsPF+TqYk97Gor/Jcd36EqiRIEKQ br8FMIKgebR32mnhnES1r6HTyD/v2JOmJHVGODWsAGQ== X-Received: by 2002:a05:600c:4f12:b0:401:bdd7:49ae with SMTP id l18-20020a05600c4f1200b00401bdd749aemr2887982wmq.18.1697847445120; Fri, 20 Oct 2023 17:17:25 -0700 (PDT) X-Received: by 2002:a05:600c:4f12:b0:401:bdd7:49ae with SMTP id l18-20020a05600c4f1200b00401bdd749aemr2887969wmq.18.1697847444697; Fri, 20 Oct 2023 17:17:24 -0700 (PDT) Received: from localhost ([2001:67c:1560:8007::aac:c15c]) by smtp.gmail.com with ESMTPSA id j6-20020a05600c488600b004080f0376a0sm3207801wmp.42.2023.10.20.17.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 17:17:24 -0700 (PDT) From: Dimitri John Ledkov To: David Howells , Herbert Xu , "David S. Miller" Cc: keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] crypto: mscode_parser - remove sha224 authenticode support Date: Sat, 21 Oct 2023 01:16:58 +0100 Message-Id: <20231021001658.1602526-1-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010212530.63470-1-dimitri.ledkov@canonical.com> References: <20231010212530.63470-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 17:18:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780322137369283585 X-GMAIL-MSGID: 1780322137369283585 It is possible to stand up your 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 for linux vmlinuz have always been using at least SHA-256. Given the point of mscode_parser is to support interoperability with typical de-facto hashes, remove support for SHA-224 to avoid the possibility of creating 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. Signed-off-by: Dimitri John Ledkov Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu --- Changes since v1: * Correct spelling and grammatical mistakes in the commit message. This is a request to replace c1d760a471 ("crypto: mscode_parser - remove sha224 authenticode support") in cryptodev repository with this one. 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));