Commit Graph

25 Commits

Author SHA1 Message Date
Brahmaji K c467553422 cryptfs_hw: Fix stack out of bound issue
Add strnlen() instead of strlen() to fix the buffer overflow
while processing the password.

Change-Id: I5996bb62980741b7463c8829a43524e79abc4f19
2017-05-11 21:19:56 +00:00
Brahmaji K f31c45c7f7 cryptfs_hw: Remove android reboot during password check
After reaching the maximum number of retires with wrong password,
userdata is erased based on the info written on /cache partition.
As per the latest changes of A/B, cache partition is not present
which leads to failure of userdata wipe before reboot. This patch
removes reboot from cryptfs_hw layer if max entries reached, as
frameworks take care of userdata wipe.

Change-Id: If97f2f7452beb004f44d7d41d1d76def23fe2720
2017-04-24 17:07:19 -04:00
AnilKumar Chimata 932fc086d3 cryptfs_hw: Remove keymaster partition check
As the partition names are changing from branch to branch, device
FDE key is not wrapped with Hw keymaster which is less secure.
So removing the partition name related checks to avoid failures.

Change-Id: If181b093122479ca57ff6846b10d6aa2fb3eaa0c
2017-04-24 17:07:19 -04:00
Brahmaji K 898bb15156
cryptfs_hw: update the listener property with keymaster property
Replace the sys.listener.registered with sys.keymaster.loaded
because the keymaster loading is the final operation done by
the qseecomd and key operations should wait till the qseecomd
initialization completes.

Change-Id: I78a2a6941058f8ec6197ef88b324f6178f7ae2fb
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2016-12-09 18:05:46 +01:00
Dinesh K Garg 9e4c081d3b
Wait for QSEECom listeners before calling KMS APIs
Sometime it is possible that KMS APIs are invoked and QSEECom
listeners are not up. This would cause failure from secure side
and KMS API will fail eventually. This change waits for QSEECom
listeners to be up before calling KMS APIs. If QSEECom listeners
are not up even after wait period, API would fail without going
to secure side.

Change-Id: I211248645f92fc0fcfe6f250cb1f26661f5fb06c
2016-08-22 14:26:54 +02:00
Dinesh K Garg 8654ee58ec
Cleanup temporarily stored passwords
While verifying or updating passwords, those are copied into temp
variables which are freed after use. These variables should be
cleaned up before freeing so that passwords are not left in memory
if someone dumps the memory.

Change-Id: I94f76f679bac18a682c796fe98236549e8f5e1aa
2016-08-22 14:26:24 +02:00
Dinesh K Garg a0c9136aaf cryptfs_hw: Tie HW FDE keys with keymaster
HW FDE keys would be tied to keymaster so that if someone changes
Root of Trust (ROT), encrypted data can't be used. Cryptfs_hw module
is exposing a new API so that caller can determine whether to create
dependency between HW FDE keys and keymaster.

Change-Id: I85c85ffd9086f6c060032e4ae701b10363d88529
2016-03-05 14:25:09 -05:00
Dinesh K Garg 8b7f937886 cryptfs_hw: Update module as per vold project
Update cryptfs_hw API signatures as per the vold project
requests to avoid compilation errors.

Change-Id: I1c2133f3cee395892e7fa160afc6314059ba0bcb
2016-03-05 14:24:56 -05:00
Chiou-Hao Hsu facc4de471 cryptfs_hw: add string.h
Change-Id: I7f64400bfa33dcb87d2c6260b8a055d0262f7511
2016-03-05 14:24:46 -05:00
AnilKumar Chimata 115e27f891 cryptfs_hw: Update APIs to take old password
Update cryptfs_hw APIs to take old password along with the new
passowrd.

Change-Id: Ieca5c4bac36ba4bb2371d2f3bbe0cadf79e256d7
2016-03-05 14:24:36 -05:00
Dinesh K Garg 549537b17b Adding support for eMMC based ICE
ICE (Inline Crypto Engine) encrypts/decrypts storage IO requests to
minimize degradation in storage IO throughput. ICE has been added to
eMMC based storage hardware as well. Adding required support for eMMC
based ICE.

Change-Id: I7986d95ccabca9d6d029653c804608e7d78ad9ef
2016-03-05 14:24:26 -05:00
AnilKumar Chimata 76a469d75e cryptfs_hw: Add support for wipe_key routine
Add support for wipe_key routine to clean key.

