Message ID | 20241125094959.20420-1-stefano.babic@swupdate.org |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBD2ZDGN6SEKRBTEQSG5AMGQEDQYYWEA@googlegroups.com> 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=Avv+BTqJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13a; helo=mail-lf1-x13a.google.com; envelope-from=swupdate+bncbd2zdgn6sekrbteqsg5amgqedqyywea@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lf1-x13a.google.com (mail-lf1-x13a.google.com [IPv6:2a00:1450:4864:20::13a]) (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 4XxgtG53Sdz1yCv for <incoming@patchwork.ozlabs.org>; Mon, 25 Nov 2024 20:50:13 +1100 (AEDT) Received: by mail-lf1-x13a.google.com with SMTP id 2adb3069b0e04-53ddfdbeeffsf1040299e87.2 for <incoming@patchwork.ozlabs.org>; Mon, 25 Nov 2024 01:50:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732528208; cv=pass; d=google.com; s=arc-20240605; b=fg1ZRCF1PNchlvoV3YJh4Oc4KKgtlzBjDABp08Ojtub2emD1aEdbnfJh79Ft6d/oQZ YPYtkAce2VfmOR/1A295EMNBQoiIVV3jQyBHFM1av+OUPKgZk51Pw/LvYOXSrvfAmFxg qczQ8NyWJWudV4KAEjSGaUztH/RzMmsNxoGCOuh+XlgsS/2F+wE+NtqF5xk72jU5lf5q Zh7EHpIJGB1nG3qbjWdbpJa4tv04LCYbIPVDw4M6IOGNEgIFT+x0IcSCgGoqQ/bMkI+n Utj/mH8D8dtQRGirmRiqh5gpy0UpQJD00sj2kyWmH/bfSmx+1zX9s1TvteX8PA/FVRlO yuJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=lgBIYngjSpvS7Eq4jaNgSfMhp8XKNL2BHWK9CZ7FVL0=; fh=YLVmDMMXymiYBZiWiT1/A08qAAUDhwxplRDiGN7zAIg=; b=Q9FiyMCQSdAnnqB8YpskwgXWXOJwxlOhcyylq+OHAInfuhOoPF+63BLkD4TDrWj+9e tuTBNdFjfXm8PJ5VVOeM4upFF5mmFnQlU3I64076a3jMf7GbYwgcdGyspy00Pjqk6EFz n9gw2nfeDxQCZzG60F/YK6zA2ZSxqBW7xXSm75SFmKxizovZ31SVPnav5YX70rocnNU8 Q2AkZnq8rgP98NRH5IJMh5G9VHtzyVOxm/wnNuRrF9PiamTWmB9uPE4W1WCRk12uDaBS 6lXAx4Pp7EyPmLKySdsZyG/J0a2V47yi/SLGv27V6pqgAOV2E8RdMdTA1IWv1M49Lso9 462A==; 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=BhUt9uxb; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.75 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=1732528208; x=1733133008; 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=lgBIYngjSpvS7Eq4jaNgSfMhp8XKNL2BHWK9CZ7FVL0=; b=Avv+BTqJgwWsNf+VaAg1QNZRTlAtOtSmmWdYUjBCtJ7xIQofscaR2HFO1vgB+8hTP+ r1q6hjOrIQe/Ci/uxZhMzsf0xsw5D3fjtfCdOFEyFPB7jCqFYjAJzG8guASg+bN9MVO/ y5AJSVOhEEuwl6SRj7XqK4CEUmJJFFA8g+rLI4B5ftTV2m5QdSVAeUKJDuxsJQu4J3AM NE1GU6/LtiSHxpJEDfPkD5s2TbTuGFbUskhBZxQl1/MWB2FxN2SHDr9AOv5vEvhD3+m1 3Q3/tiHoRQ1cPy9NW+6YYa6BZcP5V0MVRfTnvWpjrNPtEKFnO/kgfAHy2dSmHAbskqq3 HJmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732528208; x=1733133008; 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=lgBIYngjSpvS7Eq4jaNgSfMhp8XKNL2BHWK9CZ7FVL0=; b=XyKm4puYAm7eWsPvcDSOWyuwDH5mgDxpgx6gWikcDUJg+C5K4ZPEsNZxSLFQGYgpGe eEfhGgm3PC8eOrz73XM/bRrDVEvRqpyRPD5VPNrXgusx+wJTU2UojdAwXKiuF+jnJVOA RlnDwyLkv1j/lmmHC+FZj7Ufg+XI6T20+qZyUWoXVzA1+/A6qeFmQzuzLGlLpsPlM8do AHArhqvwj1feMfLupznX7CuF7XZ1dyTCDciA5Zu600oiQ/traDA9Jmbo49mhbt04Uo2v vGk7deT27O6PeL3Oqm63wAfWLKCheh1f8O2g/ZN3S4RBFg0xZrKW64Zcb1Yab4qFyf68 w0vw== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCWPYOc0foTf3lnhsiGtTBJxy+ZB0NOgjWemD7VluPhwFFJzpo4rwBElmy8MTHh46Z4v9ylqeILLSA==@patchwork.ozlabs.org X-Gm-Message-State: AOJu0YwRj8hdDG0ovKzE1fiPNac+0AWjmHxBdHYtMAU1NmLSxuLmjNEt CcsJJNzs5nENcuIGR6rasgx8zi+Kzn1kDSnzs/nA3nDDg+lvG1td X-Google-Smtp-Source: AGHT+IG++l/0jWHPV55P/y3H3sQFzzsugDxvDc6BBUTe06C3Xstd4jxtmbMcTMmfYWJaLXStH0cAhw== X-Received: by 2002:a05:6512:3502:b0:53d:dbe8:e397 with SMTP id 2adb3069b0e04-53ddbe8e484mr2427726e87.14.1732528206673; Mon, 25 Nov 2024 01:50:06 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:ac2:5ed1:0:b0:53d:d3ec:eb49 with SMTP id 2adb3069b0e04-53dd3eceb8els671242e87.0.-pod-prod-04-eu; Mon, 25 Nov 2024 01:50:02 -0800 (PST) X-Received: by 2002:a05:6512:1247:b0:53d:a9a4:7567 with SMTP id 2adb3069b0e04-53dd39b4f71mr5455756e87.48.1732528202384; Mon, 25 Nov 2024 01:50:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732528202; cv=none; d=google.com; s=arc-20240605; b=fKBr1pU1ezWa0qkFHWTJKR7+EC6aIwCS5+Vn+NFc5excsoiNpFvbi4cFKMi7MiYiMB 6Mc6Qo111lda8LLbh57zItp+QAFlqspT4jVZtobytlteQNCNzC+mE0zHwIII4zEof6Ct GZcOUCNIwyE2WR6iQ4jh3KnjIjjDMKK9QFIe5xHqg3iKkvkDhUbeSsMiN1ZqwBTh6zGR wSvSHf6kaur8dazSE6QFfMEETUgUcnJQt/4KQzCfZ3NtRL8YG9Hp0HWQobMJT+B7fnaM e4GRXBv58vVJWOlUWx3ncH9xVU4MmSKM04UhBNgKV/aBeH4ieT7UAYDHSqKouauz3A9r Hwrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=ui-outboundreport:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from:dkim-signature; bh=YH5LEA7VmTavDjtagnZyeZlGTWitZnAM5D0f1RhnWhU=; fh=lQv+fj0RZY0X1fyygultNsDyenPKg3WF7g9AAbJrZzI=; b=jjmlAJ+ZfgkTd8iSG4mWXjmurKotZNj1XX/XMqhKS9i93lGUMikemAeKQkCa4Mv1Dc 6F+4EzLnlrncnpksYth+kEwi+BJuaxz8S1p3oKM8CkohLO6HcwpS/7ffrLRS2AXQdrtW XpYrTqaKXc11W8rDst6cRlo51Gaf1f0qoo//3DK5jGYSZxao2eWIXgiV4cLVixo0S5TS a15hQNH1DHBuPGmXo8Mr3LP9mOyxivzzTRR6eS+H51vDqMVb5ClRaoxJv4FRRQBbEXHW G882wvEEuXaFFX2fyLUuFIUK9vsppVg4l7IMSUfPdBpgiFWZ8NQ4qEBctp7mdGEGwAZI +jvQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=BhUt9uxb; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.75 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [217.72.192.75]) by gmr-mx.google.com with ESMTPS id 2adb3069b0e04-53dd248121csi117950e87.11.2024.11.25.01.50.02 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2024 01:50:02 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.75 as permitted sender) client-ip=217.72.192.75; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperello.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1M8yoa-1tJNst1qHm-00ETMY; Mon, 25 Nov 2024 10:50:01 +0100 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org>, Daniel Braunwarth <oss@braunwarth.dev> Subject: [swupdate] [PATCH] Pass path for input and output for CUSTOM sign Date: Mon, 25 Nov 2024 10:49:59 +0100 Message-ID: <20241125094959.20420-1-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:xfxkVBeujQIBZnzon4ZqGsiJKqCbV0/vD7N/VekUEP7UFE6jkyB dOsDxtleT2Pxr/xnPFrDRNLL7dzpG0SdR4w61rEQy0LIEPrUyPMlEv3LIo76pniS71EZbff CmaDlDTt+z/8Xf4l5FSlqfi82kFiHZPBPyEOxbJ5qWRHPw/iE2w4PUHfKPpf9G7OG2XiL5z dc+HjEKsjs3ynSwGnIgaw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:GQnn7C40L2s=;bQb+Iwhf2PfS/NwooFtx8sRdukW XjJVCbS2pBREmcuZbG2Awf/zidiSHwTs2kt+6tBuHXLOG/W9i4bSdABpQtxcDe5NZW1RAimud XsxHqWJzCB5cxr0Lant66qwIpLfXBSYymS01e8wfQgzAwcUmmLYW7LSB32Wk7IFIRCzlRkDoz akXWotwmQme+Ovoq5nOoYhJHZ4fX6PcY6Uxz5eitlZZRC3AvwETTiJFNNelDaUPKO3SY1R/yV nmx92JzxognU06e9JdpwgKnB/4cMDK2WNoxemx/1Snmaj+z5Ffup1bdKxbN2bOf1FMzOKt3Y9 EK96Pfn0DIecWCQ+c+ZgEAv4KBxfKloTKuNIpdceT2X7FuKq66KY9KgWFelGv5qCU2woG9GIv xCNiws3P+JGmBqop90InJEMgJmN7zSXztGPbK3GDq6VP+zBKTRfoYe0FEzdczKogLu5hPzuSj MJ4OodlJaTeEmMr9jhYL9xo3WhqiM9OMcJZje8TY5MP8IfMm8ToFq5RcD3o64Zlp6UJYJQuiu XRVmtQ2g7+SVs6A6CbiGafvLtFZZXWtAK6+S1GkPQXWSqf7MuuhOeO3nqaGVOquHV4xKMyiKt HYAC4nvnVCktDj+4V59mgrnhCYzCQieWb6MQg9b5pUVDDfZFd/20W88kD9xQAtwYuufPXhXdj fGFRolIlfJg/i5cr79mCZfCzD+ld0mTRJPlqdFoGLf1/APkn0EbO+JC8cjD8rlPdtDiSHTPrx YT/2sE4Ge46Szuz0ltz3QFMn3JjMSxT6TDckXSRXalHztohAvnxxS4vlHkWgtYBPEMJIj1z62 8lHlDcvWgo+lXiJcR9+Q9DKk1rHX7/YTzdEsYfOVuhU5oOdCJRcUo+ibIqMcAg7h4h 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=BhUt9uxb; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.75 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org 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 |
Pass path for input and output for CUSTOM sign
|
expand
|
diff --git a/swugenerator/main.py b/swugenerator/main.py index 8785714..f6d8404 100644 --- a/swugenerator/main.py +++ b/swugenerator/main.py @@ -136,9 +136,9 @@ def parse_signing_option( return SWUSignPKCS11(sign_parms[1]) if cmd == "CUSTOM": # Format : CUSTOM,<custom command> - if len(sign_parms) != 2 or not all(sign_parms): + if len(sign_parms) < 2 or not all(sign_parms): raise InvalidSigningOption("CUSTOM requires custom command") - return SWUSignCustom(sign_parms[1]) + return SWUSignCustom(sign_parms[1:]) raise InvalidSigningOption("Unknown signing command") diff --git a/swugenerator/swu_sign.py b/swugenerator/swu_sign.py index f73802e..5bd0db3 100644 --- a/swugenerator/swu_sign.py +++ b/swugenerator/swu_sign.py @@ -97,10 +97,12 @@ class SWUSignCustom(SWUSign): def __init__(self, cmd): super().__init__() self.type = "CUSTOM" - self.custom = cmd.split() + self.custom = cmd - def prepare_cmd(self, *_): - self.signcmd = copy.deepcopy(self.custom) + def prepare_cmd(self, sw_desc_in, sw_desc_sign): + self.signcmd = self.custom + self.signcmd.append(sw_desc_in) + self.signcmd.append(sw_desc_sign) # Note: tested with Nitrokey HSM
Signing with custom tool is currently tricky because the path to the file to be signed and to the siignature are not passed to the external tool. Add automatically the path for sw-description and sw-description as last two parameters before calling the script. The syntax will become: --sign CUSTOM, <own tool>,<parms1>,..<parms-n> And the generator will execute: <own tool> <parms1> ..<parms-n> <path to sw-desc> <path to sig> Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> Reported-by: Daniel Braunwarth <oss@braunwarth.dev> --- swugenerator/main.py | 4 ++-- swugenerator/swu_sign.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) -- 2.43.0