From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACE1AC07E95 for ; Tue, 20 Jul 2021 02:14:02 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EB15161107 for ; Tue, 20 Jul 2021 02:14:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB15161107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 88E0E81BDA; Tue, 20 Jul 2021 04:13:59 +0200 (CEST) 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="WbgbyGzi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF3398262E; Tue, 20 Jul 2021 04:13:57 +0200 (CEST) Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (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 B29CA81BC0 for ; Tue, 20 Jul 2021 04:13:54 +0200 (CEST) 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-x1034.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso1577192pjp.5 for ; Mon, 19 Jul 2021 19:13:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=m7T5ffOi9xh+2MZMcsm9Xkws8ZqHcE1FMRlrUcYMA4M=; b=WbgbyGziMN4Ze4jcedSk1et66vbOUt6mdVg25Xz/WzBGtrkIvyvpeWr06YQeBSX+LX C7RcC7xoZ8KMl9TTHc8zZg2abFMMdeG57VFkmUzxzypJrUKeFNm4F6EinCSLTWr3ezl9 /vrGo5hS1UbVtHotFlsxTCzDoBfxBgZ6/aYHqTVbqTz25rr16fWs7KgG6ZE/TX92vNB1 NnUGS203ROgUKTMIJ8b6LX4URZt/BdnTU6j7O5+x5pU/7u2MTtRZGEt3rh4wrv3phC/D fTyLgQQB94frCPfYezwH5wJyNrbvv4xUvlYowvJw0HOQkkbQLdYo4IbC6OxJ+FmlE4PW XL9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=m7T5ffOi9xh+2MZMcsm9Xkws8ZqHcE1FMRlrUcYMA4M=; b=aUBGzAgTIBLBkjN1smdBYWcJCQsCsWrYKY6E5pP1sj/se4jjWV+yS85zrKCOsFmpPe 0GXopIp+AdnRGnGj8M6wrxHnUvOw7q6XFVL0pwz/JpNcUXvOuLmPEiOg+yQBwmgNDISe a2InYadNdtLt+YyYibZnrc4xnVwbOHSXvPx8qlUHX3LZzBMhXft96/kQZ3gINf6y8Y/8 Nwy7zekD7Oyp7Ko2mrlLZjJSmU4tvpF9KMtb5z33TnaskFRk+4UBgCeu2qmoxATzaU8e Vry2grewYQYrfwKDWXJvjnO4PHQnlxLWPPhtjr8H9wKRCKLVoyTkFdVtTZoncKnfN+tR yU6Q== X-Gm-Message-State: AOAM531M6GP2tjdKPwuZzGS3ncq+aBAa+Hikz+I2K/qye07adNyu9y8A KYQD9aZagbdyf66LRvhv3b+RtQ== X-Google-Smtp-Source: ABdhPJwpLzhNtvxd2O95E2r9blur7tBJDfX03wRpU0IMD8v7tn7UalPoVncHH3GTKNOll31qIW47CQ== X-Received: by 2002:a17:90a:8403:: with SMTP id j3mr28181367pjn.212.1626747233082; Mon, 19 Jul 2021 19:13:53 -0700 (PDT) Received: from laputa (p784a236a.tkyea130.ap.so-net.ne.jp. [120.74.35.106]) by smtp.gmail.com with ESMTPSA id n4sm21625033pff.51.2021.07.19.19.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 19:13:52 -0700 (PDT) Date: Tue, 20 Jul 2021 11:13:40 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: sughosh.ganu@linaro.org, u-boot@lists.denx.de, Ilias Apalodimas , agraf@csgraf.de Subject: Re: [PATCH] efi_loader: capsule: add a debug message in case of no key Message-ID: <20210720021340.GB77259@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , sughosh.ganu@linaro.org, u-boot@lists.denx.de, Ilias Apalodimas , agraf@csgraf.de References: <20210510081931.43983-1-takahiro.akashi@linaro.org> <656e9aad-86cf-b988-8deb-b85f18237d9c@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <656e9aad-86cf-b988-8deb-b85f18237d9c@gmx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, May 20, 2021 at 04:06:12AM +0200, Heinrich Schuchardt wrote: > On 5/10/21 10:19 AM, AKASHI Takahiro wrote: > > It will probably be a common error case that a certificate (public key) > > is not provided by the system while capsule authentication is enabled. > > So add a debug message. > > > > Signed-off-by: AKASHI Takahiro > > --- > > lib/efi_loader/efi_capsule.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c > > index 90893f85e22c..84ddaf50d13f 100644 > > --- a/lib/efi_loader/efi_capsule.c > > +++ b/lib/efi_loader/efi_capsule.c > > @@ -316,8 +316,10 @@ efi_status_t efi_capsule_authenticate(const void *capsule, efi_uintn_t capsule_s > > } > > > > ret = efi_get_public_key_data(&fdt_pkey, &pkey_len); > > - if (ret < 0) > > + if (ret < 0) { > > + debug("Public key/certificate not found\n"); > > Currently the only implementation of efi_get_public_key_data() actually > providing keys is the one in board/emulation/common/qemu_capsule.c where > the user has to manually upload the esl file. > > For future implementation it is preferable to build the public key data > into the U-Boot binary. If it is part of the build process then the only > error that could come up is that the public key data has the wrong format. Now Ilias posted a patch to embed a public key in the U-Boot binary. But it won't be the only solution in the future and the system owners may want to provide a key in their own way; hence, it might not be "part of build process." So I think that adding a message is still valid, even it should be treated as an error message instead of a debug message to warn "users". -Takahiro Akashi > If we are using the weak implementation of efi_get_public_key_data() in > lib/efi_loader/efi_capsule.cwith CONFIG_EFI_CAPSULE_AUTHENTICATE=y, the > system is misconfigured. Do we need that weak implementation at all? I > would prefer to remove to get a build error. > > I suggest that you add a log_err() message with above text into the > board/emulation/common/qemu_capsule.c implementation of > efi_get_public_key_data(). This way the user will see that he forgot a step. > > Best regards > > Heinrich > > > goto out; > > + } > > > > pkey = malloc(pkey_len); > > if (!pkey) > > >