summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2011-08-05 15:07:41 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-05 15:07:41 -0700
commitd37dbc7c96aa78ba297b46de04a4c565b8a2e71a (patch)
tree9f308520560f115e3f4abd76dc308f93a0905e54
parent580dc389db5d0a5fbdebb7c77fb89214318f9ce3 (diff)
parenteef4ae44b308350e669b829da75610058ff4d328 (diff)
downloadframeworks_base-d37dbc7c96aa78ba297b46de04a4c565b8a2e71a.zip
frameworks_base-d37dbc7c96aa78ba297b46de04a4c565b8a2e71a.tar.gz
frameworks_base-d37dbc7c96aa78ba297b46de04a4c565b8a2e71a.tar.bz2
Merge "Fix bug where sometimes the full backup pw would not be validated"
-rw-r--r--services/java/com/android/server/BackupManagerService.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index 2e3d6dd..8b7d3a8 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -2034,6 +2034,15 @@ class BackupManagerService extends IBackupManager.Stub {
boolean compressing = COMPRESS_FULL_BACKUPS;
OutputStream finalOutput = ofstream;
+ // Verify that the given password matches the currently-active
+ // backup password, if any
+ if (hasBackupPassword()) {
+ if (!passwordMatchesSaved(mCurrentPassword, PBKDF2_HASH_ROUNDS)) {
+ if (DEBUG) Slog.w(TAG, "Backup password mismatch; aborting");
+ return;
+ }
+ }
+
// Write the global file header. All strings are UTF-8 encoded; lines end
// with a '\n' byte. Actual backup data begins immediately following the
// final '\n'.
@@ -2068,15 +2077,6 @@ class BackupManagerService extends IBackupManager.Stub {
try {
// Set up the encryption stage if appropriate, and emit the correct header
if (encrypting) {
- // Verify that the given password matches the currently-active
- // backup password, if any
- if (hasBackupPassword()) {
- if (!passwordMatchesSaved(mCurrentPassword, PBKDF2_HASH_ROUNDS)) {
- if (DEBUG) Slog.w(TAG, "Backup password mismatch; aborting");
- return;
- }
- }
-
finalOutput = emitAesBackupHeader(headerbuf, finalOutput);
} else {
headerbuf.append("none\n");