Message ID | 20220405071005.3855186-8-sbabic@denx.de |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBW6WV6JAMGQEEVH56XQ@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=tXs+Tu7s; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::43e; helo=mail-wr1-x43e.google.com; envelope-from=swupdate+bncbcxploxj6ikrbw6wv6jamgqeevh56xq@googlegroups.com; receiver=<UNKNOWN>) Received: from mail-wr1-x43e.google.com (mail-wr1-x43e.google.com [IPv6:2a00:1450:4864:20::43e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KXf1B74QKz9sFk for <incoming@patchwork.ozlabs.org>; Tue, 5 Apr 2022 17:10:22 +1000 (AEST) Received: by mail-wr1-x43e.google.com with SMTP id d10-20020adfa40a000000b0020608fb395esf1398344wra.11 for <incoming@patchwork.ozlabs.org>; Tue, 05 Apr 2022 00:10:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649142620; cv=pass; d=google.com; s=arc-20160816; b=0JiN6pPII0Tg0TLJ4n1hglMdSmJ3ftrSf0KSbSjwnR2MTuaecwp/oSUPmXZ2dxHBMX ryevmnbjaBSk0F8WshWfFbARA9QBeUN5SLtIkwkxU1DP6qfmOK6fPZLpfLBcRTWQsjZU OqdhK+lOdSoJhvVKn7ONmABxsT1DvfdmcO6fYXIjBF6/IytRzU1Ef31QLH/lqbUCQntl 2PH3+81No0FKoVdLS0Kxe2ol1Qby0fc/JDuq/+v91FjuWDWxswvJx4GNCHQqko4H7+gb azAICKJiuHuCho5g6slvaRtQgDvhxYpamgv4c2vZRVKN4rutcGAgxcr679MmDJF+OAEN 8W+Q== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=+Drp55kfY+oh3i5djoMgCPAZjOCPbFP5BL5LZvxBpgI=; b=LyLGFniECDNUDMS1cuAuinENKWdy7tU3tJTNS7Oj/v5+XuFVVIrDPab9VZ+0wzoffd 3o4JswcX0fSTVtzAwmwy0y0El7qWohDzU8sOXu0LfGpE5P6+9EbJ+V+yQIf+mfvKEsS7 SHWheZF3nRkHhXww587hkElqgfQGnu5LwvDeIY4/H4nF5Zz1KR5SEf0eJl7/4Faf/+YN vVbYEpQLIYM+QH55Ti5uGadCBHqkUVpw5893nT9MibRUwa63ESdzCvyhemOC7t+fehAy LqpkedMlnx8rCXQZoY4yFlhZZy2ceCFMRVBbqXXFcZBwEaeN+QuyAKx9Ezgkn6wHDThw rhlw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=+Drp55kfY+oh3i5djoMgCPAZjOCPbFP5BL5LZvxBpgI=; b=tXs+Tu7sQpTs9exQR72TwGmL26A85b8kSQJrrFyXNh70mh1Vz5mdFLCvK9Qw45ymtN aDNMUDYHUPosvplvII5fP+YDvtwgobSaPwughlggG8nX3ZHIQDhkQ5m3apdWoPo8BIKc 7jmr4D2Kwf+bSoeUgzebNOhhoJzK84WjhngTPSWcqsJX7WPJhu9s6chKLmvWiED2yZRW gnLJ6z/BPkdQ4DNKTuEeJMyW5zmBpK6n5ZhSDqRWl+8odcmEsRFRUUsBSJ6lwfisuHUb QVbdYxxSbUhMUnbsy1NtdbRmL7gy5CHOwQsPxzSS//+94bFwbEte/wJt+tcMfaxFnrvq 6tSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version: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=+Drp55kfY+oh3i5djoMgCPAZjOCPbFP5BL5LZvxBpgI=; b=efb0K05wv6Cupf43kNm0TsWadlOIW4DqEnrgX+3OySbaGWp17oBhVg7OZJJBKmDo8E pAgTdRa1KDsLNjdGNLeNh7+CtbvSV2PViNSGmy+OHFVrpvvTwFOKwrWGVkETWCMSsiBw 9gAuaaLog0GeoEYIFBBFrq9Ymcfl6MhnpFRzpxFDSIvyLKdKiv79NwlqyoeLzH1fiAGp hI8lhSZRMe0Ck6/X3eUqXziyjGiEzjAiLIMIsmWJOylWJxEQL0YIQvNHBfjaYXQOywk3 YpJ1V9vDlxk7KSQ/Bwh9fVBzdcJA2LUb62K3l//hnXBJaFKhhmc4PoqnZhRzMNkrRRdh Twew== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM5323eJcfUNxxeFly74cGJkU88Hx7xckT7iyOcVAVxYODE8XaljZ1 c8VKAS74G16GpkaVGpyJXog= X-Google-Smtp-Source: ABdhPJxQAFDV26AbX/fiS3odx+cUyJ9SsFZW3MPesLZxY5k/t+Vfe35XG8iGPBkAbVU+aCpB+URIWA== X-Received: by 2002:a5d:5009:0:b0:206:f24:b659 with SMTP id e9-20020a5d5009000000b002060f24b659mr1505437wrt.476.1649142619815; Tue, 05 Apr 2022 00:10:19 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a5d:5306:0:b0:206:e61:ce02 with SMTP id e6-20020a5d5306000000b002060e61ce02ls2697512wrv.2.gmail; Tue, 05 Apr 2022 00:10:19 -0700 (PDT) X-Received: by 2002:a05:6000:1184:b0:203:ff46:1d72 with SMTP id g4-20020a056000118400b00203ff461d72mr1516639wrx.165.1649142619036; Tue, 05 Apr 2022 00:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649142619; cv=none; d=google.com; s=arc-20160816; b=t1n+vrytu6V43rixofViEkP4jt6DOHm2F61VSBZwMsxN3Fa/unNTonWO496sCJzTS8 RxSmppQ1w1v8K7KJw4F798sHE39o/d2YclpckJJrT0v4YdJh0TLM8qQDPsKeQtf2uyGk uqjqhT469UNAzyz9FdwQK+Eatry58GJ79YJg3e1DshrzMHawSiMLAjPKAZl1Ul4zuVfE tPL4ASJF1Y+o1rWCAmO1MR8EIOqbWU0eJAKvbvMvJCmQZuA0UU/EcMRXtmH5jEf8Q+wp 3uxE4MgbgaeIcA4io1KT1TTSXxjFdX2ZTtUz7yMSn2FM8kbMvm5BA6utJt2VndnmPG5Q lzVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=wlqEiTGqCjT6jFM8TZ/xuvIuAGOyxxWp+wvhBjXQo+8=; b=IBzf6QI7a+GRKDmn/yeuIvfwjxpgbrM95JifRFw4LFAUa9ZMJ1Ls+ukvvoPPWjQL7E tQlhIbsivsje09vToH/YQdU1+kk1YPBBAvrTiTiRZO7YGu1i0SRQlIGHs7rFbfnywv8L f42fdYJFCMrLF1juZTiZnmbV4VTYUD8bwVVsPFpM4K3NIGzelrly0R1AQU6BSuIy5c/J V1+p/vSbBZXCoUtCDV0aGMvGsCmSK/YwGi8zlx3o4XLlBBLbfZGnWSm72cIVMVy9ptp3 uoscTFVMNGF3pQrPHsIxuy7DUQxr4mB3/4AQSfwkZUvoZ9G3ASw+GaN3Dh3gcMxwuSW6 cQnw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id b22-20020a05600c4e1600b0038c73e87e1asi151272wmq.0.2022.04.05.00.10.19 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2022 00:10:19 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4KXf165tdQz1qyJc; Tue, 5 Apr 2022 09:10:18 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4KXf165nPmz1qqkK; Tue, 5 Apr 2022 09:10:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id YYfJyIuGrLTu; Tue, 5 Apr 2022 09:10:17 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Tue, 5 Apr 2022 09:10:17 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 8813E4540BD2; Tue, 5 Apr 2022 09:10:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vg7ZvUZ5zNwX; Tue, 5 Apr 2022 09:10:14 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 5EC6D4542A73; Tue, 5 Apr 2022 09:10:08 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [meta swupdate] [ 07/12] class: move swupdate_get_sha256 to library Date: Tue, 5 Apr 2022 09:10:00 +0200 Message-Id: <20220405071005.3855186-8-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220405071005.3855186-1-sbabic@denx.de> References: <20220405071005.3855186-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
Support to call functions inside sw-description
|
expand
|
diff --git a/classes/swupdate-common.bbclass b/classes/swupdate-common.bbclass index e7564c4..e96e927 100644 --- a/classes/swupdate-common.bbclass +++ b/classes/swupdate-common.bbclass @@ -51,19 +51,6 @@ def swupdate_getdepends(d): return depstr -def swupdate_get_sha256(d, s, filename): - import hashlib - - m = hashlib.sha256() - - with open(os.path.join(s, filename), 'rb') as f: - while True: - data = f.read(1024) - if not data: - break - m.update(data) - return m.hexdigest() - def swupdate_extract_keys(keyfile_path): try: with open(keyfile_path, 'r') as f: diff --git a/classes/swupdate-lib.bbclass b/classes/swupdate-lib.bbclass index 233eca1..a776148 100644 --- a/classes/swupdate-lib.bbclass +++ b/classes/swupdate-lib.bbclass @@ -4,6 +4,7 @@ DEPENDS += "python3-magic-native zstd-native" +<<<<<<< HEAD def swupdate_encrypt_file(f, out, key, ivt): import subprocess encargs = ["openssl", "enc", "-aes-256-cbc", "-in", f, "-out", out] @@ -28,6 +29,9 @@ def swupdate_extract_keys(keyfile_path): return key,iv def swupdate_get_sha256(d, s, filename): +======= +def swupdate_sign_ec521_sha512(d, s, filename): +>>>>>>> c6ba564... class: move swupdate_get_sha256 to library import hashlib m = hashlib.sha256()
Signed-off-by: Stefano Babic <sbabic@denx.de> --- classes/swupdate-common.bbclass | 13 ------------- classes/swupdate-lib.bbclass | 4 ++++ 2 files changed, 4 insertions(+), 13 deletions(-)