From patchwork Mon Feb 19 18:09:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1901086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=SYIusOYj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::637; helo=mail-ej1-x637.google.com; envelope-from=swupdate+bncbaabb3vsz2xamgqep2c3lbq@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-ej1-x637.google.com (mail-ej1-x637.google.com [IPv6:2a00:1450:4864:20::637]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TdrD66XDBz20Qg for ; Tue, 20 Feb 2024 05:09:57 +1100 (AEDT) Received: by mail-ej1-x637.google.com with SMTP id a640c23a62f3a-a3571b434bfsf65914866b.1 for ; Mon, 19 Feb 2024 10:09:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708366191; cv=pass; d=google.com; s=arc-20160816; b=X1fow75xcCwqiAhztG0iE2S/wg/UsGlWU9JZzZ0AlM2OtKD4KQ+H4pjd9/8fcj5l7j dUfiyG0CSXqPOkjraJpFb0/UV/A1cwu9uFLngZQQVPjznblHv02RPOXSWArwWvW7oHDL zZWCu6ybXDzZvVse+AS5yb/9SsFG4cmhOnVCaLfDUvTlpprmdVejIcbu24nmj5i1fCXo b424zJejwSOrrTBl+zBa1eJJ2If/V+HmFRMkLEjjvV+qj+LM0jqjsxhKahhZmflM3isf TU9MswLUtrgQNs3E/3PuOTr5i3bknMYUaGijlMGmuboyNOITOs/wNwDD2XgrHnPscCwt iL4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=1617hvUQ4qgxo5qdVesY0MCVDSqTzVwQzCwtsTQi5aY=; fh=9F4iVkKA3gERxBnF3jymQb+550Ng6yXV5zsbLgLY6ZU=; b=vbaiVytrxwC5rTStW9YjhJ7m4z+v0dI+LYpHafOTz75A4I/c2NuFgn7fCS96ovmotM gD49cRbnnJsn+W+xkS2Mye9etRtsXvKzfhw1RBLo6SUzwo8ceElZ5/QRvjpl/uOieAGy MuNbD7KeanecISPU0zl6851U8STx9XsnzHfpNfgmBf/md/ryev8PL+m7wMJpDqtYXM+L b0K4hxWKlEOA3dCxbv8vDdQsLslzY6V4SITBO6T8IRilpHrBPLUu4v9ES4o0x+zv0/nn VNWIHY8qihleKSmoOOtPl+GC0/dau8i5bujlm7fvyFsdFIcqBBfCUtwU+GKRslZUOgaA 0HNQ==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=OIqaCLW2; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1708366191; x=1708970991; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:message-id:date :subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=1617hvUQ4qgxo5qdVesY0MCVDSqTzVwQzCwtsTQi5aY=; b=SYIusOYjTzfu2h/o9ElLYtr8ixZ8bSKEVWOmsu+m+vdt8XMGO/bPyPlL1qF4cR74Gu vEWBZ+lJyaoQbRduFd5zaZqm0M8omUp6MaMgp3ff5KEvAcUcWSQogC4jTQvWbRpsU5S+ OSBBOw4tj3hZdeFZW2Wnip1nSwOSemcDZW6kOFdOurZc5qIhyiBqD1yuCz1u8dYE+BNU cya2BT5Oeryg9m1/X0zkyTJXOax8KOS2z1NXSTrjENrOjxJMgbMa9+8n2oDuAwnmylvM 1v5Ua0NziqPeVr1CweBFYA6wNIwyL/cYMjdtT196TLQ1JN+/OJggidlo/QhzRp0/diSx vGKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708366191; x=1708970991; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=1617hvUQ4qgxo5qdVesY0MCVDSqTzVwQzCwtsTQi5aY=; b=ZCO7L/YwtUp79pdMr5ERkLKQXPTQj7Dqj1KwnJzj+Dd+mHXSfB8EuTrg4y3tzm5Xh2 le2MvmQKo8MMMQO9qyZF8f44ZMsUqqvdUVvFPj7XusTAusEb6FsEjS+0x4ZKuN00ClqD qOTORNr/KSXmiGSXtNI1iFxkpvCoujTSIG/nOp9GjClCEy4tf28xQV73Z7Qqu5tQCFof R28jlsSh1AFb6Xofo2Bj6Q+elaZ0psgwSvcBZqPJ4O13zITWBQfrHtAVTgH1S9rHxv9u 7jN396OpKYgIGyPCxrCx2j3STe/bUT9rXStFJf7JcrUsEj0EgpfJnDWVgQO9AaMElm3R A7WQ== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXdnzkBktXBzZN69KEAfczw1bIbVd7rTEmhBHEp7TKIu/5mrHOq/jsQonYREir4XmfELosYskcLKaT8u8BQQtVurVfU8MUGaEWpLADzBQ== X-Gm-Message-State: AOJu0YyP/Iw8I7gIpIlgyEtnrgalXC1x9mPYNPEERvWlS2GNqqxnWp7I pB3iJ46qYrWX4T2TZC3+cg79NQSiMljCmjWqJmUGZqc8m3FutAHg X-Google-Smtp-Source: AGHT+IHXlH5uksoJS1W/x2M6M/+nzIqFpyFscZlCb6Yj7Nc6VA8mYQYlZzEr/XtPUIYrc6yponkpog== X-Received: by 2002:a50:cd8c:0:b0:561:849:76f0 with SMTP id p12-20020a50cd8c000000b00561084976f0mr6736852edi.3.1708366190890; Mon, 19 Feb 2024 10:09:50 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6402:5293:b0:561:2701:7e00 with SMTP id en19-20020a056402529300b0056127017e00ls1542071edb.0.-pod-prod-03-eu; Mon, 19 Feb 2024 10:09:49 -0800 (PST) X-Received: by 2002:aa7:c655:0:b0:561:548e:e4c4 with SMTP id z21-20020aa7c655000000b00561548ee4c4mr9261445edr.19.1708366188918; Mon, 19 Feb 2024 10:09:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708366188; cv=none; d=google.com; s=arc-20160816; b=TlVkiRkQq2C7y6L9jdq0nwLDBUqmz6hWEaP4yDXHWUrY7yqGpn0sGXgH6PXyFrgpSY 2C1WuAhA9ilcEkAlP3KmH6MSzhk9FXzQMhhcuseedG7M09SMuSV7T1+OEX4yHsAWT/Jx vViHqE3URgtcjlxQoebm85czwqksput3Vrar2+KC48NwWzJMbUU408ReEeZZgkD82ZQJ dDrvvl+LzbAznhD/L4chbBKKj3T+uTFipnQnCP+bjjwmLmdmrv+X46KcopxNAhWaM9TA kLz3+QnH34C9SWOtkksP1OTibI85HubquJhe3IlYZ6DDH2TpjfJrs14wMnhdSolVpmuH e+RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from:dkim-signature; bh=70JqRH0r3tH2E0/oY0IPTU6E9RhCovxaWYkV+cVAMws=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=wUB93ZOJMcCp9sSNbUyCG/9zt6NCLxnv7Sqg3mZX4AmzVZRt4LS5aZqplA17cHHlKV 9RBQYs/a0cV0AaH5Z09hF2UAPpzt60xE8ZiDgKTHRTV29s24a7SXgq82pxa9gVMnexS0 uaAK6SmAoWjHr/PerxS7595wHeH6l70FvHUgwHrY0dfYNfaMHqKIbhRc3TBAOHm0IzTe Jui1NLyMwb6DQpfnTVAehhLF4I+NBVtetSs+HqNPnKTmg4Q/Pmq7wyO8hEbv1uSU7JU+ j+Ghac2mN/+QeSxCWsWARJvXYnofGUOSUc9FVTAwoFwMjka6QFIvcXtQpZAuOyvkFili Y2ZA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=OIqaCLW2; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.24]) by gmr-mx.google.com with ESMTPS id m20-20020a50d7d4000000b00563fcbe92aasi406488edj.0.2024.02.19.10.09.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 10:09:48 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) client-ip=212.227.17.24; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MI5cP-1rgpJL1ET1-00FAqd; Mon, 19 Feb 2024 19:09:48 +0100 From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH] BUG: regression checking IVT Date: Mon, 19 Feb 2024 19:09:46 +0100 Message-Id: <20240219180946.133253-1-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:ORBDe0p3rrQxCi+alUrM0jKRLs6cDkwmCGioyjGFArlLwR7G42s KlNSqSOGsWlI9GDct7UBWC4PwQ1oznMFkuoWcH71vPjCN9YNWllqiumNQkChlEHq03OTNKi 1YIb8c3cw9F8ig6MlK37cSPbTVvZeOian7CLgS92+sBprX1Voq/K1Pps99gvhABvcedq6X/ t1QugUTli0YdBY5b/xRKw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:msBsVrSnh2Q=;13EE7W8HFkl3yZ1Ru42lEIDZs59 ywk7yEwJq3F9qPmIblmaV+alxxqhGm5f+3cLyHefR7vLUPR5JNj9ORgAQp374kqp4xsq2BeZA WQlToATuZe5ftu3vBP8loGZfjDtdFeajrmfw446OCbhqmM0g8VXYWu2HDVgsbBby8tVFWfRBm Ivm0wiv25TX184hffga1EBXqb26ZoNhFfv4SMMxqM166+BtPa5P49mMiO1tc1dX2cZz1fgVk9 EEw+rlGgEM9DcylZhb76/GLaVfcivg0BTndA70PMCESddt9+mRluWAQdhhXs/dLU/oWCSaL+H FegTXyLXG6y9ZpMvHoxRMg35V3NCB58wxBDaLrht+gnXQ1pOEHKDKBnlVs8mIBdyClr5+9Zx8 4Br/TE/b4rGIrZV8f//D/7lMc9n9AlERtDBG4X0ssZR9KxPdLS+GbwaTRfOYgnvMgj+zV84XN 5DSC5b5ctx5i4kmxxXNSj8P9P9fHWF/5XI3NKC99cdpok9xNZqlR57qTd9CY+KhYM6l+f5q1o /zYkOh9t/sYolyFJs1jrOB/faMtm1IGzRurecWUaJaUtiRxpuselUx/MCwmMC65JgjfUrguhV pHFSo0j6ciPDAD7/sTe8Y5guEQxbZZ5OurP/iIyZNHcObaADqlzccGjqiBcarKGvY4F86x2n6 6JIu+TerpHVOkt4d1WQRAbf9R3/QdOQdN4aL/Z/dAyR35Tmtp5MqGTioEOyewokXlCdG3213S JzEm9gqhQMEwBEulawAhqLjfelmgY0TqtBM0BFD6Jrqo39os4Jds6o= X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=OIqaCLW2; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , e48a866542 creates a regression bug. A valid IVT pointer is always passed because it is generally a zeroed array of chars, so passing null length string is a valid case and not an error, and in that case the IVT from the file should be taken. Signed-off-by: Stefano Babic --- core/cpio_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.34.1 diff --git a/core/cpio_utils.c b/core/cpio_utils.c index e5de2a79..7948dc2d 100644 --- a/core/cpio_utils.c +++ b/core/cpio_utils.c @@ -514,8 +514,8 @@ static int __swupdate_copy(int fdin, unsigned char *inbuf, void *out, size_t nby if (encrypted) { aes_key = get_aes_key(); - if (imgivt) { - if (!strlen(imgivt) || !is_hex_str(imgivt) || ascii_to_bin(ivtbuf, sizeof(ivtbuf), imgivt)) { + if (imgivt && strlen(imgivt)) { + if (!is_hex_str(imgivt) || ascii_to_bin(ivtbuf, sizeof(ivtbuf), imgivt)) { ERROR("Invalid image ivt"); return -EINVAL; }