Check key store result with isOk() instead of casted value
The underlying value of the return code is not meaningful
in a check, instead isOk() should be used.
Bug: 119771891
Test: Built for walleye successfully, basic operations with
keystore_cli_v2 tool work correctly, new cts test
no longer finds a crash in keystore.
Change-Id: Id20612824677619cbbd0b2ba4a11b15fe5258ecb
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index 35530e1..aa177b6 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -1176,7 +1176,7 @@
std::tie(rc, wrappingKeyBlob, wrappingCharBlob, wrappingLockedEntry) =
mKeyStore->getKeyForName(wrappingKeyName8, callingUid, TYPE_KEYMASTER_10);
- if (!rc) {
+ if (!rc.isOk()) {
return AIDL_RETURN(rc);
}