crypto: remove redundant convert_key_to_hex_ascii call
- Breaks decryption on some hw_crypto devices
- Default value already defined in preceding ifdef
- PS2: Move crypt_params definition prior to ifdef
(matches corresponding code from CAF)
Huge thanks to @beaups for figuring out the issue!
Change-Id: I1fd4e3a4862f022b17a555773feb1d6deac9d34c
diff --git a/crypto/lollipop/cryptfs.c b/crypto/lollipop/cryptfs.c
index 774eb17..0c7848d 100644
--- a/crypto/lollipop/cryptfs.c
+++ b/crypto/lollipop/cryptfs.c
@@ -928,6 +928,8 @@
tgt->status = 0;
tgt->sector_start = 0;
tgt->length = crypt_ftr->fs_size;
+ crypt_params = buffer + sizeof(struct dm_ioctl) + sizeof(struct dm_target_spec);
+
#ifdef CONFIG_HW_DISK_ENCRYPTION
if(is_hw_disk_encryption((char*)crypt_ftr->crypto_type_name)) {
strlcpy(tgt->target_type, "req-crypt",DM_MAX_TYPE_NAME);
@@ -945,8 +947,6 @@
strlcpy(tgt->target_type, "crypt", DM_MAX_TYPE_NAME);
#endif
- crypt_params = buffer + sizeof(struct dm_ioctl) + sizeof(struct dm_target_spec);
- convert_key_to_hex_ascii(master_key, crypt_ftr->keysize, master_key_ascii);
sprintf(crypt_params, "%s %s 0 %s 0 %s", crypt_ftr->crypto_type_name,
master_key_ascii, real_blk_name, extra_params);