From patchwork Mon Jan 30 14:42:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1734185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=KUIGgRbJ; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P5BqK1rV3z1yhq for ; Tue, 31 Jan 2023 02:26:37 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DBEA585A05; Mon, 30 Jan 2023 16:21:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="KUIGgRbJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3E3EB85802; Mon, 30 Jan 2023 16:11:47 +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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 338CA85850 for ; Mon, 30 Jan 2023 15:59:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12c.google.com with SMTP id u8so5182221ilq.13 for ; Mon, 30 Jan 2023 06:59:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qbOObNRkea2VpWYS1pMO8tx+fMqDmyXxcpD49yioOdE=; b=KUIGgRbJq5XB2+INZ3gw9W3h6Nx5ywTdJUSQczRn/bctZmWF/Pg+5gyflLYKvMv7of IeijlSETifkZJ+pBzUmAEUDEHJmVPCzy1rtmGUdHf68BMNJ3/Y7KlEKutlmkK5XF4s18 1Tr+r+9lvnp1s91Ov8SaV8vtVRkQspwinc6a4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qbOObNRkea2VpWYS1pMO8tx+fMqDmyXxcpD49yioOdE=; b=zr2YQS6Ep7tbz71JQHmgtCDxTy5mzK6+0Cye8LsJV15PP+4O0B7F2CVdiHp8Za4NW0 FfSLqDVi1qkEuEqAyX1rt9ZPSa6kqFc0cb8DaOMQkPoNH2QG0e40C6axz/OqU/O/fedL 0dlyDN11oJnhwM4otqmKTv/SnEy389bhG29Ny+VNFeay1OUjLF7nUFt0odQymPXotHTC 9IIzz0Q4KHFtEQ6Gb1G5zmnKqdEN1/ekV1nEKdwoMQAq4JNez4xus/NJvylkaIAOznkM MlY8waMXixqI/wZ2Aadww/aQxGWBv/td6So60K+fCo38iRMIQYrpdSFmSZGrKHotmjVR XnVQ== X-Gm-Message-State: AFqh2koj3y5e6yp+dAl9O0dq4HMLuX9aViuoLvgUBSpfe1XHjnhFAxVo UWHkOpcsqXZDoorThPKmCjkJAzoSbt0h+v5b X-Google-Smtp-Source: AMrXdXvpFig3/ibdSMgu+xczHpUY/CYMbMC8h4+eJzFHWIL/p8qvZ+c54W/ITn4zENB71WbTG/d1/A== X-Received: by 2002:a05:6e02:1a61:b0:30c:5c54:c25a with SMTP id w1-20020a056e021a6100b0030c5c54c25amr47374430ilv.14.1675090721822; Mon, 30 Jan 2023 06:58:41 -0800 (PST) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id g18-20020a926b12000000b0030bfdb6ef60sm4008830ilc.58.2023.01.30.06.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 06:58:41 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Gaurav Jain Subject: [PATCH 093/171] Correct SPL uses of FSL_ISBC_KEY_EXT Date: Mon, 30 Jan 2023 07:42:06 -0700 Message-Id: <20230130144324.206208-94-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230130144324.206208-1-sjg@chromium.org> References: <20230130144324.206208-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean This converts 9 usages of this option to the non-SPL form, since there is no SPL_FSL_ISBC_KEY_EXT defined in Kconfig Signed-off-by: Simon Glass --- board/freescale/common/fsl_validate.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/board/freescale/common/fsl_validate.c b/board/freescale/common/fsl_validate.c index 451341ddc04..b4d2bd5b708 100644 --- a/board/freescale/common/fsl_validate.c +++ b/board/freescale/common/fsl_validate.c @@ -29,7 +29,7 @@ #define CHECK_KEY_LEN(key_len) (((key_len) == 2 * KEY_SIZE_BYTES / 4) || \ ((key_len) == 2 * KEY_SIZE_BYTES / 2) || \ ((key_len) == 2 * KEY_SIZE_BYTES)) -#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT) +#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT) /* Global data structure */ static struct fsl_secboot_glb glb; #endif @@ -63,7 +63,7 @@ self: goto self; } -#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT) +#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT) static u32 check_ie(struct fsl_secboot_img_priv *img) { if (img->hdr.ie_flag & IE_FLAG_MASK) @@ -188,7 +188,7 @@ static u32 check_srk(struct fsl_secboot_img_priv *img) { #ifdef CONFIG_ESBC_HDR_LS /* In LS, No SRK Flag as SRK is always present if IE not present*/ -#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT) +#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT) return !check_ie(img); #endif return 1; @@ -278,7 +278,7 @@ static u32 read_validate_single_key(struct fsl_secboot_img_priv *img) } #endif /* CONFIG_ESBC_HDR_LS */ -#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT) +#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT) static void install_ie_tbl(uintptr_t ie_tbl_addr, struct fsl_secboot_img_priv *img) @@ -434,7 +434,7 @@ void fsl_secboot_handle_error(int error) case ERROR_ESBC_CLIENT_HEADER_INVALID_KEY_NUM: case ERROR_ESBC_CLIENT_HEADER_INV_SRK_ENTRY_KEYLEN: #endif -#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT) +#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT) /*@fallthrough@*/ case ERROR_ESBC_CLIENT_HEADER_IE_KEY_REVOKED: case ERROR_ESBC_CLIENT_HEADER_INVALID_IE_NUM_ENTRY: @@ -571,7 +571,7 @@ static int calc_esbchdr_esbc_hash(struct fsl_secboot_img_priv *img) key_hash = 1; } #endif -#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT) +#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT) if (!key_hash && check_ie(img)) key_hash = 1; #endif @@ -705,7 +705,7 @@ static int read_validate_esbc_client_header(struct fsl_secboot_img_priv *img) } #endif -#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT) +#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT) if (!key_found && check_ie(img)) { ret = read_validate_ie_tbl(img); if (ret != 0) @@ -851,7 +851,7 @@ static int secboot_init(struct fsl_secboot_img_priv **img_ptr) return -ENOMEM; memset(img, 0, sizeof(struct fsl_secboot_img_priv)); -#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT) +#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT) if (glb.ie_addr) img->ie_addr = glb.ie_addr; #endif @@ -952,7 +952,7 @@ int fsl_secboot_validate(uintptr_t haddr, char *arg_hash_str, else ret = memcmp(srk_hash, img->img_key_hash, SHA256_BYTES); -#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT) +#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT) if (!hash_cmd && check_ie(img)) ret = 0; #endif