Change-Id: I9e258e1506d0634c4fc5b5142475005f6eb51c4e
2016-03-05 14:24:14 -05:00
Dinesh K Garg befedbb9ff Adding support of Inline Crypto Engine (ICE)
ICE requires keys to be set in key LUT. Changing APIs so that it
return the key index in key LUT. It also needs to take care if
ICE is available on the chip.

Change-Id:  I22be18738ba33e5b5c61639c24b320484d0ad7f2
2016-03-05 14:23:47 -05:00
Sri Krishna Chaitanya Madireddy 9e9930f883 qcom/common: Added O_NOFOLLOW to avoid follow the symlink
open system call is added with NOFOLLOW flag

Change-Id: I402643635e3ee11b3ac5df63c3b71a9fd6f0d2db
2016-03-05 14:23:37 -05:00
Dinesh K Garg cd55e1f10a Port cryptfs_hw library to 64bit platform
64 bit platform generates library at a different path compared to
32 bit platform.Added macros to take care of both kind of platforms.

Change-Id: Ie32b8edaeb9f8f34095c7f18c4add83fe957d82a
2016-03-05 14:23:25 -05:00
Dinesh K Garg 119da7e181 Wrong function pointer usage
qseecom_create_key which is a function pointer is used after
dereferencing it. Also fixed the issue where userdata may not be
wiped after certain number of attemps.

Change-Id: I4d14366e33c09da64f89000a16b7eef7d981cfda
2016-03-05 14:23:12 -05:00
Dinesh K Garg 23b7304eed Place library in vendor folder on device
All vendors developed libraries must be in vendor folder on
device. Using appropriate directive to accomplish the objective.

Change-Id: I4ed413b799c0b66a86321f799713068776fa538a
2016-03-05 14:23:01 -05:00
Dinesh K Garg 94a8f4d8ef vold: HW based device encryption
SW based device encryption uses SW crypto engine. This module
provides the support for VOLD to utilize HW crypto engine. HW
based crypto engine is more efficient both in terms of power
and throughput.

Change-Id: I34107a0ce50d9fc5c80c15ace0678a0bba7adee5
2016-03-05 14:22:37 -05:00
Jake Weinstein 157b56fb51 common: remove stuff that either belongs in device or doesn't belong at all.
* Note: cryptfs_hw was removed so that devices can use their own.

Change-Id: I6f83ceb7b32a0f578ecdd1a9ad0b92211deace6b
2015-10-11 20:20:17 +00:00
AnilKumar Chimata 81337b0d19 cryptfs_hw: Add support for wipe_key routine
Add support for wipe_key routine to clean key.

Change-Id: I9e258e1506d0634c4fc5b5142475005f6eb51c4e
2015-01-21 14:21:32 +05:30
Dinesh K Garg b9c825d1db Adding support of Inline Crypto Engine (ICE)
ICE requires keys to be set in key LUT. Changing APIs so that it
return the key index in key LUT. It also needs to take care if
ICE is available on the chip.

Change-Id:  I22be18738ba33e5b5c61639c24b320484d0ad7f2
2014-12-08 23:25:13 -08:00
Sri Krishna Chaitanya Madireddy e2933668b1 qcom/common: Added O_NOFOLLOW to avoid follow the symlink
open system call is added with NOFOLLOW flag

Change-Id: I402643635e3ee11b3ac5df63c3b71a9fd6f0d2db
2014-05-20 14:11:25 -07:00
Dinesh K Garg e1be36e21c Wrong function pointer usage
qseecom_create_key which is a function pointer is used after
dereferencing it. Also fixed the issue where userdata may not be
wiped after certain number of attemps.

Change-Id: I4d14366e33c09da64f89000a16b7eef7d981cfda
2014-03-05 07:20:39 -08:00
Dinesh K Garg 44768773f2 Place library in vendor folder on device
All vendors developed libraries must be in vendor folder on
device. Using appropriate directive to accomplish the objective.

Change-Id: I4ed413b799c0b66a86321f799713068776fa538a
2014-02-07 11:40:40 -08:00
Dinesh K Garg 211bcef117 vold: HW based device encryption
SW based device encryption uses SW crypto engine. This module
provides the support for VOLD to utilize HW crypto engine. HW
based crypto engine is more efficient both in terms of power
and throughput.

Change-Id: I34107a0ce50d9fc5c80c15ace0678a0bba7adee5
2014-02-07 11:40:40 -08:00