Home | History | Annotate | Download | only in vold

Lines Matching full:auth

107 static bool generateKeymasterKey(Keymaster& keymaster, const KeyAuthentication& auth,
115 if (auth.token.empty()) {
116 LOG(DEBUG) << "Creating key that doesn't need auth token";
119 LOG(DEBUG) << "Auth token required for key";
120 if (auth.token.size() != sizeof(hw_auth_token_t)) {
121 LOG(ERROR) << "Auth token should be " << sizeof(hw_auth_token_t) << " bytes, was "
122 << auth.token.size() << " bytes";
125 const hw_auth_token_t* at = reinterpret_cast<const hw_auth_token_t*>(auth.token.data());
133 static AuthorizationSet beginParams(const KeyAuthentication& auth,
140 if (!auth.token.empty()) {
141 LOG(DEBUG) << "Supplying auth token to Keymaster";
142 paramBuilder.Authorization(TAG_AUTH_TOKEN, blob2hidlVec(auth.token));
235 static std::string getStretching(const KeyAuthentication& auth) {
236 if (!auth.usesKeymaster()) {
238 } else if (auth.secret.empty()) {
285 static bool generateAppId(const KeyAuthentication& auth, const std::string& stretching,
289 if (!stretchSecret(stretching, auth.secret, salt, &stretched)) return false;
403 auth, const std::string& key) {
412 std::string stretching = getStretching(auth);
423 if (!generateAppId(auth, stretching, salt, secdiscardable, &appId)) return false;
425 if (auth.usesKeymaster()) {
429 if (!generateKeymasterKey(keymaster, auth, appId, &kmKey)) return false;
431 auto keyParams = beginParams(auth, appId);
440 bool retrieveKey(const std::string& dir, const KeyAuthentication& auth, std::string* key) {
456 if (!generateAppId(auth, stretching, salt, secdiscardable, &appId)) return false;
459 if (auth.usesKeymaster()) {
462 auto keyParams = beginParams(auth, appId);