Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp379400img; Thu, 21 Mar 2019 23:28:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVU6CbGY//1sI0Ayio1tdDHD9sRh1BdHdpe7rDgtcCkifQDVpO04TAv7kJlO6Jr5g/fDsS X-Received: by 2002:a65:65c4:: with SMTP id y4mr7227632pgv.305.1553236127000; Thu, 21 Mar 2019 23:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553236126; cv=none; d=google.com; s=arc-20160816; b=HYoa0qesBmXzpEqlYMgHakkyg17sMha9uEGry0QaHt1XGDM50vwScHB872KMAhmNG4 5KaeLH+vCQfmQ6YEVcIH9bWMWTYZe9bWCugfEUfKcJCrsFQkIf88P/zbZQncLN4swRE4 WlndR8+t9EMzCq3HZAdjl6M6kz7+KRaw6/xCUKtZLqVqAf98VoVxD9yjtBqfUIJUlIvA Kf7DC4qanOUSsSrT53eb3ZuEpo5WCGs0Jaoq1XLVBNGIBWJwdU4086mp/QPP8gyaK+3P DbwdilHoxES43o0J22UtPxjNPE7YVQ86ddljfBzL/CBWtHQ3d1cdf5kiD4Rn1UShVRFo NrUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=burGcdVB6qhefLFFLVD5su+F5xWlQ/GIS5x59dGTJvM=; b=N3PuDCMn6rdtyrx4RrPXLxlkJ2xPSABMQZQEu9JShazULrPYJpBoRK+bIlydOHMVS9 SpoedfcX9Mng9SF/Lv59zvJdc3MyWsv455h0SL5vtKQy4rAVDg5FsHjpdRvI6f4fm/Yn bo0VAJGOjAeV+G/ovCYzYnjGFq/IJlQXPrDhNUZ10lf1/8CPkfJmlC+eJ67ejhIpIo1V 2yruMzoqK5rLKlZwC2tscwFTIjHIPtefUcUxMO+/8rLAvbSs84YrZrvHIR1eH42mI5s2 87rmD0EVYaligaTFXH3B+cQt6CEw36vOXbFhu1UvR8FiOl1pbQVUs8GEUAea4L8Wsez5 MEuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E2c+5zPD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a95si6843873pla.350.2019.03.21.23.28.29; Thu, 21 Mar 2019 23:28:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E2c+5zPD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727693AbfCVG1u (ORCPT + 99 others); Fri, 22 Mar 2019 02:27:50 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:42267 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfCVG1s (ORCPT ); Fri, 22 Mar 2019 02:27:48 -0400 Received: by mail-pf1-f195.google.com with SMTP id r15so810161pfn.9; Thu, 21 Mar 2019 23:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=burGcdVB6qhefLFFLVD5su+F5xWlQ/GIS5x59dGTJvM=; b=E2c+5zPD0ijvrfKmkHWzwJwXOyzRS2ySSwkrzrFOzncOl5rUv6OY+ziHiqPcwnpVKF Xo7HEeLvGUFsu78k2+Nmn/91gUobtr2b+1zlYqsweCxerTmB1pxuwFNAcyUwaujFLGk0 ikVG2Pc3vM1580wp4frV84Y9pks+/hgAS7e0VLOqSaqGxNeKqNdj3oqabF8MTKilJyFg f/8o+buP6zrwkCM/jjYuT8D2LBubJ7aboTzaEBoF5Ez99BF7xdrFLPbuT+LWJ9OJGSZy W85oaH3vmTn0MgcKcQhFB4XqTndfr67l+GxSq94DCCYgDM7KzuJu36noq8apJ5yKIQUL 8apQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=burGcdVB6qhefLFFLVD5su+F5xWlQ/GIS5x59dGTJvM=; b=O+dfaM5dhazfU06fNXlhB/0JdsNc4U6if58cttloa9x8Ntx9btvQcNxgezmGyl3ACK FwcopO1feDxRSkeHm6VnXc6YRrmCQ2Jy9TE2237DT4Yh/YY6tgN47uBfdBLZvZRQKCCB m/WfKO3PeyYdMnHoK7Pzrc9j2VOB8xkqEpX1XqnYrrKKOx721HZjZMbFPqVp4mzl4j3J 2bjgpYygZqQ3H5ujhnv8KTEcPejta0Rd8JvS0iTyCcM2sllzMv8oVX5N+VEUknUXhgU4 +O/S78PNOOXq0f24ki/cVKnL0yaDIYBHWAvTfpzR3VsVokFd3sLuXuqLR7GwFMlaUzSA SNDA== X-Gm-Message-State: APjAAAX9xZjpVGvZ91WXlwTjGnURmaoG7IDrYjb8DEQO7l5xIMgM+boZ u3VdWc0+by1dY6Os6JD48ew= X-Received: by 2002:a17:902:2bc9:: with SMTP id l67mr7745824plb.102.1553236067597; Thu, 21 Mar 2019 23:27:47 -0700 (PDT) Received: from linux-l9pv.suse ([202.47.205.198]) by smtp.gmail.com with ESMTPSA id n75sm10368394pfb.39.2019.03.21.23.27.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Mar 2019 23:27:46 -0700 (PDT) From: "Lee, Chun-Yi" X-Google-Original-From: "Lee, Chun-Yi" To: David Howells , Herbert Xu , "David S . Miller" Cc: keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, "Lee, Chun-Yi" Subject: [PATCH] X.509: Add messages for obsolete OIDs Date: Fri, 22 Mar 2019 14:27:38 +0800 Message-Id: <20190322062738.19852-1-jlee@suse.com> X-Mailer: git-send-email 2.12.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We found that the db in Acer machine has self signed certificates (CN=DisablePW or CN=ABO) that they used obsolete OID 1.3.14.3.2.29 sha1WithRSASignature and 2.5.29.1 subjectKeyIdentifier. Kernel emits -65 error code when loading those certificates to platform keyring: [ 1.484388] integrity: Loading X.509 certificate: UEFI:MokListRT [ 1.485557] integrity: Problem loading X.509 certificate -65 [ 1.486100] Error adding keys to platform keyring UEFI:MokListRT Because the -65 error code is not enough for appeasing user when loading a outdated certificate. This patch add messages against 1.3.14.3.2.29 and 2.5.29.1 OIDs. Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1129471 Cc: David Howells Cc: Herbert Xu Cc: "David S. Miller" Signed-off-by: "Lee, Chun-Yi" --- crypto/asymmetric_keys/x509_cert_parser.c | 7 +++++++ include/linux/oid_registry.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c index 991f4d735a4e..bbd22d5c5b5d 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c @@ -192,6 +192,8 @@ int x509_note_pkey_algo(void *context, size_t hdrlen, pr_debug("PubKey Algo: %u\n", ctx->last_oid); switch (ctx->last_oid) { + case OID_sha1WithRSASignature: + pr_info("1.3.14.3.2.29 sha1WithRSASignature is obsolete.\n"); case OID_md2WithRSAEncryption: case OID_md3WithRSAEncryption: default: @@ -464,6 +466,11 @@ int x509_process_extension(void *context, size_t hdrlen, return 0; } + if (ctx->last_oid == OID_subjectKeyIdentifier_obsolete) { + pr_info("2.5.29.1 subjectKeyIdentifier OID is obsolete.\n"); + return -ENOPKG; + } + return 0; } diff --git a/include/linux/oid_registry.h b/include/linux/oid_registry.h index d2fa9ca42e9a..0641d5aa2251 100644 --- a/include/linux/oid_registry.h +++ b/include/linux/oid_registry.h @@ -62,6 +62,7 @@ enum OID { OID_certAuthInfoAccess, /* 1.3.6.1.5.5.7.1.1 */ OID_sha1, /* 1.3.14.3.2.26 */ + OID_sha1WithRSASignature, /* 1.3.14.3.2.29 */ OID_sha256, /* 2.16.840.1.101.3.4.2.1 */ OID_sha384, /* 2.16.840.1.101.3.4.2.2 */ OID_sha512, /* 2.16.840.1.101.3.4.2.3 */ @@ -83,6 +84,7 @@ enum OID { OID_generationalQualifier, /* 2.5.4.44 */ /* Certificate extension IDs */ + OID_subjectKeyIdentifier_obsolete, /* 2.5.29.1 */ OID_subjectKeyIdentifier, /* 2.5.29.14 */ OID_keyUsage, /* 2.5.29.15 */ OID_subjectAltName, /* 2.5.29.17 */ -- 2.16.4