From patchwork Wed Dec 18 00:44:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1211835 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="wOd3+dqE"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47cx9D50Xcz9sRl for ; Wed, 18 Dec 2019 11:44:32 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7CA5981582; Wed, 18 Dec 2019 01:44:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="wOd3+dqE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF25F815D3; Wed, 18 Dec 2019 01:44:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 69198814ED for ; Wed, 18 Dec 2019 01:44:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pf1-x442.google.com with SMTP id d199so186316pfd.11 for ; Tue, 17 Dec 2019 16:44:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OherbPEAzeMyIzJzhUng92q1qgIki6b6p+0pE+AiJ/s=; b=wOd3+dqEi1Hv+mYPt3MPOx4X8YHVp+C/fzJzIjIUDqw73ore7eMYMPPJ3sGwKNAoNj CURmEsX9INAor3MFiuYyy+zUs3RWU55aI0p53H36qjlQwo0HM9IvD8eHAxFp/HwM+rF6 rVjz4MlOZerZyAtKpFIvXuZvnIbQkoeH5q++07l9lsw0CXWdiq1CSGSSsNCqyLnyXccv +IXdSgx9Q1VV7ggVjfqPbCH1zLsysIDT7N6g7KvvJD8J3TmDyDJe79I9SbC1QbLAw3nX V+jDyaxuw5WU1gIbczGEH10wkwGkXhpWl2WP7sK8UpHna9dUtjF8oQ5WSf1JFUXhUb/y cczA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=OherbPEAzeMyIzJzhUng92q1qgIki6b6p+0pE+AiJ/s=; b=Q2dUfD4g/x3B0FiBQ4jG4gIdbSO5TsQlSdF9OU1k6HkdDM1hN+9KbOGq0gdIwL5Qcb 7Wov6MVBBPNB6D5lXmsjrMfOWwNXofP3Hc2L+xVH/fBpqMyv8n2wycDLBy5JOZvGPrk+ kGte7wt/Yh6prvZsVjTSEmXCegM/d4DwfR0zzieoibLM7KhPt/bL/l8CMQhf1x3w3MeA 8pEOuElDB6TenBZhc2hXuSovArInA1+W40Ile0bkrSIN6yEpVTlpmESfKZu2xKPMqE9Q lVki2NgYA5koI6kHqT1LYYu57P3z975Uf1aPBYz7t17RLOV6Z+5IkSAxRCJhFHvC29YO F6+Q== X-Gm-Message-State: APjAAAVfb4E2rdNH46OAWb+n3WU5Gaoz1zv60e1VOScRC2eMoEMISQkD dWSbL3C9+DyW5Lo1M2aGBgw6skEFzXw= X-Google-Smtp-Source: APXvYqzgZE8G2numcQAN1fijr0ZwQw0WaGdIkgxbAMLKGcnQwA8l0cfV97QTQxDCQ3S1QdqpuyLOwg== X-Received: by 2002:a63:4641:: with SMTP id v1mr218392pgk.389.1576629843933; Tue, 17 Dec 2019 16:44:03 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id u3sm193231pga.72.2019.12.17.16.44.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2019 16:44:03 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, trini@konsulko.com Subject: [PATCH v4 02/16] efi_loader: add CONFIG_EFI_SECURE_BOOT config option Date: Wed, 18 Dec 2019 09:44:58 +0900 Message-Id: <20191218004512.24939-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191218004512.24939-1-takahiro.akashi@linaro.org> References: <20191218004512.24939-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de, mail@patrick-wildt.de Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean Under this configuration, UEFI secure boot support will be added in later patches. Signed-off-by: AKASHI Takahiro --- lib/efi_loader/Kconfig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index c7027a967653..d1c092a1d80a 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -115,4 +115,23 @@ config EFI_GRUB_ARM32_WORKAROUND GRUB prior to version 2.04 requires U-Boot to disable caches. This workaround currently is also needed on systems with caches that cannot be managed via CP15. + +config EFI_SECURE_BOOT + bool "Enable EFI secure boot support" + depends on EFI_LOADER + select SHA256 + select RSA + select RSA_VERIFY_WITH_PKEY + select IMAGE_SIGN_INFO + select ASYMMETRIC_KEY_TYPE + select ASYMMETRIC_PUBLIC_KEY_SUBTYPE + select X509_CERTIFICATE_PARSER + select PKCS7_MESSAGE_PARSER + default n + help + Select this option to enable EFI secure boot support. + Once SecureBoot mode is enforced, any EFI binary can run only if + it is signed with a trusted key. To do that, you need to install, + at least, PK, KEK and db. + endif