diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2013-11-22 11:18:57 -0800 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2013-11-22 11:18:57 -0800 |
| commit | dbccd44a638ae8705a5b14bff8b2dd74abc26045 (patch) | |
| tree | 14bfabaf3f3c7be86dfc064e919e00433a0cf2bb /core/java/android/os/RecoverySystem.java | |
| parent | ecfae4f899873f224e1aeed076dc8a41f8884487 (diff) | |
| parent | b873a17ce7be0a9771c24999adca6964431728f6 (diff) | |
Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD
Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
Diffstat (limited to 'core/java/android/os/RecoverySystem.java')
| -rw-r--r-- | core/java/android/os/RecoverySystem.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java index 85438a1ea794..b692ffdea91c 100644 --- a/core/java/android/os/RecoverySystem.java +++ b/core/java/android/os/RecoverySystem.java @@ -244,12 +244,17 @@ public class RecoverySystem { // The signature cert matches a trusted key. Now verify that // the digest in the cert matches the actual file data. - // The verifier in recovery *only* handles SHA1withRSA - // signatures. SignApk.java always uses SHA1withRSA, no - // matter what the cert says to use. Ignore - // cert.getSigAlgName(), and instead use whatever - // algorithm is used by the signature (which should be - // SHA1withRSA). + // The verifier in recovery only handles SHA1withRSA and + // SHA256withRSA signatures. SignApk chooses which to use + // based on the signature algorithm of the cert: + // + // "SHA256withRSA" cert -> "SHA256withRSA" signature + // "SHA1withRSA" cert -> "SHA1withRSA" signature + // "MD5withRSA" cert -> "SHA1withRSA" signature (for backwards compatibility) + // any other cert -> SignApk fails + // + // Here we ignore whatever the cert says, and instead use + // whatever algorithm is used by the signature. String da = sigInfo.getDigestAlgorithm(); String dea = sigInfo.getDigestEncryptionAlgorithm(); |
