1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 02:50:12 +01:00

Replace md5 with hashlib.md5

This commit is contained in:
Daniel Martí 2016-01-04 18:36:47 +01:00
parent dd8ad7a4fd
commit da258dad57
2 changed files with 5 additions and 6 deletions

View File

@ -20,8 +20,8 @@
import sys
import os
import shutil
import md5
import glob
import hashlib
from argparse import ArgumentParser
import logging
@ -90,7 +90,7 @@ def main():
vercodes = common.read_pkg_args(options.appid, True)
allaliases = []
for appid in allapps:
m = md5.new()
m = hashlib.md5()
m.update(appid)
keyalias = m.hexdigest()[:8]
if keyalias in allaliases:
@ -155,11 +155,11 @@ def main():
# For this particular app, the key alias is overridden...
keyalias = config['keyaliases'][appid]
if keyalias.startswith('@'):
m = md5.new()
m = hashlib.md5()
m.update(keyalias[1:])
keyalias = m.hexdigest()[:8]
else:
m = md5.new()
m = hashlib.md5()
m.update(appid)
keyalias = m.hexdigest()[:8]
logging.info("Key alias: " + keyalias)

View File

@ -34,7 +34,6 @@ import time
from pyasn1.error import PyAsn1Error
from pyasn1.codec.der import decoder, encoder
from pyasn1_modules import rfc2315
from hashlib import md5
from binascii import hexlify, unhexlify
from PIL import Image
@ -401,7 +400,7 @@ def getsig(apkpath):
cert_encoded = encoder.encode(certificates)[4:]
return md5(cert_encoded.encode('hex')).hexdigest()
return hashlib.md5(cert_encoded.encode('hex')).hexdigest()
def scan_apks(apps, apkcache, repodir, knownapks, use_date_from_apk=False):