From 9f1f2f744b6593f2d05bec571eb66485a21a47ba Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Thu, 21 Apr 2016 11:54:00 -0500 Subject: 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 --- crypto/lollipop/cryptfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/lollipop/cryptfs.c b/crypto/lollipop/cryptfs.c index 56f10b92b..774eb1740 100644 --- a/crypto/lollipop/cryptfs.c +++ b/crypto/lollipop/cryptfs.c @@ -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, -- cgit v1.2.3