OSDN Git Service

Recover apps with malformed certificates.
authorJeff Sharkey <jsharkey@android.com>
Wed, 12 Nov 2014 20:18:11 +0000 (12:18 -0800)
committerJeff Sharkey <jsharkey@android.com>
Wed, 12 Nov 2014 21:16:06 +0000 (13:16 -0800)
commitd68b87cdd402d46013170d9316a31c82be4e4816
tree39447a9c63de992c85ae6b750a3cbc5fb21ef0ba
parent8d88f19bfe8ec0afb27593c0dea9b547d8c80b48
Recover apps with malformed certificates.

There was a window of time in Lollipop where we persisted certificates
after they had passed through a decode/encode cycle.  The well-written
OpenSSL library was liberal when decoding (allowing slightly malformed
certs to be parsed), but then strict when encoding, giving us
different bytes for effectively the same certificate.

A related libcore change (0c990ab4a90b8a5492a67b2b728ac9a4a1ccfa1b)
now returns the original bytes verbatim, fixing both pre-Lollipop
installs and installs after that change.

This change recovers any apps that had been installed during the
window of time described above by doing a one-time check to see if
the certs are effectively equal.

Bug: 18228011
Change-Id: Ib82bd6db718d0490d7a26c9c1014b7c8457a7f2d
core/java/android/content/pm/Signature.java
core/tests/coretests/src/android/content/pm/SignatureTest.java [new file with mode: 0644]
services/core/java/com/android/server/pm/PackageManagerService.java
services/core/java/com/android/server/pm/Settings.java