From patchwork Mon Dec 9 06:00:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1205920 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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="CTNtTMlu"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47WXbL1FZPz9sNH for ; Mon, 9 Dec 2019 16:59:58 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 00A1481656; Mon, 9 Dec 2019 06:59:42 +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="CTNtTMlu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 258DF81660; Mon, 9 Dec 2019 06:59:40 +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-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) (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 047A181655 for ; Mon, 9 Dec 2019 06:59:36 +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-pj1-x1044.google.com with SMTP id ep17so5384178pjb.4 for ; Sun, 08 Dec 2019 21:59:36 -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=/KkWnKRhYaZMCJ15r1SwDrDrLsNLeRwbNZA4D4MuaCc=; b=CTNtTMlueZh075Ezj4Fd49mOO0yBgdWccMLSEmGNfukvbGhd4AjA1UsQyF3WN8vCPc 0COqQmifIbSkXWDylTtT02Jy4X5LZc0o22PDYlm7T6PD+0YIeThtCRy9Oj7nnSRr8TVw ixYKNQe0FxvyqtLY8IONR3iyFZr51V7ElOVON8ZjeuGje4i2z1kUj1+YJwmqIqJ7ySPd 4Bh/xi3QjXKoBlXonFEEm5x3LO4p5PNhcS58ynoTzBI04uImhfcg/8qLKhIXfIszwoqE swO9pn5YdvuVpcPV6hdWJdevzPNwkJH/+sP8OXKZWk0MVhWDslU2IMGX2Ztb/bDxDrUg sE3A== 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=/KkWnKRhYaZMCJ15r1SwDrDrLsNLeRwbNZA4D4MuaCc=; b=ipJe9KwryNY/IDIlpk9hFnDd6fK6Q4nbBhC0Eifv2ZSw9cFy5MwSnlCPJSzgh71Bfa VTvmevqTASBV95OcJIUvpcRV/oAkNO37CrlYiYJ4ltwuJREhCT6dIZxhbxsZpEwBdPwP kpjOONsqoDWsOVi1JjEg+S/38jrSUb/BFDIchsI8S3y6eNwc+NWEJPZ6C1jve+LtHz0C xljvU5PPmDu9U1gNw2Kwka9sxfYWFohNrFsOIOLdJHIRlG9XUv81f1EN9bWdpK+6dH1r +RI2sC0P4GoKY4QpuYzFAdutH+QmIEUJO97c4VSfxRJRQU9KxwH6pEzFYVhspTkOpT2z eP1A== X-Gm-Message-State: APjAAAXlb9SWD2m+HCztcwMPTiY7fFuVER1FvVGgdDkH9YxJIPbWmdFB Gts3PlWYxjgH1JN6edyWKDW1BA== X-Google-Smtp-Source: APXvYqzAPQ7JTYQvuroSAAi/6b7ttLraqmxuSBS2bzlNhQiO6/xDXIIAHzWlzyy381Y4KU6TlOc7kQ== X-Received: by 2002:a17:90a:e2d4:: with SMTP id fr20mr31207777pjb.85.1575871175608; Sun, 08 Dec 2019 21:59:35 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id p17sm24021572pfn.31.2019.12.08.21.59.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Dec 2019 21:59:35 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, trini@konsulko.com Subject: [PATCH v3 02/16] efi_loader: add CONFIG_EFI_SECURE_BOOT config option Date: Mon, 9 Dec 2019 15:00:42 +0900 Message-Id: <20191209060056.32426-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191209060056.32426-1-takahiro.akashi@linaro.org> References: <20191209060056.32426-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 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index c7027a967653..fc4199838c98 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -115,4 +115,20 @@ 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 + imply SHA256 + depends on ASYMMETRIC_PUBLIC_KEY_SUBTYPE + imply RSA_VERIFY_WITH_PKEY + imply X509_CERTIFICATE_PARSER + imply PCKS7_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