From patchwork Tue Dec 8 04:12:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 339686 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3365395jai; Mon, 7 Dec 2020 20:12:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcg6pJYPlErrfERBmfHZHql9FhI+0CnMH0GWcIuRnzUlRemc526gtHmvkqpXhx8YzAZvUS X-Received: by 2002:a17:907:961b:: with SMTP id gb27mr21217378ejc.313.1607400779797; Mon, 07 Dec 2020 20:12:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607400779; cv=none; d=google.com; s=arc-20160816; b=0mN34X/VtHnk2K8fs/ckHuHyE09v9lGVJd8F4naWa4gu12WSO7W9yQG+fSt9UI+oF8 PEwHNSCxE/C4fPy7+LclFoft7ydn8bgtWjCXwOe1p8BnWC0nuvIbBCqZ9yeh9dJopY5d ev419o2bCO0fTlDRN06JBfxMm58YVK6niYsifq8ig/skjJm81TeaSCguzF+poqOscNBz CPCvwQ4z/ThzKE9P7eH8kOX1/kLuoDXs82kpn6rcT7W34KH0f4YPyH+n8xJhZvU/576k drXMPzNbah+l4eB+UQMMpD05p0GZILAYr4Yz6hbpHM+HOd8XGcC6IimmOlRwMKCvlr2+ ONXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3Jv0/cq8aEhlDcAadjWr//5EprvpJXz6eG0e+ZJBnLQ=; b=ZncmlFqQ+/CErkTc5gSWzVQ4Phqp6XxjJ3dBzA89Bh5Wh5/nHRF4B7JRUtzxEA46qn dPlMkJE/zAJx/aUjxkegTb5GIXQA0pHV7KQfunAcPNhmKOhNt50BwQkjFjtQkxctd1XG SP3TdpsR6+yWQL/snTZk77OqQKYwZRcozJqxOLkOl3EWGDZ2JotbZXpStLy7roWTX+rR qQ+tDA7fGFUAac9WWGCxYF4dS1lROZw2lGfUtvrhnqiWVSe/HQskIU12WdxZOBKKY9Iv aGioT0pBgWgY8a/7okuE7AwuKE/GfKln5HqsTVNv7WIzfMGAGX2KnnKtkpRUDNuu9L9X yn5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tHezSYx0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id v1si1045609ejd.451.2020.12.07.20.12.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 20:12:59 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tHezSYx0; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1AC2082309; Tue, 8 Dec 2020 05:12:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tHezSYx0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0013823ED; Tue, 8 Dec 2020 05:12:39 +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=1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (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 52AE7806C5 for ; Tue, 8 Dec 2020 05:12:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=joel.stan@gmail.com Received: by mail-pg1-x542.google.com with SMTP id q3so11036135pgr.3 for ; Mon, 07 Dec 2020 20:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3Jv0/cq8aEhlDcAadjWr//5EprvpJXz6eG0e+ZJBnLQ=; b=tHezSYx0uHkAmGAeft7O+Fjq8vlc0C3j6Q7Il9a+1Ozoq95AiuewSv/AN5No1UUZ28 qAhvxr3gSUi/mrxTxQTsHKILyWu00toZGqaNBiX2whtty0mlXwp6bEuxTDy9CmJd6dRs I4lljyVkFyMdPOBAvTmFH4wAfwmTT2uwT1uD1kwaj8cQXsPkUahc/b21fadKcVoDJo1I MvTmIFTgxBK3p/iRBOgml6dkcJT9yWOJ4KnoJlxwfzR3d4sDZyX+Twip4jPt1SC1Y6Nh k0uQyJT2SpUalhc8Es6PhBB+8UcyI8goZHJUrrtcuTGzZ+SO9Kz22MbdUgzTzHptydLq MfVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3Jv0/cq8aEhlDcAadjWr//5EprvpJXz6eG0e+ZJBnLQ=; b=tkRQqVd1FiZHMFPs2CK14tWqA5/Z06ODLQNIKAf4B9OeN113reqcAuMU1R4FSyYoPP eB2GPfaJYQzJhTyTmCuvfIBkgf4bxJS5LXfS8/OLXKlHujjz5rWG1wkcI7Ck41cgxikB /kLn2rE9YcX8c4GlP5lyD8EgNHy5gFllikk8DeBWT4uHWaPMQok8U5xH9dmqimtWANoJ Ym79PuysKjSaErbwL0Dsr3JvUOkgqK/l+OnigfnKwAAhxH4rHryBeC1xZwLDFvs8pJt6 3WhhizS4rod6dXnE7T+frq8SFlSPEcZ0lAj1FDEE28C1kqf2josyNbkqZ5UBtuPSOWd0 wPbA== X-Gm-Message-State: AOAM531GrlWiW3pMLWVkBwy+4HZKr05ixI90Whenrdo3SHpa6Z6LHVEx RCJJ7QI6ZA7M5XqrfgkNy1o= X-Received: by 2002:a63:4041:: with SMTP id n62mr21233474pga.299.1607400755809; Mon, 07 Dec 2020 20:12:35 -0800 (PST) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id j20sm6055162pfd.106.2020.12.07.20.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 20:12:34 -0800 (PST) From: Joel Stanley To: Simon Glass , Heinrich Schuchardt , Philippe REYNES Cc: u-boot@lists.denx.de Subject: [PATCH v2 2/4] image-fit: Fix FIT_CIPHER linking Date: Tue, 8 Dec 2020 14:42:14 +1030 Message-Id: <20201208041216.888902-3-joel@jms.id.au> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201208041216.888902-1-joel@jms.id.au> References: <20201208041216.888902-1-joel@jms.id.au> MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean When CONFIG_FIT_CIPHER=y and CONFIG_FIT_SIGNATURE=n is there is no implementation of image_get_host_blob for mkimage/dumpimage: /usr/bin/ld: tools/common/image-cipher.o: in function `fit_image_decrypt_data': image-cipher.c:(.text+0x9a): undefined reference to `image_get_host_blob' Move the implementation to a common file so it can be shaed between image-cipher.c and image-fit-sig.c. Signed-off-by: Joel Stanley --- v2: Fix compilation when signature and ciphering are both enabled --- common/image-fit-sig.c | 14 -------------- common/image-fit.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) -- 2.29.2 diff --git a/common/image-fit-sig.c b/common/image-fit-sig.c index 5401d9411b98..d39741e9058f 100644 --- a/common/image-fit-sig.c +++ b/common/image-fit-sig.c @@ -19,20 +19,6 @@ DECLARE_GLOBAL_DATA_PTR; #define IMAGE_MAX_HASHED_NODES 100 -#ifdef USE_HOSTCC -void *host_blob; - -void image_set_host_blob(void *blob) -{ - host_blob = blob; -} - -void *image_get_host_blob(void) -{ - return host_blob; -} -#endif - /** * fit_region_make_list() - Make a list of image regions * diff --git a/common/image-fit.c b/common/image-fit.c index c82d4d8015f0..664a0d00006c 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -112,6 +112,21 @@ int fit_parse_subimage(const char *spec, ulong addr_curr, } #endif /* !USE_HOSTCC */ +#ifdef USE_HOSTCC +/* Host tools use these implementations for Cipher and Signature support */ +static void *host_blob; + +void image_set_host_blob(void *blob) +{ + host_blob = blob; +} + +void *image_get_host_blob(void) +{ + return host_blob; +} +#endif /* USE_HOSTCC */ + static void fit_get_debug(const void *fit, int noffset, char *prop_name, int err) {