From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2DEF6FBD7 for ; Mon, 24 Jul 2023 15:08:23 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0E2E6EFC9 for ; Mon, 24 Jul 2023 15:08:23 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 24 Jul 2023 15:08:22 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 19A8943BCD for ; Mon, 24 Jul 2023 15:08:22 +0200 (CEST) Date: Mon, 24 Jul 2023 15:08:15 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: pmg-devel@lists.proxmox.com, Stoiko Ivanov References: <20230724110624.9502-1-s.ivanov@proxmox.com> In-Reply-To: <20230724110624.9502-1-s.ivanov@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1690203866.1eqnyvr7hx.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.070 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pmg-devel] applied: [PATCH pmg-api] cluster: fingerprint parsing: adapt to changed openssl output X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2023 13:08:23 -0000 could be made more robust by wrapping "read_local_ssl_cert_fingerprint" somewhere callable via SSH (so that we have a single way of doing file path -> cert -> fingerprint) but this serves as a stop-gap measure. I wonder whether we should lower-case the cache (key) in PVE::APIClient::LWP, to reduce a potentially confusing source of errors? some tools use aa:bb:.. , some other use AA:BB:.. for fingerprints, but they are semantically equivalent.. folded in shortening the RE, now that it's case-insensitive anyway we don't need to match both A-F and a-f ;) On July 24, 2023 1:06 pm, Stoiko Ivanov wrote: > currently updating the fingerprints using `pmgcm update-fingerprints` > runs into an error indicating that parsing of the remote node's > fingerprint fails >=20 > The error is due to changed output in openssl's x509 command, > introduced in commit: > 91034b68b39e3525f09fb263b9272de410a3ba4c > in openssl upstream [0] >=20 > Note that in that case it would equally work to change the parameter > from `-sha256` to `-SHA256` in the `openssl x509` command above >=20 > The change seems small enough to warrant pulling it into stable-7 as > well (although the issue should not occur in systems upgraded > according to our howtos). >=20 > [0] https://github.com/openssl/openssl/commit/91034b68b39e3525f09fb263b92= 72de410a3ba4c >=20 > Reported-by: Martin Maurer > Signed-off-by: Stoiko Ivanov > --- > quickly tested on a cluster of mine. > src/PMG/Cluster.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/src/PMG/Cluster.pm b/src/PMG/Cluster.pm > index e9a6054..c431521 100644 > --- a/src/PMG/Cluster.pm > +++ b/src/PMG/Cluster.pm > @@ -307,7 +307,7 @@ sub get_remote_cert_fingerprint { > eval { > PVE::Tools::run_command($ssh_cmd, outfunc =3D> sub { > my ($line) =3D @_; > - if ($line =3D~ m/SHA256 Fingerprint=3D((?:[A-Fa-f0-9]{2}:){31}[A-Fa= -f0-9]{2})/) { > + if ($line =3D~ m/SHA256 Fingerprint=3D((?:[A-Fa-f0-9]{2}:){31}[A-Fa= -f0-9]{2})/i) { > $fp =3D $1; > } > }); > --=20 > 2.39.2 >=20 >=20 >=20 > _______________________________________________ > pmg-devel mailing list > pmg-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel >=20 >=20 >=20