fix str-problem creating fingerprint in python3
This commit is contained in:
parent
fa2fe85b12
commit
3abee2f226
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue