blob: 999a311011757199eb6e861d89bf54dea4b5504b [file] [log] [blame]
Alexey Polyudov586a32f2016-08-29 12:08:44 -07001package android.hardware.gatekeeper@1.0;
2
3interface IGatekeeper {
4
5/**
6 * Enrolls desiredPassword, which may be derived from a user selected pin
7 * or password, with the private key used only for enrolling authentication
8 * factor data.
9 *
10 * If there was already a password enrolled, current password handle must be
11 * passed in currentPasswordHandle, and current password must be passed in
12 * currentPassword. Valid currentPassword must verify() against
13 * currentPasswordHandle.
14 *
15 * @param uid The Android user identifier
16 *
17 * @param currentPasswordHandle The currently enrolled password handle the user
18 * wants to replace. May be empty only if there's no currently enrolled
19 * password. Otherwise must be non-empty.
20 *
21 * @param currentPassword The user's current password in plain text.
22 * it MUST verify against current_password_handle if the latter is not-empty
23 *
24 * @param desiredPassword The new password the user wishes to enroll in
25 * plaintext.
26 *
27 * @return response
28 * On success, data buffer must contain the new password handle referencing
29 * the password provided in desiredPassword.
30 * This buffer can be used on subsequent calls to enroll or
31 * verify. On error, this buffer must be empty.
32 * response.code must always contain operation completion status.
33 * This method may return ERROR_GENERAL_FAILURE or ERROR_RETRY_TIMEOUT on
34 * failure. It must return STATUS_OK on success.
35 * If ERROR_RETRY_TIMEOUT is returned, response.timeout must be non-zero.
36 */
37enroll(uint32_t uid,
38 vec<uint8_t> currentPasswordHandle,
39 vec<uint8_t> currentPassword,
40 vec<uint8_t> desiredPassword)
41 generates (GatekeeperResponse response);
42
43/**
44 * Verifies that providedPassword matches enrolledPasswordHandle.
45 *
46 * Implementations of this module may retain the result of this call
47 * to attest to the recency of authentication.
48 *
49 * On success, returns verification token in response.data, which shall be
50 * usable to attest password verification to other trusted services.
51 *
52 * @param uid The Android user identifier
53 *
54 * @param challenge An optional challenge to authenticate against, or 0.
55 * Used when a separate authenticator requests password verification,
56 * or for transactional password authentication.
57 *
58 * @param enrolledPasswordHandle The currently enrolled password handle that
59 * user wishes to verify against. Must be non-empty.
60 *
61 * @param providedPassword The plaintext password to be verified against the
62 * enrolledPasswordHandle
63 *
64 * @return response
65 * On success, a non-empty data buffer containing the
66 * authentication token resulting from this verification is returned.
67 * On error, data buffer must be empty.
68 * response.code must always contain operation completion status.
69 * This method may return ERROR_GENERAL_FAILURE or ERROR_RETRY_TIMEOUT on
70 * failure. It must return STATUS_OK on success.
71 * If password re-enrollment is necessary, it must return STATUS_REENROLL.
72 * If ERROR_RETRY_TIMEOUT is returned, response.timeout must be non-zero.
73 */
74verify(uint32_t uid, uint64_t challenge,
75 vec<uint8_t> enrolledPasswordHandle,
76 vec<uint8_t> providedPassword)
77 generates (GatekeeperResponse response);
78
79/*
80 * Deletes the enrolledPasswordHandle associated with the uid. Once deleted
81 * the user cannot be verified anymore.
82 * This is an optional method.
83 *
84 * @param uid The Android user identifier
85 *
86 * @return response
87 * response.code must always contain operation completion status.
88 * This method may return ERROR_GENERAL_FAILURE or ERROR_RETRY_TIMEOUT on
89 * failure. It must return STATUS_OK on success.
90 * If not implemented, it must return ERROR_NOT_IMPLEMENTED.
91 * If ERROR_RETRY_TIMEOUT is returned, response.timeout must be non-zero.
92 */
93deleteUser(uint32_t uid) generates (GatekeeperResponse response);
94
95/*
96 * Deletes all the enrolled_password_handles for all uid's. Once called,
97 * no users must be enrolled on the device.
98 * This is an optional method.
99 *
100 * @return response
101 * response.code must always contain operation completion status.
102 * This method may return ERROR_GENERAL_FAILURE or ERROR_RETRY_TIMEOUT on
103 * failure. It must return STATUS_OK on success.
104 * If not implemented, it must return ERROR_NOT_IMPLEMENTED.
105 * If ERROR_RETRY_TIMEOUT is returned, response.timeout must be non-zero.
106 */
107deleteAllUsers() generates (GatekeeperResponse response);
108};