mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-07 01:41:06 +03:00
Return public key and fingerprint after generating repo signing key
This commit is contained in:
parent
c484dc33be
commit
c9b76eb808
2 changed files with 35 additions and 17 deletions
|
@ -1107,15 +1107,6 @@ def scan_apks(apkcache, repodir, knownapks, use_date_from_apk=False):
|
|||
repo_pubkey_fingerprint = None
|
||||
|
||||
|
||||
# Generate a certificate fingerprint the same way keytool does it
|
||||
# (but with slightly different formatting)
|
||||
def cert_fingerprint(data):
|
||||
digest = hashlib.sha256(data).digest()
|
||||
ret = []
|
||||
ret.append(' '.join("%02X" % b for b in bytearray(digest)))
|
||||
return " ".join(ret)
|
||||
|
||||
|
||||
def extract_pubkey():
|
||||
global repo_pubkey_fingerprint
|
||||
if 'repo_pubkey' in config:
|
||||
|
@ -1134,7 +1125,7 @@ def extract_pubkey():
|
|||
logging.critical(msg)
|
||||
sys.exit(1)
|
||||
pubkey = p.output
|
||||
repo_pubkey_fingerprint = cert_fingerprint(pubkey)
|
||||
repo_pubkey_fingerprint = common.get_cert_fingerprint(pubkey)
|
||||
return hexlify(pubkey)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue