Message ID | 20220405071005.3855186-10-sbabic@denx.de |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBX6WV6JAMGQEOAPINOQ@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=Ngbmg4yf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::23d; helo=mail-lj1-x23d.google.com; envelope-from=swupdate+bncbcxploxj6ikrbx6wv6jamgqeoapinoq@googlegroups.com; receiver=<UNKNOWN>) Received: from mail-lj1-x23d.google.com (mail-lj1-x23d.google.com [IPv6:2a00:1450:4864:20::23d]) (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 4KXf1G3LVmz9sCD for <incoming@patchwork.ozlabs.org>; Tue, 5 Apr 2022 17:10:26 +1000 (AEST) Received: by mail-lj1-x23d.google.com with SMTP id 19-20020a2e0913000000b0024b1788829dsf1506126ljj.0 for <incoming@patchwork.ozlabs.org>; Tue, 05 Apr 2022 00:10:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649142623; cv=pass; d=google.com; s=arc-20160816; b=ACIp7VOw/JMN9BcF+zPSVCrNGlu1KzRNlIbru+E4Vd78/DV6Y4g+SETFDQ3onjFPOQ cCAoN5jC9J/ARd7yhvSSUqmQNOdro4hIUTSywHtBTa5b8qNkt5mRpEbht4cjWuW3nHgA Td3eX/kemVGolTM3BSNM4pTZghBpj99MuBH2NGhFhDk9t+NFPulOgIlvove/o01beHaO Mp/h60V43f1cjMLZ/NzMaVQ3mQoEr2ZQUxQzUzCiEkQneZYRa0mtM43xgpjiL4zHsS/0 190VWmtF4uLJMAb+DaIF+CA3TpUQ6AZMp10YtOB/0Kn/kt2hSOftf5Yq7s9Uh/vDbD4s k0Qw== 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=VuP5tsV89ZUf94L7nYGlXzaMjupXI6bW+a/Kn6KTlt8=; b=OBJIUe+SYss1ZQhWSxZyhb/0NUgNckeRYTTOXjbObY0ZadodZ4/tMlxdzmr7t9+PxB FQkhXJIWzlNOpuJj17aQ5zXd5g6eMKLDomh7zEt7ePs1IivsrueVXIbyrvHcra68xtBQ Yok6Iu8kbSzs8JrmYT9jeVsA7g+5FTIqg4OgJYfTqi6SwrvupXGMPIzdOff8j9Pw5x6I UlKn/8WVaceIjOT6q1bt9ydt9H4q+dmJLyiiBjymXKhNVY8FQERdAyAgSobBzwVi68DD uARfJz9JaNsU/gf15vVTUjHWihSJ/lftIWmgAPccQpmghf9XYZ9YNCw+Bzc54BbNiEnS 8urg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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=VuP5tsV89ZUf94L7nYGlXzaMjupXI6bW+a/Kn6KTlt8=; b=Ngbmg4yfCy2yj47uYpX5i45mx/Cljkq6X7joH659IwO2UT5WV1JPRNOQKjvyP/5vzn rqCi0erclHgzDB/ZqL88vbwT/hWLP8+zZ3rlkRvgR0gG00AdBfdB8GMnovny4d1qPKn4 ez9GOTJNA4l2oKkAOqOCsWo4aQbTA2sECR9OwWEPwTIOoai0Mp9HBATXXUbM5JqSYbTE S/HNB9C3+F7A4UaIEnnZt7EaRGvnrtA8X9lgtEPfyEhEjhkd8qT/47IH/eublqllTWNT +ol41qbC3LMClwGmGLGWAEzioGGYW1JBc+LmBe8K41MXU1pizhMDti/9vegmIbdvkRjo glfQ== 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=VuP5tsV89ZUf94L7nYGlXzaMjupXI6bW+a/Kn6KTlt8=; b=r832HWtYvAjHoGKlP2G8SO9Qp++fcYWQSJ0kZZlteFzQ2Eiu0F6XeYcWjeSGeFejjU 2ZOW9xI5s6WqXIawR2BXt/njb1ZC5yUb7/IPzclB1NneO8F78hrkCZzHmno03ZxjWjno xyme47KWsqE5Ndm2KaEyCBiggpNihbPRxLDFmRPbyZrIpBpYwEJaitkBE/r6yeAv4CFo SJdewI5/4KaNYmN5ple6k1mhd3LgnogIr8DEvjA8naBxzGS7PuvdF9FTMevZG3cjFjUB cqxTDRC8PL3xfI1D0fIJQ1cbkUQ6ASKbs3k79yzoWHvZflKiNsHNS52n/QuAyvNlx5TD SFkA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM530SxIf8GHbuyLPuWmNtb7eLQH1j2qCVfvyApgq1ehfW8+M7JJ9y 2W0QDNsURgVVJo/gt0X6Sq4= X-Google-Smtp-Source: ABdhPJy6AjG8vsE0SxAl0OofQfbcJy7Gvkp+XXrz2ENWrV/51Uz5qpH9ntukM4kHjza0tpLcCOz4Dg== X-Received: by 2002:a2e:3c0c:0:b0:24a:fe44:b222 with SMTP id j12-20020a2e3c0c000000b0024afe44b222mr1224639lja.231.1649142623255; Tue, 05 Apr 2022 00:10:23 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:8012:0:b0:249:7cdf:d76 with SMTP id j18-20020a2e8012000000b002497cdf0d76ls847187ljg.7.gmail; Tue, 05 Apr 2022 00:10:22 -0700 (PDT) X-Received: by 2002:a2e:6e0d:0:b0:247:fc9c:284e with SMTP id j13-20020a2e6e0d000000b00247fc9c284emr1307324ljc.251.1649142622284; Tue, 05 Apr 2022 00:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649142622; cv=none; d=google.com; s=arc-20160816; b=N5frFv5CmNkh7om/Dr1UmrkHYQKMeN9afplhizW9sL50gD+oR+3cVWicfoMjDRdl+d vYb0eoY7izH4Ef4/6usO4tHDagsnxuEfGAJbNfa2IijKvHKRm9dv3xEJZBDdIc0Fj6GE 8drE/FgH/NC887JowWAxvBO026LW9sS9xASNT//WVThKWoficuX9HwWfSeJwG9kk3KBi Ibip/YO8tAHvvmoDuAkDtPO+F/I6JGju//neVWS9ySkamatSd7g1iYsL5GkOiog6TQbx sLnjAHnQoPowZmDDMTioui+Pd2xa19MDiesUW/SDqwK/JgIYjDrMSNCAr+BkNKoIIrJj K5Rg== 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=KVAu8zCQJBd1VUKnAsBrh7vWQhKbvRLc5q5BAQEXglg=; b=yFffmEuzN0UJdBnPQwj6bNLV8/QmqTXeL7DY53b2lmVr4Da74IJI0klaq34Dfew9b+ OBG+W7IoI+OaspmstqDARcw0QIhV8cAOXlDo/vwP5d1b5S2QzIg7CZls0XYB0tJBVksg ufS2vtlB+/zHT4tmQ9Tw7771dJsLq2OIMpOEQ0cUXigdzTcNzevFeDUjoSWXlMzHqSf6 h3DnNapPLcurrAD+IJSv6NAyl8zH9UPoK6IsZB5x6RcAvqx7WSjgzMomLUHxTrn5i4FY amxRtYpgmkL/GQXQeivSp65kUWw5HO0ORNkPR3rfSIwruHGH1pMDvd+pfwtOG1QL+84w /7aA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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.10]) by gmr-mx.google.com with ESMTPS id i15-20020a056512340f00b0044ada592078si487091lfr.6.2022.04.05.00.10.22 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2022 00:10:22 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4KXf185R5Cz1s75W; Tue, 5 Apr 2022 09:10:20 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4KXf185Jqmz1qqkB; Tue, 5 Apr 2022 09:10:20 +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 IuaxoRh1KasM; Tue, 5 Apr 2022 09:10:20 +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:20 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id D6FE845407BD; Tue, 5 Apr 2022 09:10:19 +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 yroMEtKZbEAs; Tue, 5 Apr 2022 09:10:17 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 7C4394542AB9; 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] [ 09/12] class: move swupdate_extract_keys to lib Date: Tue, 5 Apr 2022 09:10:02 +0200 Message-Id: <20220405071005.3855186-10-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.10 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 7d60a6f..79b2246 100644 --- a/classes/swupdate-common.bbclass +++ b/classes/swupdate-common.bbclass @@ -51,23 +51,6 @@ def swupdate_getdepends(d): return depstr -def swupdate_extract_keys(keyfile_path): - try: - with open(keyfile_path, 'r') as f: - lines = f.readlines() - except IOError: - bb.fatal("Failed to open file with keys %s" % (keyfile)) - - data = {} - for _ in lines: - k,v = _.split('=',maxsplit=1) - data[k.rstrip()] = v - - key = data['key'].rstrip('\n') - iv = data['iv'].rstrip('\n') - - return key,iv - def swupdate_write_sha256(s): import re write_lines = [] diff --git a/classes/swupdate-lib.bbclass b/classes/swupdate-lib.bbclass index f8acd03..233eca1 100644 --- a/classes/swupdate-lib.bbclass +++ b/classes/swupdate-lib.bbclass @@ -4,17 +4,12 @@ DEPENDS += "python3-magic-native zstd-native" -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> 88a830f... class: move swupdate_encrypt_file to lib def swupdate_encrypt_file(f, out, key, ivt): import subprocess encargs = ["openssl", "enc", "-aes-256-cbc", "-in", f, "-out", out] encargs += ["-K", key, "-iv", ivt, "-nosalt"] subprocess.run(encargs, check=True) -<<<<<<< HEAD def swupdate_extract_keys(keyfile_path): try: with open(keyfile_path, 'r') as f:
Signed-off-by: Stefano Babic <sbabic@denx.de> --- classes/swupdate-common.bbclass | 17 ----------------- classes/swupdate-lib.bbclass | 5 ----- 2 files changed, 22 deletions(-)