summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Marshall <tdm@cyngn.com>2016-05-06 09:03:09 -0700
committerTom Marshall <tdm@cyngn.com>2016-05-09 11:31:53 -0700
commit1a1bc89263166e1b3eb2650a14387eb41467bebd (patch)
tree20caac0529f5701e3447fe5ead97f180fdddf05d
parentd5c4b6d47212ad97f21afaee47e3679b397f3d01 (diff)
downloadandroid_system_vold-stable/cm-13.0-ZNH2KB.tar.gz
android_system_vold-stable/cm-13.0-ZNH2KB.tar.bz2
android_system_vold-stable/cm-13.0-ZNH2KB.zip
cryptfs: Only consider patterns for upgrade conversionstable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2K
This avoids trying to fix certain PINs and passwords that would be detected as broken by fix_broken_cm12_pattern(). Jira: OPO-677 Change-Id: I057b0c4231f1fb19b992f379fdbe7e9aa934eafd (cherry picked from commit ece26f2f8c4df54a41fb2ce3aa829f894c92b691)
-rw-r--r--cryptfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cryptfs.c b/cryptfs.c
index 92e25d3..0115fa8 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -221,7 +221,9 @@ static int verify_and_update_hw_fde_passwd(char *passwd,
}
strlcpy(new_passwd, DEFAULT_HEX_PASSWORD, strlen(DEFAULT_HEX_PASSWORD) + 1);
} else {
- new_passwd = fix_broken_cm12_pattern(passwd);
+ if (crypt_ftr->crypt_type == CRYPT_TYPE_PATTERN) {
+ new_passwd = fix_broken_cm12_pattern(passwd);
+ }
if (new_passwd == NULL) { // not an old broken pattern
new_passwd = (char*)malloc(strlen(passwd) * 2 + 1);
if (new_passwd == NULL) {