make signer_fingerprint() accept DER encoded certs

androguard's v2 signature methods return DER-encoded certificates.  The DER-
encoded certificates are parsed from JAR Signature's raw "Signature Block
File".
This commit is contained in:
Hans-Christoph Steiner 2019-01-30 14:12:51 +01:00
parent 4d68163175
commit ea84014f9b
4 changed files with 24 additions and 21 deletions

View file

@ -424,7 +424,7 @@ def getsig(apkpath):
"""
with zipfile.ZipFile(apkpath, 'r') as apk:
certs = [n for n in apk.namelist() if common.CERT_PATH_REGEX.match(n)]
certs = [n for n in apk.namelist() if common.SIGNATURE_BLOCK_FILE_REGEX.match(n)]
if len(certs) < 1:
logging.error(_("No signing certificates found in {path}").format(path=apkpath))