Lines Matching refs:auth

108 static bool generateKeymasterKey(Keymaster& keymaster, const KeyAuthentication& auth,  in generateKeymasterKey()  argument
114 if (auth.token.empty()) { in generateKeymasterKey()
119 if (auth.token.size() != sizeof(hw_auth_token_t)) { in generateKeymasterKey()
121 << auth.token.size() << " bytes"; in generateKeymasterKey()
124 const hw_auth_token_t* at = reinterpret_cast<const hw_auth_token_t*>(auth.token.data()); in generateKeymasterKey()
164 const KeyAuthentication& auth, const std::string& appId) { in beginParams() argument
169 if (!auth.token.empty()) { in beginParams()
171 authToken = km::support::hidlVec2AuthToken(km::support::blob2hidlVec(auth.token)); in beginParams()
314 static std::string getStretching(const KeyAuthentication& auth) { in getStretching() argument
315 if (!auth.usesKeymaster()) { in getStretching()
317 } else if (auth.secret.empty()) { in getStretching()
364 static bool generateAppId(const KeyAuthentication& auth, const std::string& stretching, in generateAppId() argument
368 if (!stretchSecret(stretching, auth.secret, salt, &stretched)) return false; in generateAppId()
483 bool storeKey(const std::string& dir, const KeyAuthentication& auth, const KeyBuffer& key) { in storeKey() argument
491 std::string stretching = getStretching(auth); in storeKey()
502 if (!generateAppId(auth, stretching, salt, secdiscardable_hash, &appId)) return false; in storeKey()
504 if (auth.usesKeymaster()) { in storeKey()
508 if (!generateKeymasterKey(keymaster, auth, appId, &kmKey)) return false; in storeKey()
512 std::tie(keyParams, authToken) = beginParams(auth, appId); in storeKey()
525 const KeyAuthentication& auth, const KeyBuffer& key) { in storeKeyAtomically() argument
534 if (!storeKey(tmp_path, auth, key)) return false; in storeKeyAtomically()
543 bool retrieveKey(const std::string& dir, const KeyAuthentication& auth, KeyBuffer* key, in retrieveKey() argument
560 if (!generateAppId(auth, stretching, salt, secdiscardable_hash, &appId)) return false; in retrieveKey()
563 if (auth.usesKeymaster()) { in retrieveKey()
568 std::tie(keyParams, authToken) = beginParams(auth, appId); in retrieveKey()