1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2018 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 17*4d7e907cSAndroid Build Coastguard Worker 18*4d7e907cSAndroid Build Coastguard Worker/** 19*4d7e907cSAndroid Build Coastguard Worker * This security HAL allows vendor components to be cryptographically tied to 20*4d7e907cSAndroid Build Coastguard Worker * the primary user's credential. For example, security hardware could require 21*4d7e907cSAndroid Build Coastguard Worker * proof that the credential is known before applying updates. 22*4d7e907cSAndroid Build Coastguard Worker * 23*4d7e907cSAndroid Build Coastguard Worker * This HAL is optional so does not require an implementation on device. 24*4d7e907cSAndroid Build Coastguard Worker */ 25*4d7e907cSAndroid Build Coastguard Workerinterface IAuthSecret { 26*4d7e907cSAndroid Build Coastguard Worker /** 27*4d7e907cSAndroid Build Coastguard Worker * When the primary user is unlocked, this method is passed a secret to 28*4d7e907cSAndroid Build Coastguard Worker * prove that is has been successfully unlocked. The primary user can either 29*4d7e907cSAndroid Build Coastguard Worker * be unlocked by a person entering their credential or by another party 30*4d7e907cSAndroid Build Coastguard Worker * using an escrow token e.g. a device administrator. 31*4d7e907cSAndroid Build Coastguard Worker * 32*4d7e907cSAndroid Build Coastguard Worker * The first time this is called, the secret must be used to provision state 33*4d7e907cSAndroid Build Coastguard Worker * that depends on the primary user's secret. The same secret must be passed 34*4d7e907cSAndroid Build Coastguard Worker * on each call until the next factory reset. 35*4d7e907cSAndroid Build Coastguard Worker * 36*4d7e907cSAndroid Build Coastguard Worker * Upon factory reset, any dependence on the secret must be removed as that 37*4d7e907cSAndroid Build Coastguard Worker * secret is now lost and must never be derived again. A new secret must be 38*4d7e907cSAndroid Build Coastguard Worker * created for the new primary user which must be used to newly provision 39*4d7e907cSAndroid Build Coastguard Worker * state the first time this method is called after factory reset. 40*4d7e907cSAndroid Build Coastguard Worker * 41*4d7e907cSAndroid Build Coastguard Worker * The secret must be at least 16 bytes. 42*4d7e907cSAndroid Build Coastguard Worker * 43*4d7e907cSAndroid Build Coastguard Worker * @param secret blob derived from the primary user's credential. 44*4d7e907cSAndroid Build Coastguard Worker */ 45*4d7e907cSAndroid Build Coastguard Worker oneway primaryUserCredential(vec<uint8_t> secret); 46*4d7e907cSAndroid Build Coastguard Worker}; 47