summaryrefslogtreecommitdiff
path: root/core/java/android/os/RecoverySystem.java
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2013-11-22 11:18:57 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2013-11-22 11:18:57 -0800
commitdbccd44a638ae8705a5b14bff8b2dd74abc26045 (patch)
tree14bfabaf3f3c7be86dfc064e919e00433a0cf2bb /core/java/android/os/RecoverySystem.java
parentecfae4f899873f224e1aeed076dc8a41f8884487 (diff)
parentb873a17ce7be0a9771c24999adca6964431728f6 (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.java17
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();