chiark / gitweb /
check signature and OpenSSL after APK has proven valid
authorHans-Christoph Steiner <hans@eds.org>
Thu, 1 Jun 2017 14:24:31 +0000 (16:24 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 1 Jun 2017 15:45:29 +0000 (17:45 +0200)
commit8776221988803ac27a42febe475503546a04752a
tree69e456781fc270d586864b3d80793e75ad99b565
parent372c8b418db7e3c661debbd24df2f405baa95569
check signature and OpenSSL after APK has proven valid

If working with a random grabbag of APKs, there can be all sorts of
issues like corrupt entries in the ZIP, bad signatures, signatures that
are invalid since they use MD5, etc.  Moving these two checks later means
that the APKs can be renamed still.

This does change how common.getsig() works.  For years, it returned
None if the signature check failed.  Now that I've started working
with giant APK collections gathered from the wild, I can see that
`fdroid update` needs to be able to first index what's there, then
make decisions based on that information.  So that means separating
the getsig() fingerprint fetching from the APK signature verification.

This is not hugely security sensitive, since the APKs still have to
get past the Android checks, e.g. update signature checks.  Plus the
APK hash is already included in the signed index.
fdroidserver/update.py
tests/update.TestCase