From ec301b8566f84fb7d4f02e91590db8e917951cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 4 Jan 2016 17:32:58 +0100 Subject: [PATCH] common: update base64 encoding of bytes --- fdroidserver/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 32774180..e5b38c67 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -33,6 +33,7 @@ import operator import logging import hashlib import socket +import base64 import xml.etree.ElementTree as XMLElementTree from queue import Queue @@ -1923,8 +1924,9 @@ def genpassword(): '''generate a random password for when generating keys''' h = hashlib.sha256() h.update(os.urandom(16)) # salt - h.update(bytes(socket.getfqdn())) - return h.digest().encode('base64').strip() + h.update(socket.getfqdn().encode('utf-8')) + passwd = base64.b64encode(h.digest()).strip() + return passwd.decode('utf-8') def genkeystore(localconfig):