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.8 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 6BE38C636C8 for ; Tue, 20 Jul 2021 06:40:28 +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 E2B2961004 for ; Tue, 20 Jul 2021 06:40:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2B2961004 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 B10B08262E; Tue, 20 Jul 2021 08:39:52 +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="zvzxwGZY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A8B8F82C5E; Tue, 20 Jul 2021 08:39:32 +0200 (CEST) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 ECC4082C33 for ; Tue, 20 Jul 2021 08:39:15 +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=ilias.apalodimas@linaro.org Received: by mail-wr1-x434.google.com with SMTP id a13so24722874wrf.10 for ; Mon, 19 Jul 2021 23:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=g5XzcP2o+9ZYBLVTD/T75xEP1uBbG6WWztpeevMmJ4c=; b=zvzxwGZYHVya0chr9fzjAXPg+cq80mPtkvATd4E2miVDVwD2Jl4hyUCotcLEchMddT jx8+JsWbzC481ys8F+KNTHOB3ZH45K716tifj0suoemXELsLCm9pCI3mYP3vd8neeW5l GgOQmIazqjLmzsY4c4WSQGxhlZ1emFkSruFxahMQpnHqRbpw5y/2llySttfFWOHxXJL6 62M7VcnCDoDQJec2grzF+Zy1buX7XjbbaWDH2xYu9RwoZP6InvZ7oizu9zNxTLT0L8kq BNoQMNpvvKMo5EqrfUG+GGVA3xN7sDcu+EAgqLQ28Tsn8O8LZvXeW1pORsU+gij7Pqpw cnmg== 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:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=g5XzcP2o+9ZYBLVTD/T75xEP1uBbG6WWztpeevMmJ4c=; b=m/AIfT3EjHIbhaiE5P0yLPj/VyEw3tjXygEZGUhXPb/jJu9+GFRPNvua641Z07TgpI 2V/8KojOopGqJEek7iLx5FJlp7bAwjOEqqyxFHF38fkNqIMfWDOlqolU21eej9J97lus Sn0i0HN7AVD80z8XJ/32uk3CjGS1R3eayGwRQ8zqUkFedSjdBKFkyJXYdP9kBAoR5IPc 2uMbfSk5djUtsr+i8u7Qj7nC+n+egn4+2VxXzOXYqHLVdZIDB5wxzBPcuTf0M9hbBRqE 7wVReR1a+dsZe3swm3PDGOb0u7dUnljYGu1prVxIreeCddGSRvocn8LN4hKFoeuD3Qky Lxng== X-Gm-Message-State: AOAM533NV3iTSmwG5EPNgVQFDSs91h9sVu9UgxlX62N0GemRLAeazsqH NlpLeMI/dFf7ZbhiGP8DS3HvMw== X-Google-Smtp-Source: ABdhPJyRb5r3uFX+jLSBV+Agc3kLOLDjG/mRPpkqG6KdhAwKrNWn0cUaWr953pUOKxiGaeJ5+LDlWQ== X-Received: by 2002:adf:dcca:: with SMTP id x10mr33488012wrm.59.1626763155478; Mon, 19 Jul 2021 23:39:15 -0700 (PDT) Received: from enceladus (ppp-94-66-243-35.home.otenet.gr. [94.66.243.35]) by smtp.gmail.com with ESMTPSA id o7sm15115216wrs.52.2021.07.19.23.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 23:39:15 -0700 (PDT) Date: Tue, 20 Jul 2021 09:39:12 +0300 From: Ilias Apalodimas To: AKASHI Takahiro , Heinrich Schuchardt , sughosh.ganu@linaro.org, u-boot@lists.denx.de, agraf@csgraf.de Subject: Re: [PATCH] efi_loader: capsule: add a debug message in case of no key Message-ID: References: <20210510081931.43983-1-takahiro.akashi@linaro.org> <656e9aad-86cf-b988-8deb-b85f18237d9c@gmx.de> <20210720021340.GB77259@laputa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210720021340.GB77259@laputa> 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 Akashi-san, On Tue, Jul 20, 2021 at 11:13:40AM +0900, AKASHI Takahiro wrote: > 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." > Correct. My patch intentionally leaves out that part and I hope someone will need it and implement it. > 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". Keep in mind that the makefile currently checks for the .esl file. if the file is not found there's a compilation error, prompting the user to add a valid file Thanks /Ilias > > -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) > > > > >