From patchwork Fri Feb 21 06:12:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1241897 X-Patchwork-Delegate: trini@ti.com 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=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=qSxWxw/R; 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 48P1Nf0yQmz9sPk for ; Fri, 21 Feb 2020 17:13:22 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A325881948; Fri, 21 Feb 2020 07:13:04 +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=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qSxWxw/R"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B9B9281935; Fri, 21 Feb 2020 07:12:58 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (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 B8EC681926 for ; Fri, 21 Feb 2020 07:12:54 +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-pg1-x544.google.com with SMTP id w21so438325pgl.9 for ; Thu, 20 Feb 2020 22:12:54 -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=DzzsH86ZH9zd6rcUzxnBpF97AXR7Md0uSZoLE3Y0ODE=; b=qSxWxw/Rvfl0bKwT+B902W1PRNs3zkh92T6fhY7fS1RG74/6oZHkGsJdLLVsvuzdhh mytHtjJD0zV5CjQ7bG6UGX8KQKD53PX4RNbczi79Eph9g7b0wnylvi1IcQf+3iFThpXG N2/8hkEnrW8gIgTsuMfnN/c4qNCPHTUOhIurDbmaEylDs9AaubuwKUBt5b+ybFn4UWm0 UmMAcNzhwAxv/6rfTh2nsGslkyxTa5/Ui3HB4XuMvV3wJ8MhRJp+StdCRqWIbWNZTdrO mBKBnhpxHhr1gBThzVKMehBySZBnF9CQXj+RNVazOhxciuyR8aMcmpF1OFm53H7i3K5v zRJQ== 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=DzzsH86ZH9zd6rcUzxnBpF97AXR7Md0uSZoLE3Y0ODE=; b=oU/GH6xyFSM77L0FhZdD2zuXMVzNCknURwhNWLhKgwYFsbh6YF9z9+1tzag3N2tl+K +o+AbT1rC1V2ajFZaMOPrcaltO+t6b/ENKfvx3WVfi7XJaDKBQALZdkPpqyzltahgrBu OkHsXfZ2mF4Cp3ph1n08/OWeibnwNhgpImFDqH9kkSLQ21c0BQjQ4V9baKH9qhcpNCmz wkd1W/whbe4aRM+96+ewQRbg+JJ7QybKCZvSMbjTFSHy2E42iE2F9W4AmxQ5WXwJrwGd a3eHXoAuo9pc2byfjykfln+KKVCToV1DCFIA2cyiRzOf85C/mUvRtC1MOAmgudYXdYYo 34QQ== X-Gm-Message-State: APjAAAUtbWMrS+sHzFjIFi6uugaLCzbHfR7aZgLEviGUEWJdj8ZL2O4V 0iDax6xfstDQoGNTtDJACOJ1MddQf6E= X-Google-Smtp-Source: APXvYqzPNrgmQIZ2Je5rMa39DxmgWrziGlo8PpMIzQ7K6v9inGCKTQEhjWhEKk8Jl74zGDVsxUtaDw== X-Received: by 2002:a62:ac03:: with SMTP id v3mr35581689pfe.17.1582265573160; Thu, 20 Feb 2020 22:12:53 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id k4sm1464205pfg.40.2020.02.20.22.12.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Feb 2020 22:12:52 -0800 (PST) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org, xypron.glpk@gmx.de, agraf@csgraf.de Cc: ilias.apalodimas@linaro.org, mail@patrick-wildt.de, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v7 3/7] include: image.h: add key info to image_sign_info Date: Fri, 21 Feb 2020 15:12:57 +0900 Message-Id: <20200221061301.19660-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200221061301.19660-1-takahiro.akashi@linaro.org> References: <20200221061301.19660-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean For FIT verification, all the properties of a public key come from "control fdt" pointed to by fdt_blob. In UEFI secure boot, on the other hand, a public key is located and retrieved from dedicated signature database stored as UEFI variables. Added two fields may hold values of a public key if fdt_blob is NULL, and will be used in rsa_verify_with_pkey() to verify a signature in UEFI sub-system. Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass --- include/image.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/image.h b/include/image.h index eb7aa5622aa3..ceede0d4385e 100644 --- a/include/image.h +++ b/include/image.h @@ -1170,6 +1170,13 @@ struct image_sign_info { int required_keynode; /* Node offset of key to use: -1=any */ const char *require_keys; /* Value for 'required' property */ const char *engine_id; /* Engine to use for signing */ + /* + * Note: the following two fields are always valid even w/o + * RSA_VERIFY_WITH_PKEY in order to make sure this structure is + * the same on target and host. Otherwise, vboot test may fail. + */ + const void *key; /* Pointer to public key in DER */ + int keylen; /* Length of public key */ }; /* A part of an image, used for hashing */