From 3abee2f2269c5eec43171f8d9deb9d1cfdc87929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Thu, 26 Sep 2019 13:08:47 +0200 Subject: [PATCH] fix str-problem creating fingerprint in python3 --- certweb/pubkeys.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/certweb/pubkeys.py b/certweb/pubkeys.py index 5ca8191..7cd460b 100644 --- a/certweb/pubkeys.py +++ b/certweb/pubkeys.py @@ -52,9 +52,9 @@ def create(): ssh_pubkey = request.form['ssh_pubkey'] splitkey = ssh_pubkey.split(' ') enc = splitkey.pop(0) - key = splitkey.pop(0) + key = str.encode(splitkey.pop(0)) comment = ' '.join(splitkey) - fingerprint = base64.b64encode(hashlib.sha256(base64.b64decode(key)).digest()).rstrip("=") + fingerprint = str(base64.b64encode(hashlib.sha256(base64.b64decode(key)).digest()), "utf-8").rstrip('=') print(fingerprint) db = get_db()