Remove timeout from IFingerprint generateChallenge

Bug: 181699471
Test: atest VtsHalBiometricsFingerprintTargetTest
Change-Id: I30e3ff213e34354310b77c9cffad3c46c3256dc7
This commit is contained in:
f
2021-03-05 05:12:58 +00:00
parent 6fce94de87
commit 8c8e4c69e9
5 changed files with 13 additions and 15 deletions

View File

@@ -34,7 +34,7 @@
package android.hardware.biometrics.fingerprint;
@VintfStability
interface ISession {
void generateChallenge(in int cookie, in int timeoutSec);
void generateChallenge(in int cookie);
void revokeChallenge(in int cookie, in long challenge);
android.hardware.biometrics.common.ICancellationSignal enroll(in int cookie, in android.hardware.keymaster.HardwareAuthToken hat);
android.hardware.biometrics.common.ICancellationSignal authenticate(in int cookie, in long operationId);

View File

@@ -61,7 +61,7 @@ interface ISession {
* to allow addition of biometric enrollments.
* To secure this path, the following path is taken:
* 1) Upon user requesting fingerprint enroll, the framework requests
* IFingerprint#generateChallenge
* ISession#generateChallenge
* 2) Framework sends the challenge to the credential subsystem, and upon credential
* confirmation, a HAT is created, containing the challenge in the "challenge" field.
* 3) Framework sends the HAT to the HAL, e.g. ISession#enroll.
@@ -69,10 +69,9 @@ interface ISession {
* 5) Implementation now has confidence that the user entered their credential to allow
* biometric enrollment.
*
* Note that the interface allows multiple in-flight challenges. For example, invoking
* generateChallenge(0, 0, timeoutSec, cb) twice does not invalidate the first challenge. The
* challenge is invalidated only when:
* 1) The provided timeout expires, or
* Note that this interface allows multiple in-flight challenges. Invoking generateChallenge
* twice does not invalidate the first challenge. The challenge is invalidated only when:
* 1) Its lifespan exceeds the HAL's internal challenge timeout
* 2) IFingerprint#revokeChallenge is invoked
*
* For example, the following is a possible table of valid challenges:
@@ -86,9 +85,8 @@ interface ISession {
* ----------------------------------------------
*
* @param cookie A unique number identifying this operation
* @param timeoutSec Duration for which the challenge is valid for
*/
void generateChallenge(in int cookie, in int timeoutSec);
void generateChallenge(in int cookie);
/**
* revokeChallenge:
@@ -117,7 +115,7 @@ interface ISession {
*
* Before capturing fingerprint data, the implementation must first verify the authenticity and
* integrity of the provided HardwareAuthToken. In addition, it must check that the challenge
* within the provided HardwareAuthToken is valid. See IFingerprint#generateChallenge. If any of
* within the provided HardwareAuthToken is valid. See ISession#generateChallenge. If any of
* the above checks fail, the framework must be notified via ISessionCallback#onError and the
* HAL must notify the framework when it returns to the idle state. See
* Error::UNABLE_TO_PROCESS.

View File

@@ -60,13 +60,13 @@ bool Session::isClosed() {
return mCurrentState == SessionState::CLOSED;
}
ndk::ScopedAStatus Session::generateChallenge(int32_t cookie, int32_t timeoutSec) {
ndk::ScopedAStatus Session::generateChallenge(int32_t cookie) {
LOG(INFO) << "generateChallenge";
scheduleStateOrCrash(SessionState::GENERATING_CHALLENGE);
mWorker->schedule(Callable::from([this, cookie, timeoutSec] {
mWorker->schedule(Callable::from([this, cookie] {
enterStateOrCrash(cookie, SessionState::GENERATING_CHALLENGE);
mEngine->generateChallengeImpl(mCb.get(), timeoutSec);
mEngine->generateChallengeImpl(mCb.get());
enterIdling(cookie);
}));

View File

@@ -22,7 +22,7 @@ namespace aidl::android::hardware::biometrics::fingerprint {
class FakeFingerprintEngine {
public:
void generateChallengeImpl(ISessionCallback* cb, int32_t /*timeoutSec*/) {
void generateChallengeImpl(ISessionCallback* cb) {
LOG(INFO) << "generateChallengeImpl";
cb->onChallengeGenerated(0 /* challenge */);
}
@@ -73,4 +73,4 @@ class FakeFingerprintEngine {
}
};
} // namespace aidl::android::hardware::biometrics::fingerprint
} // namespace aidl::android::hardware::biometrics::fingerprint

View File

@@ -32,7 +32,7 @@ class Session : public BnSession {
Session(int sensorId, int userId, std::shared_ptr<ISessionCallback> cb,
FakeFingerprintEngine* engine, WorkerThread* worker);
ndk::ScopedAStatus generateChallenge(int32_t cookie, int32_t timeoutSec) override;
ndk::ScopedAStatus generateChallenge(int32_t cookie) override;
ndk::ScopedAStatus revokeChallenge(int32_t cookie, int64_t challenge) override;