From patchwork Tue Jan 28 08:25:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1230203 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.a=rsa-sha256 header.s=google header.b=TtBox/CB; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 486KTT4bb2z9sP6 for ; Tue, 28 Jan 2020 19:26:37 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A423D819AD; Tue, 28 Jan 2020 09:26:30 +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="TtBox/CB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 31E64819A8; Tue, 28 Jan 2020 09:26:29 +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 4BD1D8197F for ; Tue, 28 Jan 2020 09:26:25 +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 185so2466998pfv.3 for ; Tue, 28 Jan 2020 00:26:24 -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=s71DxYooTwaNTgxJRZh4xuFP1Jq+Er00vKzcYIanQNI=; b=TtBox/CBzOW6xMEBqZ3XGQly/B2/PTEqMJxJ9eTadaSh9I2oogqW5gpSosokjw6329 w/Rs8aNu8KiN/zt6xkQXfNMKpwKunabRhgbZnFCV3o5wn3oCpzV1GkIaQBvCTQQtxuF5 +I3v+kCTz7GYRRxHZE7fkWwcadU1JdMaN9iGKk1xjhC7DRiRJulKDg1ma2+zFcDJRNGx g/qvhV8tX5f1/OIZcBJ7FU4oPBkzt3AXPVe0aUjYQ7U87bHn3vh4oFgiwHzXFsdQJ4aX SpZjl4S+yy0C1htZju05Ae9KaqOliQAItV7gDxpAOWv/jlxgy/vHJw3Cqxf8pfT97ncS +qYA== 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=s71DxYooTwaNTgxJRZh4xuFP1Jq+Er00vKzcYIanQNI=; b=nzoR+0cjSN/k7cF6GyDvi8tlB6Q1tv/R/zYZXPYJ0G9qIwm7k/aEGms/MJSe1zBUWI o+lvwZoh53gqj4g/KV6RndgHo5VNg7OQQ/K18FY7U7p4jWnXqiMWWvL9QKhfQ/a6mxqj RLjzY9m1tKk9Kzbqk8s8T9uyfw5WW1z/AlChKbQsJxpap6nqsDZZv8/DMAoEOS/uANOl 5ApVMtnC0SKe8Yg8fS4D51HYaY7nvN21KKZK1GdhzRpsXPBOls1pzASvV/Zc2uoIpmUk Q9/byQy0M/xAiusNzfUKvWzlpAz3CA8TupDtmqHHMNrbossbPxo90l77VrY/kCvUQTGr Vy5A== X-Gm-Message-State: APjAAAVsUJE4QZEhIf84u+yMXKg1kFL1P324gw7nn4x+6g3OwyB0Yzm4 +CDp1jkFFpivq4/ipiuj2tDULA== X-Google-Smtp-Source: APXvYqyY3PMk3T4DE+T3220A1MmZOyF1WWvaejfBEeyvQsyd8wh5NTkSCphLAqXqp0j4eOLBrBFigA== X-Received: by 2002:a63:2901:: with SMTP id p1mr23298033pgp.396.1580199983185; Tue, 28 Jan 2020 00:26:23 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id f127sm18501149pfa.112.2020.01.28.00.26.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jan 2020 00:26:22 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, trini@konsulko.com Subject: [PATCH v5 01/16] efi_loader: add CONFIG_EFI_SECURE_BOOT config option Date: Tue, 28 Jan 2020 17:25:17 +0900 Message-Id: <20200128082532.15943-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200128082532.15943-1-takahiro.akashi@linaro.org> References: <20200128082532.15943-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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index a7afa3f29e88..4b09a07f1b0a 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -130,4 +130,22 @@ config EFI_RNG_PROTOCOL "Support for EFI_RNG_PROTOCOL implementation. Uses the rng device on the platform" +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