From 163cbc27c0daf4fd49170a9be5c0755bdb948bd6 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 23 Aug 2021 13:22:17 +0200 Subject: [PATCH] =?UTF-8?q?Compatibilit=C3=A9=20Debian=20Buster?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yohann D'ANELLO --- pscheck/pscheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pscheck/pscheck.py b/pscheck/pscheck.py index 751883b..8c48ecd 100644 --- a/pscheck/pscheck.py +++ b/pscheck/pscheck.py @@ -4,6 +4,7 @@ import argparse import base64 import cbor2 from cryptography import x509 +from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.asymmetric.utils import \ encode_dss_signature @@ -78,7 +79,8 @@ def analyse_qrcode(qrcode: str, additional_info: bool = False, with open(os.path.join(base_dir, 'certs', f"{cert_name}.pem")) as f: cert_asc = f.read() - cert = x509.load_pem_x509_certificate(cert_asc.encode()) + cert = x509.load_pem_x509_certificate(cert_asc.encode(), + default_backend()) public_key = cert.public_key()