Fix decrypt of odd number length PIN on hardware crypto

I am not sure if we are really fixing anything other than we are
allowing the decrypt process to continue. On hardware crypto the
password never seems to match what is expected from the data in
the footer, probably because the data is not stored in the footer
and TZ does all the work. Still, if it works, it is hard to fault
the patch.

Change-Id: Ibbb286382e82523bec2064f51fa07194f84820c2
This commit is contained in:
Ethan Yonker
2016-04-21 11:54:00 -05:00
committed by Dees Troy
parent 5da130284e
commit 9f1f2f744b
+2 -2
View File
@@ -1208,8 +1208,8 @@ static int scrypt_keymaster(const char *passwd, const unsigned char *salt,
unsigned char* master_key = convert_hex_ascii_to_key(passwd, &key_size);
if (!master_key) {
printf("Failed to convert passwd from hex\n");
return -1;
printf("Failed to convert passwd from hex, using passwd instead\n");
master_key = strdup(passwd);
}
rc = crypto_scrypt(master_key, key_size, salt, SALT_LEN,