Home | History | Annotate | Download | only in 1.0
      1 /*
      2  * Copyright (C) 2016 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 package android.hardware.gatekeeper@1.0;
     17 
     18 /**
     19  * Gatekeeper response codes; success >= 0; error < 0
     20  */
     21 enum GatekeeperStatusCode : int32_t {
     22   STATUS_REENROLL       =  1,  // success, but upper layers should re-enroll
     23                                // the verified password due to a version change
     24   STATUS_OK             =  0,  // operation is successful
     25   ERROR_GENERAL_FAILURE = -1,  // operation failed
     26   ERROR_RETRY_TIMEOUT   = -2,  // operation should be retried after timeout
     27   ERROR_NOT_IMPLEMENTED = -3,  // operation is not implemented
     28 };
     29 
     30 /**
     31  * Gatekeeper response to any/all requests has this structure as mandatory part
     32  */
     33 struct GatekeeperResponse {
     34     /** request completion status */
     35     GatekeeperStatusCode code;
     36     /**
     37      * retry timeout in ms, if code == ERROR_RETRY_TIMEOUT
     38      * otherwise unused (0)
     39      */
     40     uint32_t timeout;
     41     /** optional crypto blob. Opaque to Android system. */
     42     vec<uint8_t> data;
     43 };
     44