Fix missing error handling in keymaster comatibility check
The compatibility check assumes that the keymaster session was created successfully which is a faulty assumption. This patch adds propper error handling to the check. Bug: 35576166 Change-Id: I0c70a0e53f488f8bd3164898722f490cd0573ce3
This commit is contained in:
parent
a3b6d90934
commit
e7152c38df
1 changed files with 6 additions and 1 deletions
|
@ -196,7 +196,12 @@ bool Keymaster::isSecure() {
|
||||||
using namespace ::android::vold;
|
using namespace ::android::vold;
|
||||||
|
|
||||||
int keymaster_compatibility_cryptfs_scrypt() {
|
int keymaster_compatibility_cryptfs_scrypt() {
|
||||||
return Keymaster().isSecure();
|
Keymaster dev;
|
||||||
|
if (!dev) {
|
||||||
|
LOG(ERROR) << "Failed to initiate keymaster session";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return dev.isSecure();
|
||||||
}
|
}
|
||||||
|
|
||||||
int keymaster_create_key_for_cryptfs_scrypt(uint32_t rsa_key_size,
|
int keymaster_create_key_for_cryptfs_scrypt(uint32_t rsa_key_size,
|
||||||
|
|
Loading…
Reference in a new issue