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=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 E07C6C433F5 for ; Tue, 14 Sep 2021 22:44:36 +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 C2DF660F8F for ; Tue, 14 Sep 2021 22:44:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C2DF660F8F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4F71080ECB; Wed, 15 Sep 2021 00:44:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="JAOwwDEt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B677880796; Wed, 15 Sep 2021 00:44:29 +0200 (CEST) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (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 7AC3F805DF for ; Wed, 15 Sep 2021 00:44:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x735.google.com with SMTP id w78so1350054qkb.4 for ; Tue, 14 Sep 2021 15:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SWRIGQZYUltsBSQz5JOijIUApBZZu3JDio7Pb2W++8s=; b=JAOwwDEtMJzLr/WsYu+H4mjWxxwffVScS92CBivbFZTgH2QY5eYmBmSYqPWE/hjMFi zPrZ5Suj+YbLpLSbQvPexmIAoCwqZB2l2qrgv3kbkb79WGh+r4+3/5/WIT7O+ZmG/LYa kzAdSwM6tWsgeeLe6/joMeGSjK6sTLQw4NuOY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SWRIGQZYUltsBSQz5JOijIUApBZZu3JDio7Pb2W++8s=; b=cB1rRSUAuQBsphcaz9cVfx4DEt/c316cTDNTYcc0dmeo+hHDlJmPuhjfX+6doYlofC ATmmfdA6dVlMdP7clFaI06uWWy8Xvv7Op3W6Z+GPcqdu+O7t0+FvRPzJOc3wSRciQoXQ IIiYplAso1RzL8Pmt4w9JB5OUBQFwRX0bUiwf3AFOR88uYZMBAkxntz+kll7Kxvm4WGz F3a17fECtMkuVSyorrvwBujBeqB4CCerVOFCtldiFZFbXUn2AOdPTTzrq4zKtjMlww13 /oqN68rm1B0eMAjYVlFcQETW2kxWPgxOUGbdlqTI2JV52KxfBUn/zrvb/wghNMFcbno+ GIEQ== X-Gm-Message-State: AOAM532MNBTqwpFwKsr04oVU+as2VTqz9ag9mD6sfvHOE68ZkkhAls5L v00IlkGu4/RU/WHi+AAFeWcPKA== X-Google-Smtp-Source: ABdhPJzuLi/CqkBd969Yce+7AzMbmk/YXuuz0Ypyn9hlpNzvcZC4hamuqmJcqHzUt2g1zNf+ht296Q== X-Received: by 2002:a37:a905:: with SMTP id s5mr7393428qke.63.1631659463006; Tue, 14 Sep 2021 15:44:23 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-682c-a086-e3f8-65b4.res6.spectrum.com. [2603:6081:7b01:cbda:682c:a086:e3f8:65b4]) by smtp.gmail.com with ESMTPSA id u13sm8530033qki.38.2021.09.14.15.44.21 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Sep 2021 15:44:22 -0700 (PDT) Date: Tue, 14 Sep 2021 18:44:20 -0400 From: Tom Rini To: Alexandru Gagniuc Cc: u-boot@lists.denx.de, sjg@chromium.org Subject: Re: [PATCH] image: rsa: Move padding_algos to linker lists Message-ID: <20210914224420.GM12964@bill-the-cat> References: <20210818224902.2286717-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4T9XHU/D8Lz3laf6" Content-Disposition: inline In-Reply-To: <20210818224902.2286717-1-mr.nuke.me@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) 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 --4T9XHU/D8Lz3laf6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 18, 2021 at 05:49:02PM -0500, Alexandru Gagniuc wrote: > We are not guaranteed to have the padding_pkcs_15_verify symbol since > commit 92c960bc1d ("lib: rsa: Remove #ifdefs from rsa.h"), and > commit 61416fe9df ("Kconfig: FIT_SIGNATURE should not select RSA_VERIFY") >=20 > The padding_algos only make sense with RSA verification, which can now > be disabled in lieu of ECDSA. In fact this will lead to build failures > because of the missing symbol mentioned earlier. >=20 > To resolve this, move the padding_algos to a linker list, with > declarations moved to rsa_verify.c. This is consistent with commit > 6909edb4ce ("image: rsa: Move verification algorithm to a linker list") >=20 > One could argue that the added #ifdef USE_HOSTCC is ugly, and should > be hidden within the U_BOOT_PADDING_ALGO() macro. However, this would > be inconsistent with the "cryptos" list. This logic for was not > previously explored: >=20 > Without knowledge of the U_BOOT_PADDING_ALGO() macro, its use is > similar to something being declared. However, should #ifndef > USE_HOSTCC be part of the macro, it would not be obvious that it > behaves differently on host code and target code. Having the #ifndef > outside the macro makes this obvious. >=20 > Also, the #ifdef is not always necessary. For example ecda-verify > makes use of U_BOOT_CRYPTO_ALGO() without any accompanying #ifdefs. > The fundamental issue is a lack of separation of host and target code > in rsa_verify. Therefore, the declaration of a padding algo with the > external #ifdef is more readable and consistent. >=20 > Signed-off-by: Alexandru Gagniuc Applied to u-boot/master, thanks! --=20 Tom --4T9XHU/D8Lz3laf6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmFBJbsACgkQFHw5/5Y0 tyxOXgv+MzOF2viytpvgD7czEDJPMIjuNItCmauD2HOXvURt4S70TCBvznSKi2DL A0zUjFOQ/VUWbUN4QeqVqJlIvxYV8UN++FHLndw75fWhTeKojsVqi/+RNo9VCUET tq1dsTr/nfOAoy6MdpWH4vZl10NOklvAwGNOegXOLXLfwq7Aqszrtcw11/iR+K84 nwiydTY99pdkR0qkJRAphRFWBf1sRKTHqjEkImSdBtvOAc22NZU+24Sa5m/g1Qam srwqUcQuTjHzZ3ZllYifmzxmQhtUcYgo6i04u7nAjyaiqxZpFQ5wrOZ8GZgLIxkB qXqHvNaSbl4vDOJaBfzdDbY6wQwM7ocqvETIJZJsnI+a2JCfKH4oOLh3EF7gxYY+ n2GD3M9YRyNCrwCD5Oo/jdQaCwdF/FJhuPhQWtVwCYPr8NsLnmONKFunUK/6lbGL hULs6kDkjK1jIEKUJJuQNIOqVsvB3vUMFwS8hqG0GDRx59Z/Iku/6ZXkr0NPWP3N 9L2yp1rE =v6Zn -----END PGP SIGNATURE----- --4T9XHU/D8Lz3laf6--