mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix default backend issue on configuration tool
This commit is contained in:
parent
1024cebe55
commit
8fd94f061e
1 changed files with 3 additions and 2 deletions
|
|
@ -30,6 +30,7 @@ from tqdm.auto import tqdm
|
||||||
from cryptography import x509
|
from cryptography import x509
|
||||||
from cryptography.hazmat.primitives import serialization
|
from cryptography.hazmat.primitives import serialization
|
||||||
from cryptography.hazmat.primitives.asymmetric import ec
|
from cryptography.hazmat.primitives.asymmetric import ec
|
||||||
|
from cryptography.hazmat.backends import default_backend
|
||||||
|
|
||||||
from fido2 import ctap
|
from fido2 import ctap
|
||||||
from fido2 import ctap2
|
from fido2 import ctap2
|
||||||
|
|
@ -69,7 +70,7 @@ def get_opensk_devices(batch_mode):
|
||||||
def get_private_key(data, password=None):
|
def get_private_key(data, password=None):
|
||||||
# First we try without password.
|
# First we try without password.
|
||||||
try:
|
try:
|
||||||
return serialization.load_pem_private_key(data, password=None)
|
return serialization.load_pem_private_key(data, password=None, backend=default_backend())
|
||||||
except TypeError:
|
except TypeError:
|
||||||
# Maybe we need a password then.
|
# Maybe we need a password then.
|
||||||
if sys.stdin.isatty():
|
if sys.stdin.isatty():
|
||||||
|
|
@ -98,7 +99,7 @@ def main(args):
|
||||||
fatal("Private key must be 256 bits long.")
|
fatal("Private key must be 256 bits long.")
|
||||||
info("Private key is valid.")
|
info("Private key is valid.")
|
||||||
|
|
||||||
cert = x509.load_pem_x509_certificate(args.certificate.read())
|
cert = x509.load_pem_x509_certificate(args.certificate.read(), backend=default_backend())
|
||||||
# Some sanity/validity checks
|
# Some sanity/validity checks
|
||||||
now = datetime.datetime.utcnow()
|
now = datetime.datetime.utcnow()
|
||||||
if cert.not_valid_before > now:
|
if cert.not_valid_before > now:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue