From patchwork Mon Oct 2 14:19:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 820524 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4010:c07::23f; helo=mail-lf0-x23f.google.com; envelope-from=swupdate+bncbdd6bwv65qpbbr4xzhhakgqetqieaby@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="Lj1CNltY"; dkim-atps=neutral Received: from mail-lf0-x23f.google.com (mail-lf0-x23f.google.com [IPv6:2a00:1450:4010:c07::23f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y5PXD4dh4z9t6s for ; Tue, 3 Oct 2017 01:23:06 +1100 (AEDT) Received: by mail-lf0-x23f.google.com with SMTP id h80sf1348491lfe.16 for ; Mon, 02 Oct 2017 07:23:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1506954184; cv=pass; d=google.com; s=arc-20160816; b=QZYDwDLACYy1AFORjBuOYVWTpQfkLR7uLaURTfnzOU1S0Asb00r8UGVRI9hfD8xIyZ BRA4sIYa9h6trZfvz+ZSSWq6Dv9qT1g8FEE4syh9jOTjv4cNTtGwgRC9+GQpeAUdxz1S kxVm1uEZg9KD13obAC1GRK2TuUg6vda83hrJTVUyw8Uwg6N8iQ4ix1b/ShPHQ5KNnUAN xt5FbpVnQqwjuUQI1TRkhPocyzkAt2WEd3ASC92CrMDa+k/uQO4OSSLyKYyKPPmx6hxp H1N7rK1bEsMsFMydnoAI+aYv4g9dreagdGh5TUmb+ZmIoXSOprCVRLBD3ZpdIvekuTuc 6D2g== 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:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=MSJMNiBPz4zeg6wmi0LDuyqWJ8ay0JWlAqS+A96bw3E=; b=zlMW/LUTenxhA0AuQ1HHavUqL7wXMg7wXvchShfvBGIpKsvMLo2toHnlORnP2GcbK7 2eDv9tLzaUHILaooezFKU/inZwxFt/PL5SCxyujKrTunjgzUEVccOAwOgufP5NNV9+F+ stqK24QYJJL1JXN6QxcWmwp9Bp2bXqSMItQGMRrT9BM064bNsIdn6LBXkrgmaiUpnTJQ /+cw1Vfbq/x7DJalTK3Lm8OCCBGlAf8LHNTSr+n2DasoCHLI0nP9rG11OtAu5rynumVw JIcRg8C4UtcwYNS8D5IDueAvPa2ub/Zo70h/f61mZ0YwYsfJlnyhNsKPSQgQGss6Z1Nm cPoA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=MSJMNiBPz4zeg6wmi0LDuyqWJ8ay0JWlAqS+A96bw3E=; b=Lj1CNltYN2Hm4fGy0MyIc65kmbnL4FSr3IH78qlYiCuSmojbYtgkmaY8m2i/uYvKst omUc4CilKtyKjdKRss9RsBieSIWma5nSZYqcHZznglzIGmDbl1J6r/7EXEV8wOIW72DC SjOA9qLWzI19GRyZVAH5V988RcA5AykwIAErR6g5ywjFa2cqaKAaBwTFXXyiCA0p8U6i NZDbj8tbyjU0UYZbhFU0PE6Zs0FPt/jRZKMIKvaEAZhyGKNqgf5rcYrOEsp3fpUNWIoW /t+FeoMHsShGCs28aBfv7Dn+eQLGc3fuk/9UGxvrUu+VEwQjyAcffn+UVaK+vK5AUtKq G3+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=MSJMNiBPz4zeg6wmi0LDuyqWJ8ay0JWlAqS+A96bw3E=; b=Q9YA3YvC7LiIQZ0SrBXS0HSLixJoVpZ/4O8dkPNiugUuvyc6BwCHN5SatcKnLPOeAI aoVNkz9lRWoLMwccEcI7FGH8StQBF9Ey+QqbSFjqI40Ntjt1ag6RIdkNodpkgL9cW+kH 5s83ad+I+idgq2G2xryrwD0jpLrkr5bAPOLTPeb/XMoccsWv7VjtIM2oybXP+YhPI+Ga s4sz4IfPMHnLTZdKfebHgGm/K6dVvdxGLwH0rI/oDTxNEPfq2hLFitDv1Q66cLj381iw lnF6gMrPvlM+aU87tmTtt653EC9w1RyZWBqOnvMQaltlUNA5FC1oK0AMLBqkSpg8z4C8 3fvA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AMCzsaUi/1U5oOMiSuLG+HUV4pqb10MsTIfW3+LCPQkVRJy3rHeJ6sGt yCbbu80z73BC+U50HfP1UWA= X-Google-Smtp-Source: AOwi7QDR3KwyqHSW6eChV/iuQGdg5uKtVwnDca7Nhm6IshUwFB9wW6ZlHz9kgGW98rV6WNE+8t9Zqw== X-Received: by 10.28.161.70 with SMTP id k67mr45083wme.29.1506954184073; Mon, 02 Oct 2017 07:23:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.28.196.134 with SMTP id u128ls1321782wmf.7.canary-gmail; Mon, 02 Oct 2017 07:23:03 -0700 (PDT) X-Received: by 10.28.63.86 with SMTP id m83mr1824530wma.21.1506954183682; Mon, 02 Oct 2017 07:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506954183; cv=none; d=google.com; s=arc-20160816; b=e6TI0BzJiZZJ9oicS4k/HyuAK/WehUJmV/4DfQeDcNUFeyDaaEUWEHBPPQjCj9PKVr O+Vz5QwZLCaIzfj7/l48O1SOeYc0oLRZsqgi2Z//FXR7y+zZFBZqaMchhg47Qim8TEf4 ZoSjfKmXSjrgcidpw4GdsdMkk1bO+DietWO8XTxHG9e8zE3q6dIZsaOclne4JVS1uvtO iEJ6iDKPxYUYXnTbEnuH3Rq1g83p7BQJNC2GLl+FMHpRMQvjPgIbr6oAz5+g8ZvjH3wV M/heI4B+TByMkXjso5wyrRlAdhIbAKtPE/wJUvayns9GB8TRRq42SAht1/KHuIiRiIYW Sylw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=P+qqReYe76ZJAE1Cw9+KhlJetVaQAFnJ1mVQKpJNTgs=; b=rzmkTPlAX6X0g3sZjijvalgPVmiQUcHd5Ca7hQoqUjqsfYKoNGnzaQ2WJXReT1IHcK F92xUeDwxLHUq7py/RRrQohd/+EuqO7Ij4tfG3c098wBtSmEHBU1h6KsENxw4SWhxaWX QTRv+dyfCei/z59cxFRwi//vpZAcBWiViX0RT+JSz8vyUkww3kitcfHLy4EBecDJDjvX WedxkJhZTGzbEP1t6SuqrAULCRv/MEDw+KAB8CLDKMra0JX+Xuu8R/1pfmMSJ9pvc3dR TkmJr5Oq07QO+cBxyObi5d12id/FdToEHyZnvM7POXZA/dBC68oKNe4ZwLCffwIeCm/t 1KDg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id 74si269267wme.2.2017.10.02.07.23.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Oct 2017 07:23:03 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) client-ip=192.35.17.2; Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v92EN3j9001881 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 2 Oct 2017 16:23:03 +0200 Received: from MD1KR9XC.ww002.siemens.net ([139.25.69.251]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v92EN3BJ003037; Mon, 2 Oct 2017 16:23:03 +0200 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH] Lua: transport sha256 field to Lua Date: Mon, 2 Oct 2017 16:19:38 +0200 Message-Id: <20171002141938.20962-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.14.2 X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com 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: , table2image() respects the sha256 field (via lua_string_to_img) but image2table() does not. Add it to image2table(). Signed-off-by: Christian Storm --- corelib/lua_interface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index e190ebf..a80f6a0 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -265,6 +265,11 @@ static void image2table(lua_State* L, struct img_type *img) { LUA_PUSH_IMG_NUMBER(img, "size", size); LUA_PUSH_IMG_NUMBER(img, "checksum", checksum); + char *hashstring = alloca(2 * SHA256_HASH_LENGTH + 1); + hash_to_ascii(img->sha256, hashstring); + lua_pushstring(L, "sha256"); + lua_pushstring(L, hashstring); + lua_settable(L, -3); } }