diff options
author | Scott Lobdell <slobdell@google.com> | 2021-03-11 19:08:54 +0000 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-03-11 19:08:54 +0000 |
commit | a4bc4d3a2b36280f54cdad53b0bb0de8b4223d55 (patch) | |
tree | 0c8d19a6d8d901cb20498399ab3e3f8434aa1fcd /identity/aidl/default/common/IdentityCredential.cpp | |
parent | 86bfa300dfbcf500ad04bede19a2b5f0e6d418b9 (diff) | |
parent | f4b38dd9acd9e6e5803ceda6c6a467c97512216e (diff) |
Merge SP1A.210311.001
Change-Id: Icc232e4382ad1df43912307e19aa40f579396b6b
Diffstat (limited to 'identity/aidl/default/common/IdentityCredential.cpp')
-rw-r--r-- | identity/aidl/default/common/IdentityCredential.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/identity/aidl/default/common/IdentityCredential.cpp b/identity/aidl/default/common/IdentityCredential.cpp index 94779971b1..c8ee0dd67a 100644 --- a/identity/aidl/default/common/IdentityCredential.cpp +++ b/identity/aidl/default/common/IdentityCredential.cpp @@ -253,14 +253,17 @@ ndk::ScopedAStatus IdentityCredential::startRetrieval( } } - // Feed the auth token to secure hardware. - if (!hwProxy_->setAuthToken(authToken.challenge, authToken.userId, authToken.authenticatorId, - int(authToken.authenticatorType), authToken.timestamp.milliSeconds, - authToken.mac, verificationToken_.challenge, - verificationToken_.timestamp.milliSeconds, - int(verificationToken_.securityLevel), verificationToken_.mac)) { - return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage( - IIdentityCredentialStore::STATUS_INVALID_DATA, "Invalid Auth Token")); + // Feed the auth token to secure hardware only if they're valid. + if (authToken.timestamp.milliSeconds != 0) { + if (!hwProxy_->setAuthToken( + authToken.challenge, authToken.userId, authToken.authenticatorId, + int(authToken.authenticatorType), authToken.timestamp.milliSeconds, + authToken.mac, verificationToken_.challenge, + verificationToken_.timestamp.milliSeconds, + int(verificationToken_.securityLevel), verificationToken_.mac)) { + return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage( + IIdentityCredentialStore::STATUS_INVALID_DATA, "Invalid Auth Token")); + } } // We'll be feeding ACPs interleaved with certificates from the reader |