Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 915a7393 authored by Ilya Matyukhin's avatar Ilya Matyukhin Committed by Automerger Merge Worker
Browse files

Merge "Remove timeout from IFingerprint generateChallenge" into sc-dev am: 4373ae5b

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/13783847

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I49c681aab8751ed4c3789310853d66ec0aa7e2ff
parents 3357af03 4373ae5b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+6 −8
Original line number Diff line number Diff line
@@ -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.
+3 −3
Original line number Diff line number Diff line
@@ -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);
    }));

+2 −2
Original line number Diff line number Diff line
@@ -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 */);
    }
+1 −1
Original line number Diff line number Diff line
@@ -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;