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

update: report signing key fingerprint in same format as client

fdroidclient now uses SHA256 fingerprints internally, and they are shown in
the repo details view.  This changes the digest algorithm to SHA256 and
changes the format to match what is shown in the repo details view.
This commit is contained in:
Hans-Christoph Steiner 2014-04-25 21:07:47 -04:00
parent a66bf2037c
commit 5e93b6c80b

View File

@ -632,10 +632,9 @@ def make_index(apps, apks, repodir, archive, categories):
# Generate a certificate fingerprint the same way keytool does it # Generate a certificate fingerprint the same way keytool does it
# (but with slightly different formatting) # (but with slightly different formatting)
def cert_fingerprint(data): def cert_fingerprint(data):
digest = hashlib.sha1(data).digest() digest = hashlib.sha256(data).digest()
ret = [] ret = []
for i in range(4): ret.append(' '.join("%02X" % ord(b) for b in digest))
ret.append(":".join("%02X" % ord(b) for b in digest[i*5:i*5+5]))
return " ".join(ret) return " ".join(ret)
def extract_pubkey(): def extract_pubkey():
@ -789,8 +788,8 @@ def make_index(apps, apks, repodir, archive, categories):
if 'repo_keyalias' in config: if 'repo_keyalias' in config:
logging.info("Creating signed index.") logging.info("Creating signed index with this key:")
logging.info("Key fingerprint: %s" % repo_pubkey_fingerprint) logging.info("SHA256: %s" % repo_pubkey_fingerprint)
#Create a jar of the index... #Create a jar of the index...
p = FDroidPopen(['jar', 'cf', 'index.jar', 'index.xml'], cwd=repodir) p = FDroidPopen(['jar', 'cf', 'index.jar', 'index.xml'], cwd=repodir)