blob: 975001f30ba5cc812d43ed92a431e25371c5b2c2 [file] [log] [blame]
Ilya Matyukhin69d1d662020-03-25 17:14:12 -07001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.biometrics.face@1.1;
18import @1.0::IBiometricsFace;
19import @1.0::Status;
20import @1.0::Feature;
21
22/**
23 * The HAL interface for biometric face authentication.
24 */
25interface IBiometricsFace extends @1.0::IBiometricsFace {
26 /**
27 * Enrolls a user's face for a remote client, for example Android Auto.
28 *
29 * The HAL implementation is responsible for creating a secure communication
30 * channel and receiving the enrollment images from a mobile device with
31 * face authentication hardware.
32 *
33 * Note that the Hardware Authentication Token must be valid for the
34 * duration of enrollment and thus should be explicitly invalidated by a
35 * call to revokeChallenge() when enrollment is complete, to reduce the
36 * window of opportunity to re-use the challenge and HAT. For example,
37 * Settings calls generateChallenge() once to allow the user to enroll one
38 * or more faces or toggle secure settings without having to re-enter the
39 * PIN/pattern/password. Once the user completes the operation, Settings
40 * invokes revokeChallenge() to close the transaction. If the HAT is expired,
41 * the implementation must invoke onError with UNABLE_TO_PROCESS.
42 *
43 * Requirements for using this API:
44 * - Mobile devices MUST NOT delegate enrollment to another device by calling
45 * this API. This feature is intended only to allow enrollment on devices
46 * where it is impossible to enroll locally on the device.
47 * - The path MUST be protected by a secret key with rollback protection.
48 * - Synchronizing between devices MUST be accomplished by having both
49 * devices agree on a secret PIN entered by the user (similar to BT
50 * pairing procedure) and use a salted version of that PIN plus other secret
51 * to encrypt traffic.
52 * - All communication to/from the remote device MUST be encrypted and signed
53 * to prevent image injection and other man-in-the-middle type attacks.
54 * - generateChallenge() and revokeChallenge() MUST be implemented on both
55 * remote and local host (e.g. hash the result of the remote host with a
56 * local secret before responding to the API call) and any transmission of
57 * the challenge between hosts MUST be signed to prevent man-in-the-middle
58 * attacks.
59 * - In the event of a lost connection, the result of the last
60 * generateChallenge() MUST be invalidated and the process started over.
61 * - Both the remote and local host MUST honor the timeout and invalidate the
62 * challenge.
63 *
64 * This method triggers the IBiometricsFaceClientCallback#onEnrollResult()
65 * method.
66 *
67 * @param hat A valid Hardware Authentication Token, generated as a result
68 * of a generateChallenge() challenge being wrapped by the gatekeeper
69 * after a successful strong authentication request.
70 * @param timeoutSec A timeout in seconds, after which this enroll
71 * attempt is cancelled. Note that the framework can continue
72 * enrollment by calling this again with a valid HAT. This timeout is
73 * expected to be used to limit power usage if the device becomes idle
74 * during enrollment. The implementation is expected to send
75 * ERROR_TIMEOUT if this happens.
76 * @param disabledFeatures A list of features to be disabled during
77 * enrollment. Note that all features are enabled by default.
78 * @return status The status of this method call.
79 */
Joshua Mccloskeyd1f16b82021-02-09 03:46:16 +000080 enrollRemotely(vec<uint8_t> hat, uint32_t timeoutSec,
81 vec<Feature> disabledFeatures) generates (Status status);
Ilya Matyukhin69d1d662020-03-25 17:14:12 -070082};