From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from maynard.decadent.org.uk (maynard.decadent.org.uk [65.21.191.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 074948F48 for ; Mon, 16 Feb 2026 20:03:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.21.191.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771272219; cv=none; b=QjM+xiR6x+uLeBlH/BtvgkIPUVPVQsG39te0fhnrvGITG3PNmCvGxgVkRVwKL+ljBgzveMr/TQbgHwvi3LiXBUhWg67yaaTQ9TahY/3Hpg3Uuunz/J5LlsHGhVdysSh/qmwDrCcm8ZKBg0wrMbFMhhx8g4iDgSWwyQR0Iq2VVuY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771272219; c=relaxed/simple; bh=BnA3qFKjyrc40tFGBfjJwSgz0HfYZv/g/oDGXheIoWI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=nynDBx7RhtAw10Ynmx2bHiqkRhWTFeF6mhbdrifrot6V4/0aCg5W7pGhAHp+9FFLpxibsNHqNtWSVRxu0n2je2+F8r4J8PDH3rmgOZu9GVh3sTIXqsf2coM9FCHc+z492FsmcD+02yYiXvSJkwLLlAc0EdrLQZtvQnLOoK2CD4w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=decadent.org.uk; arc=none smtp.client-ip=65.21.191.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=decadent.org.uk Received: from [2a02:578:851f:1502:391e:c5f5:10e2:b9a3] (helo=deadeye) by maynard with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vs4oi-001HFy-2P; Mon, 16 Feb 2026 20:03:35 +0000 Received: from ben by deadeye with local (Exim 4.99.1) (envelope-from ) id 1vs4og-00000003Q4u-0o50; Mon, 16 Feb 2026 21:03:34 +0100 Date: Mon, 16 Feb 2026 21:03:34 +0100 From: Ben Hutchings To: linux-wireless@vger.kernel.org Cc: wireless-regdb@lists.infradead.org Subject: [PATCH] wireless-regdb: Replace M2Crypto with cryptography package Message-ID: Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+uwxLKIdrtAFiZHR" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a02:578:851f:1502:391e:c5f5:10e2:b9a3 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on maynard); SAEximRunCond expanded to false --+uwxLKIdrtAFiZHR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable M2Crypto is deprecated by its maintainers in favour of the cryptography package. Update db2bin.py to use that for signing regulatory.bin. Signed-off-by: Ben Hutchings --- This applies on top of the preceding fix for M2Crypto usage, but I can squash them together if it's preferable to switch directly to cryptography. Ben. --- a/db2bin.py +++ b/db2bin.py @@ -2,7 +2,6 @@ =20 from io import BytesIO, open import struct -import hashlib from dbparse import DBParser import sys =20 @@ -125,19 +124,18 @@ if len(sys.argv) > 3: # Load RSA only now so people can use this script # without having those libraries installed to verify # their SQL changes - from M2Crypto import RSA + from cryptography.hazmat.primitives import hashes, serialization + from cryptography.hazmat.primitives.asymmetric import padding =20 # determine signature length - key =3D RSA.load_key(sys.argv[3]) - hash =3D hashlib.sha1() - hash.update(output.getvalue()) - sig =3D key.sign(hash.digest(), algo=3D'sha1') + with open(sys.argv[3], 'rb') as key_file: + key =3D serialization.load_pem_private_key(key_file.read(), + password=3DNone) + sig =3D key.sign(output.getvalue(), padding.PKCS1v15(), hashes.SHA1()) # write it to file siglen.set(len(sig)) # sign again - hash =3D hashlib.sha1() - hash.update(output.getvalue()) - sig =3D key.sign(hash.digest(), algo=3D'sha1') + sig =3D key.sign(output.getvalue(), padding.PKCS1v15(), hashes.SHA1()) =20 output.write(sig) else: --+uwxLKIdrtAFiZHR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAmmTeBYACgkQ57/I7JWG EQmwUBAAsQYVWUgDmqv3A71GUQEC4GfToWFarALWU/0yTAVYeymowHPG6L+qR+Xo sagMGKQS2dX65eVlk2ICVe8QW+dbApBPI/QjgXPW7rdP1I8BmT90x46NyG7IeQQV ua0BruwReSyvD4RqsxRFo2gZ51OYJ7hcIqvYV3YgZ9jMWok0zHEa+uWo2Um8LDdS A0iIdXDXob/bzcHOVTYgb21mrVXJBzOzQv4bmoxy0uO7CGgj7gOfchZblktRKym6 N6IMMBfvGxSjWsJokCVW/KnjNDbzTfr90lKoeSLYsY+6eVbNf+iclBP8VIkjkipI eF5XIoL1wA+bAKfE7S+qVMdX73To+PQJOk+JOPau6y0tikhUzY83QM/IvvipPYjC NDWivoZKcWWUJBXCmm+x4k6E3sY6G9lHD1mBGsWOwLetK1CYdjrDd664lnN6Z2Io IMJ1iMG0fpanI/gIuo/rTcr/h17Qa9Qn50Vw4/EaU8u25kCixK+J+fzrPXdefudQ EXY/DKJAId0oa5jIS0QBCWy5PU+kDJK8cZuWP2KyWvvsZZXeUO3j5o8B/a67WEso aucCvVkC9s7KzQq9CVJJsXiWEHOUhT97yOAejYwZEdeZQHv+9iGHe1PNRU8PyVgE KPkbZRAlA52VSfovUS/7ixM7LAUODieDiDSFtlkXN80GPPkAxbQ= =MGXt -----END PGP SIGNATURE----- --+uwxLKIdrtAFiZHR--