crypto: Update crypto fde
* Some missed in 191a6948d9
* Crypto msg from https://source.codeaurora.org/quic/la/platform/system/vold/commit/cryptfs.cpp?h=LA.UM.8.1.r1-13500-sm8150.0&id=e1a7e772699216121dd8fa774381ffeedb076139
* As devices required to update 'Upgraded key' through keymaster in v4.0.
Change-Id: Ia66be6917c4690f0d70ba89ea33ebfa2fcb6974a
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit b51f4af5286750bf15ffe61fd85e8600cbfd15c5)
This commit is contained in:
@@ -528,7 +528,9 @@ initfail:
|
||||
ftr->keymaster_blob, KEYMASTER_BLOB_SIZE, &ftr->keymaster_blob_size);
|
||||
#endif //TW_KEYMASTER_MAX_API == 3
|
||||
#if TW_KEYMASTER_MAX_API >= 4
|
||||
//for (;;) {
|
||||
for (int c = 1;c <= 20;c++) { // 20 tries are enough for signing keymaster
|
||||
if (c > 2)
|
||||
usleep(5000); // if failed in two tries lets rest
|
||||
auto result = keymaster_sign_object_for_cryptfs_scrypt(
|
||||
ftr->keymaster_blob, ftr->keymaster_blob_size, KEYMASTER_CRYPTFS_RATE_LIMIT, to_sign,
|
||||
to_sign_size, signature, signature_size);
|
||||
@@ -552,8 +554,7 @@ initfail:
|
||||
SLOGE("Failed to write upgraded key to disk");
|
||||
}*/
|
||||
SLOGD("Key upgraded successfully\n");
|
||||
return 0;
|
||||
//}
|
||||
}
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
@@ -912,7 +913,10 @@ static int load_crypto_mapping_table(struct crypt_mnt_ftr *crypt_ftr,
|
||||
tgt->length = crypt_ftr->fs_size;
|
||||
crypt_params = buffer + sizeof(struct dm_ioctl) + sizeof(struct dm_target_spec);
|
||||
buff_offset = crypt_params - buffer;
|
||||
SLOGI("Extra parameters for dm_crypt: %s\n", extra_params);
|
||||
SLOGI(
|
||||
"Creating crypto dev \"%s\"; cipher=%s, keysize=%u, real_dev=%s, len=%llu, params=\"%s\"\n",
|
||||
name, crypt_ftr->crypto_type_name, crypt_ftr->keysize, real_blk_name, tgt->length * 512,
|
||||
extra_params);
|
||||
|
||||
#ifdef CONFIG_HW_DISK_ENCRYPTION
|
||||
if(is_hw_disk_encryption((char*)crypt_ftr->crypto_type_name)) {
|
||||
|
||||
Reference in New Issue
Block a user