fix str-problem creating fingerprint in python3

This commit is contained in:
Jakobus Schürz 2019-09-26 13:08:47 +02:00
parent fa2fe85b12
commit 3abee2f226

View file

@ -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()