blob: d2cb5da5452096691daae193232869b7fa0d88cb [file] [log] [blame]
Andrew Scull70934312018-01-03 11:51:54 +00001/*
2 * Copyright (C) 2018 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 */
16package android.hardware.authsecret@1.0;
17
18/**
19 * This security HAL allows vendor components to be cryptographically tied to
20 * the primary user's credential. For example, security hardware could require
21 * proof that the credential is known before applying updates.
22 *
23 * This HAL is optional so does not require an implementation on device.
24 */
25interface IAuthSecret {
26 /**
27 * When the primary user correctly enters their credential, this method is
28 * passed a secret derived from that credential to prove that their
29 * credential is known.
30 *
31 * The first time this is called, the secret must be used to provision state
32 * that depends on the primary user's credential. The same secret is passed
33 * on each call until a factory reset after which there must be a new
34 * secret.
35 *
36 * The secret must be at lesat 16 bytes.
37 *
38 * @param secret blob derived from the primary user's credential.
39 */
40 primaryUserCredential(vec<uint8_t> secret);
41
42 /**
43 * Called from recovery during factory reset. The secret is now lost and can
44 * no longer be derived. Any data linked to the secret must be destroyed and
45 * any dependence on the secret must be removed.
46 */
47 factoryReset();
48};