From patchwork Tue Dec 8 04:12:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 339685 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3365311jai; Mon, 7 Dec 2020 20:12:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBwATaWJM9GVQ1q+5tabxYC4KyG8v5//IMFFnj2NT5cge6WGLHxOO9/Vq7xzykOY2t5Gs/ X-Received: by 2002:a17:906:52c4:: with SMTP id w4mr21842109ejn.165.1607400767167; Mon, 07 Dec 2020 20:12:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607400767; cv=none; d=google.com; s=arc-20160816; b=ghqD8Mn6FWBWlNUrqJCOe2KdZg63Ac8dFenxtihoQc3gN7hwoPwLgwkCtLME6fGW+1 nTr+LcOQXtGJwMs/Trl/pT06MCZnwslhcV0FGl/7HBjXSXS4OsKZnFLbll5Tdc0KAl16 bK0vBtNnNZ51/piLIzmVaks6ncuxA/OGVTdYU65QgIJ+YqrX9cMKsetAEHz7eDCPjZeO n84cLRqJzmGJvsiuqex8DIOf/SH4MVsccyB0KVx74t0gll8V1Oq6qcTOdjx2+t2oKW8S Xa0/0A2WMIkVBddwYj7laaOkZl9qyaUQ++68ImOceWMnSfXQ3DsCmKbaD4itbveBfuIw bieg== 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=fdfYOrDQ+5jHBpj98tjZyiZwzoA4eUHCyBe+aQEaYaI=; b=nBs/V1hrwjhZF1bYperlh+VflwKX1CV0TE8ROzoBWYTo/uFRJvYyz4YKlyTMdN7wn9 RD/io5FnA50XolRQHRhyirT2D1X5NNIHzZL2qQvKPdUGtml878aWTsxRep0JyqScH0VU WXAWhmjW4lsM8lUl5+IpoEpq60roMvwGYyqH0CCVmh9qD+0ozNQ+AGI3/BViJSI0vRh5 eh1F24CDk59cWtKHF1oDwdYfAMR/iGqOm2TtIzMzgrxfdAdRiMTgQ1qb893XsxVujaSM AKQ6Af0LmhTrOoldf3IjvP0coz7zafc7vzzsRyu110zlyttH0EzJazdo0k+BTHgADoL6 vecg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=iFgbxjfc; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a11si7674005eje.119.2020.12.07.20.12.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 20:12:47 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=iFgbxjfc; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 349478232D; Tue, 8 Dec 2020 05:12:38 +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="iFgbxjfc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1191082300; Tue, 8 Dec 2020 05:12:36 +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-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (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 8269F806C5 for ; Tue, 8 Dec 2020 05:12:33 +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-pf1-x444.google.com with SMTP id d2so8732464pfq.5 for ; Mon, 07 Dec 2020 20:12:33 -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=fdfYOrDQ+5jHBpj98tjZyiZwzoA4eUHCyBe+aQEaYaI=; b=iFgbxjfckcDw4N+LfpCGIbb7Gz38LaT0Wg6GJSYr7hrM12jByEru0Q7l3NvzYsXLlq 4DBXBjOOhjTFMSpqNGtZrCgQkIdwlR3ekkfl6f9z57jvhhguKwnbtSmMSF2e5WbLvX9m ZWbGtXYN+UKblN+cH2H4LKGZHw9vK2//x5AFotzmO8YFZFMOtdSNhYsO2kMTChL+m8mw mMJx80wJ6aNAEjSktBXJvn/cjToZ6ZeR4F9JXDtwov7Uf+Aa2yR2sh5LMNN/PUUpUhRE DhQmiSZKomnrgBANjKFt8dwilUtECXWBhhb3u4s/r754FB9ltxmx/0UcM+8ihzLZT/Mm cIhg== 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=fdfYOrDQ+5jHBpj98tjZyiZwzoA4eUHCyBe+aQEaYaI=; b=XoMKarXwSxLrVX+7i4awwr7rtn3RWEWibtV1E6mE0r2EwnbuqUxR4TELNUG0hw6Xin 8QJ7t5FHYZvCwpIcuhRYWh7mu4FLd1O7F0Icaqn7QaPBeyEwgB/LMZFEWBJJgDFMo4Wi AduLIBwMIHDGkFvyusIX61EJFSoqSPncQPtxh7b5ZQ5GTyW7zr46nUZNHzPlH3NqEeuS Ug21LcFP7nfblfT2GrxpwBQ8RoJsx15QXbFEVel5x7lK2mvlwQzCW36fJcnZ2/GO77RY Ixw7Xf2vsXJL6LVdy81/lPc9JjEy89DiR2piv4HWCe6wtNik6FlZXACUFH0g3In1tDkS Rl7g== X-Gm-Message-State: AOAM5324F4tokyB8QBoHAhg+4Wo7TerqhaH1R1O2xleNeGmGDgs9dKsY dgF2KOmEa4eAtOkSSgXXBYI= X-Received: by 2002:a63:1113:: with SMTP id g19mr11675540pgl.23.1607400752021; Mon, 07 Dec 2020 20:12:32 -0800 (PST) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id j20sm6055162pfd.106.2020.12.07.20.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 20:12:30 -0800 (PST) From: Joel Stanley To: Simon Glass , Heinrich Schuchardt , Philippe REYNES Cc: u-boot@lists.denx.de Subject: [PATCH v2 1/4] tools/Makefile: FIT_CIPHER requires libssl Date: Tue, 8 Dec 2020 14:42:13 +1030 Message-Id: <20201208041216.888902-2-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 If CONFIG_FIT_CIPHER is enabled without CONFIG_FIT_SIGNATURE then mkimage/dumpimage will fail to link: /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' /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x10): undefined reference to `EVP_aes_128_cbc' /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x40): undefined reference to `EVP_aes_192_cbc' /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x70): undefined reference to `EVP_aes_256_cbc' /usr/bin/ld: tools/lib/aes/aes-encrypt.o: in function `image_aes_encrypt': aes-encrypt.c:(.text+0x22): undefined reference to `EVP_CIPHER_CTX_new' /usr/bin/ld: aes-encrypt.c:(.text+0x6f): undefined reference to `EVP_EncryptInit_ex' /usr/bin/ld: aes-encrypt.c:(.text+0x8d): undefined reference to `EVP_EncryptUpdate' /usr/bin/ld: aes-encrypt.c:(.text+0xac): undefined reference to `EVP_CIPHER_CTX_free' /usr/bin/ld: aes-encrypt.c:(.text+0xf2): undefined reference to `EVP_EncryptFinal_ex' collect2: error: ld returned 1 exit status Signed-off-by: Joel Stanley --- tools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.29.2 diff --git a/tools/Makefile b/tools/Makefile index 253a6b97065b..99a931312cd8 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -154,7 +154,7 @@ HOSTCFLAGS_kwbimage.o += -DCONFIG_KWB_SECURE endif # MXSImage needs LibSSL -ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),) +ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE)$(CONFIG_FIT_CIPHER),) HOSTCFLAGS_kwbimage.o += \ $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "") HOSTLDLIBS_mkimage += \ 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) { From patchwork Tue Dec 8 04:12:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 339687 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3365475jai; Mon, 7 Dec 2020 20:13:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxerG71N0+dA9T5g4uPYqHpFB8KxmD5wCiPXTa1exa2Lq0Qp8qPvEN8+rkP8l28FH7jOToS X-Received: by 2002:a50:c209:: with SMTP id n9mr11973321edf.123.1607400791170; Mon, 07 Dec 2020 20:13:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607400791; cv=none; d=google.com; s=arc-20160816; b=mQ9R8PVid9GeLE+lsf8wrqb48a3WYTMPCGEcS1j5wZY1IVn8XZo1HIiqQ0Vq9Cqg4b Qckhlp07Zu4sMMIyvg965KyrE4xtyzfin7mrx5jxzH4S8CfpjF8uwI8fKi1HlBFQwVOC SFkicEEn7HxBi6uKS5+HRXUeqW9DPxNsKjq8QUJkoP1G9v30DNwATAU6oZD05jOikWbR 7KNTQT/nTWiannmg+K/o8rMDPw00M1+89kX2xKpJqSO4j9n0ru+eQOm5qzDox8r4dJnv K0G8nMEyKUTo3vaWQ7tFwqe5A5uO+Q5GvXnzk+f1mK9LFdyuXEwEHrWk+9mV102fD0f7 D3gQ== 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=B9dB58QebQjv8joh71RoB3dp3pFDLiZ4c+qsL1Bcs84=; b=nATlv4EWnQ8EUZb31pzK6CyEySYvO7hTN3Oo4tnQ/PwXQdg+HyvELXqHiRgEFtcGJj RyJpKgcR+KcBKefhI2r/TMDxGW+6vuGXoNux0P1VPpWSI/K9VlZ9KXGFwRlmDpRxT6St vYSi5l8pIf4G0UqF9xQiWcW70O1FFjXwVStOehOJpFbUQ905lIbs1OBOSYPLFLCTT0Pi pFdxYpHXVzXTT7zctlLtbZtoxOGh6dbIsSuv7N5XmU3NQea5VvD7acasckADl3vZCucn 2rqzZkX11Ff8yEBTrBx1fLYheBsbSnobFy48DGHoAuxQ88fWKjOEzknA2Bgk8zEObX9g a2qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D6jUQkIu; 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 cb9si9357474edb.580.2020.12.07.20.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 20:13:11 -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=D6jUQkIu; 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 C7D1982300; Tue, 8 Dec 2020 05:12:44 +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="D6jUQkIu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B35A282300; Tue, 8 Dec 2020 05:12:43 +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-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (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 2AB8C823ED for ; 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=joel.stan@gmail.com Received: by mail-pl1-x62b.google.com with SMTP id 4so6308681plk.5 for ; Mon, 07 Dec 2020 20:12:41 -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=B9dB58QebQjv8joh71RoB3dp3pFDLiZ4c+qsL1Bcs84=; b=D6jUQkIuVr2Ij2RMDalkeN6xcLrTaoawEjJGgSAkL9sRePwP692GKy8cD6oTv430Xv c/e0kcGwWlGjEpc8HLcvD3C5KRlf2nEt2tHmkzL9cqhDQgT78ARMslNJqkj8Wl0W1ya0 OmGca9ORI1bD1MC1aTUa4yaW9s13qhUvrZjYb1CuYqqvG6pEK4CSKBtmppmvKwXygRdD tQYehWElbTehF6DdVi05O1Xstq9o4BLeER7p63il3lbJso6FoXbppXq277ELDfnjWC7d Pvz0G1mLNGvlBlC8wGOP2zQ6Zqff8MCYjmgc9QrLvSQTSFZj9u/zcFRJ89f7mIKMaMb4 X0Fw== 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=B9dB58QebQjv8joh71RoB3dp3pFDLiZ4c+qsL1Bcs84=; b=hAjEP6K6Hsw+qKZgsc/GSzQEjjz7gAc0sgz/daT8Q8yarS7GQJy8GBfdk8LbtKHV5I a0LSRsYDgtAOXrd4csUCrzahphf5aLvKa5aUVOHq8aLmHa7pURQUIGlikEUQ47sIvEPJ BqSEB6yA1PRymXqY7DTnuAMlApsy5tP/QqYihJgJnQHIVH8qlObgC11NyZzHTySzIgBL U4VPz0NuwdbqmbKyZ+hdjdi5x14kDNi7hMk2j061bHW4GPLBo7gTa/y3h+ENiV7Z0AmZ lPxoxl70u7CdUVnyVOC1fogLIXYe1t5Mh38nCDuL02ACXe/4W09RvoUZfIO7+ZTVvfMR l63Q== X-Gm-Message-State: AOAM530ihizxX8ipbPuU0a7Eo0hF/F9hkZoEWsORpr9M2KMH4IGSm7Ta Bb1nq9dKCjbntaPy9r46X3U= X-Received: by 2002:a17:902:8306:b029:da:d7f0:9e16 with SMTP id bd6-20020a1709028306b02900dad7f09e16mr16244265plb.53.1607400759774; Mon, 07 Dec 2020 20:12:39 -0800 (PST) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id j20sm6055162pfd.106.2020.12.07.20.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 20:12:38 -0800 (PST) From: Joel Stanley To: Simon Glass , Heinrich Schuchardt , Philippe REYNES Cc: u-boot@lists.denx.de Subject: [PATCH v2 3/4] mkimage: Move padding commands outside of FIT_SIGNATURE Date: Tue, 8 Dec 2020 14:42:15 +1030 Message-Id: <20201208041216.888902-4-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 These commands were disabled when CONFIG_FIT_SIGNATURE is disabled, but they do not depend on crypto support so they can be unconditionally enabled. Signed-off-by: Joel Stanley -- v2: New patch --- tools/mkimage.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.29.2 diff --git a/tools/mkimage.c b/tools/mkimage.c index e78608293e72..68d5206cb4fd 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -94,18 +94,18 @@ static void usage(const char *msg) " -x ==> set XIP (execute in place)\n", params.cmdname); fprintf(stderr, - " %s [-D dtc_options] [-f fit-image.its|-f auto|-F] [-b [-b ]] [-i ] fit-image\n" + " %s [-D dtc_options] [-f fit-image.its|-f auto|-F] [-b [-b ]] [-E] [-B size] [-i ] fit-image\n" " file is used with -f auto, it may occur multiple times.\n", params.cmdname); fprintf(stderr, " -D => set all options for device tree compiler\n" " -f => input filename for FIT source\n" - " -i => input filename for ramdisk file\n"); + " -i => input filename for ramdisk file\n" + " -E => place data outside of the FIT structure\n" + " -B => align size in hex for FIT structure and header\n"); #ifdef CONFIG_FIT_SIGNATURE fprintf(stderr, - "Signing / verified boot options: [-E] [-B size] [-k keydir] [-K dtb] [ -c ] [-p addr] [-r] [-N engine]\n" - " -E => place data outside of the FIT structure\n" - " -B => align size in hex for FIT structure and header\n" + "Signing / verified boot options: [-k keydir] [-K dtb] [ -c ] [-p addr] [-r] [-N engine]\n" " -k => set directory containing private keys\n" " -K => write public keys to this .dtb file\n" " -c => add comment in signature node\n" @@ -142,6 +142,7 @@ static int add_content(int type, const char *fname) return 0; } +#define OPT_STRING "a:A:b:B:c:C:d:D:e:Ef:Fk:i:K:ln:N:p:O:rR:qstT:vVx" static void process_args(int argc, char **argv) { char *ptr; From patchwork Tue Dec 8 04:12:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 339688 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3365549jai; Mon, 7 Dec 2020 20:13:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJx87PBmjsL1sjK99Fa0fGCjLg29asfppRf+/aiU1uMJt5yOzmGvDdyGvv2GOrneUKuWnHgx X-Received: by 2002:a17:906:c790:: with SMTP id cw16mr21945131ejb.344.1607400802041; Mon, 07 Dec 2020 20:13:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607400802; cv=none; d=google.com; s=arc-20160816; b=G9rj6Q+cAKJevjn7pEZi7kadJyBZa2QMoIgG+dW2irjJ7tUYczJfsuLl5TBuP5lgI+ Tb+W+T7s2B8+MkYpjKlSRCz9MB0dLCUp2R4jtTOonq9Os+GteqCXi9Xlme82SbWn/con DG1qn6I/QuHbaoNiUFs1CHpsC8TXptOtNjiiIkbLp+YMZTani2LqXd0WIpq1YHlQ9s7m ovcmuQ0kYs9iO5+e8jOwwinKrmaGsG9yjm1MOMOEslRacnYhGhE3hC9HuEBFJPS7lt4T 2tuG5TEPMG6uP5OkN6QET/w48W0+bLSxUWZQ1AcLVHtFmtQrIo7v3Vt321HhdpxhilrU p/LA== 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=RSIP2cEbSOdxW3qvNALuAQIEhaBfoUdb6Bv0jnFEOZw=; b=xCBeNOheQSPmY/Bb4TcTyIZVLl2A/4KytGIB+ZToHZjg+PJANVGg8ut8sWHgYJvzk6 du15EA4agh/FA8MdOBdMeCOm51Wdf2csshdKNjDI/a2Sy8EzMgp6Fresw+D56lvWy5M6 ljMT1ayYS2Ckc5I4Jd6xQHmNKJZWATHURMfMJxafP04pnkFGhdpMnYl5bV+qSSO5KI79 gxPGzpflvofNCoESLONYb+jWiW/k8X3kCiUdfFSbOcfPgE2EuJmVvzj+oYnRH6xdvJFt XTAcYaorHaMyJ9FyaKuhjzg6WrsWhuDWaw9dNGwXZvyedJJH7yPXhPwKkGi1XgM12n0P mNqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hEYNvHgX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id f15si7375642ejr.2.2020.12.07.20.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 20:13:22 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hEYNvHgX; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 B3D7F82591; Tue, 8 Dec 2020 05:12:48 +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="hEYNvHgX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 79A4E825A1; Tue, 8 Dec 2020 05:12: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=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-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (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 DAC4F823ED for ; Tue, 8 Dec 2020 05:12:44 +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-pl1-x644.google.com with SMTP id y8so315109plp.8 for ; Mon, 07 Dec 2020 20:12:44 -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=RSIP2cEbSOdxW3qvNALuAQIEhaBfoUdb6Bv0jnFEOZw=; b=hEYNvHgXMEOWt0ut8JdV68ZxEMRt5UtwI+V7TYZxtA146JfLtFPAY2jFdqngdjyWlh 7+awMnQ3Mw+p9hsCIiWx9TTdJ3Tq3e4VnX7NcBV9bXUCvfznQNusBQzR6T2RmUOlWmqo gQ7p2IWue6COtFovq5gfFm9waU23a+U8omWzC//rCEG8Ig7za/RCK+DCQxlSHkUJpiFz 8Cby9lUIWjt4T+hndt9W9MA5wZwuslPFc2R6Np+VT+tnOVQycM+HB1aHTg4UBG8WBfc3 uxmtqc8i+c/zQ9n9WROfnKCuv6FzEkZ+mfPavX/Mwl8OkYjy8wUEvKOewnEIzWfYNqcl 7f9Q== 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=RSIP2cEbSOdxW3qvNALuAQIEhaBfoUdb6Bv0jnFEOZw=; b=HHgTX/TRSbUjie7MIl+8ObBxqvimLH/QdkwF0kJ23iS+6O9UjTpne+tz69npLgQiSS lcwkH8Y3oXkMU4Qom8Gxlpkw/En+kVtTEFPl5xh3D4OygKo4P1jZ4JNY7qKvhmLdJ61s e9e6wXcNqoN+o4yExStKJwd1LNqKUjoXcnJaQpUH0E6XA9SQF5x0ctbRieVYK6Fj8NlI 6lyMDJZNTWFYcCwdjtDgg2xhHXgC+o6/p3CBC6E/WWkiYcqH+m82tpv6v6wNOd8N8JrF IDjA9kGQUaeV+2k/JommDv4V1Z2L+VB0MvXajvBQFwzCm63NmdmP4GlEoiTowoKrhKPH K39A== X-Gm-Message-State: AOAM533CuQpOGnsvsWuzjs4KbLwDc2ZHscAv0CuCjeDfb1j0/0yr43OL afFkgBG+gjX8yhDrLL5DPjo= X-Received: by 2002:a17:902:bf44:b029:da:d0ee:cef with SMTP id u4-20020a170902bf44b02900dad0ee0cefmr18707373pls.12.1607400763495; Mon, 07 Dec 2020 20:12:43 -0800 (PST) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id j20sm6055162pfd.106.2020.12.07.20.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 20:12:42 -0800 (PST) From: Joel Stanley To: Simon Glass , Heinrich Schuchardt , Philippe REYNES Cc: u-boot@lists.denx.de Subject: [PATCH v2 4/4] mkimge: Reject signing-related flags without FIT_SIGNATURE Date: Tue, 8 Dec 2020 14:42:16 +1030 Message-Id: <20201208041216.888902-5-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_SIGNATURE=n the signing options are not available. If a user is careful they will notice this when looking at the help output. If they are not careful they will waste several hours wondering why their FIT doesn't contain a /signature node, as mkimage will silently ingore the signing related options. Make it obvious that the commands don't work by removing them from the getopt opt_string. $ mkimage -f machine.its -k keys -K u-boot-pubkey.dtb -r image.fit mkimage: invalid option -- 'k' Error: Invalid option Signed-off-by: Joel Stanley -- v2: Leave padding related options in the CONFIG_FIT_SIGNATURE=y optargs --- tools/mkimage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.29.2 diff --git a/tools/mkimage.c b/tools/mkimage.c index 68d5206cb4fd..f7d3ac40e681 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -142,7 +142,11 @@ static int add_content(int type, const char *fname) return 0; } +#ifdef CONFIG_FIT_SIGNATURE #define OPT_STRING "a:A:b:B:c:C:d:D:e:Ef:Fk:i:K:ln:N:p:O:rR:qstT:vVx" +#else +#define OPT_STRING "a:A:b:B:C:d:D:e:Ef:i:ln:O:R:qstT:vVx" +#endif static void process_args(int argc, char **argv) { char *ptr; @@ -150,8 +154,7 @@ static void process_args(int argc, char **argv) char *datafile = NULL; int opt; - while ((opt = getopt(argc, argv, - "a:A:b:B:c:C:d:D:e:Ef:Fk:i:K:ln:N:p:O:rR:qstT:vVx")) != -1) { + while ((opt = getopt(argc, argv, OPT_STRING)) != -1) { switch (opt) { case 'a': params.addr = strtoull(optarg, &ptr, 16);