1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 22:40:12 +01:00

publish: fix hashing of strings

This commit is contained in:
Daniel Martí 2016-01-04 18:46:51 +01:00
parent a78341d8e5
commit b31e20ee8b

View File

@ -91,7 +91,7 @@ def main():
allaliases = []
for appid in allapps:
m = hashlib.md5()
m.update(appid)
m.update(appid.encode('utf-8'))
keyalias = m.hexdigest()[:8]
if keyalias in allaliases:
logging.error("There is a keyalias collision - publishing halted")
@ -156,11 +156,11 @@ def main():
keyalias = config['keyaliases'][appid]
if keyalias.startswith('@'):
m = hashlib.md5()
m.update(keyalias[1:])
m.update(keyalias[1:].encode('utf-8'))
keyalias = m.hexdigest()[:8]
else:
m = hashlib.md5()
m.update(appid)
m.update(appid.encode('utf-8'))
keyalias = m.hexdigest()[:8]
logging.info("Key alias: " + keyalias)