fix str-problem creating fingerprint in python3
This commit is contained in:
parent
fa2fe85b12
commit
3abee2f226
|
@ -52,9 +52,9 @@ def create():
|
||||||
ssh_pubkey = request.form['ssh_pubkey']
|
ssh_pubkey = request.form['ssh_pubkey']
|
||||||
splitkey = ssh_pubkey.split(' ')
|
splitkey = ssh_pubkey.split(' ')
|
||||||
enc = splitkey.pop(0)
|
enc = splitkey.pop(0)
|
||||||
key = splitkey.pop(0)
|
key = str.encode(splitkey.pop(0))
|
||||||
comment = ' '.join(splitkey)
|
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)
|
print(fingerprint)
|
||||||
|
|
||||||
db = get_db()
|
db = get_db()
|
||||||
|
|
Loading…
Reference in a new issue