1 /* 2 * Copyright (C) 2015 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 17 #pragma once 18 19 #define GATEKEEPER_PORT "com.android.trusty.gatekeeper" 20 #define GATEKEEPER_MAX_BUFFER_LENGTH 1024 21 22 enum gatekeeper_command { 23 GK_REQ_SHIFT = 1, 24 GK_RESP_BIT = 1, 25 26 GK_ENROLL = (0 << GK_REQ_SHIFT), 27 GK_VERIFY = (1 << GK_REQ_SHIFT), 28 }; 29 30 /** 31 * gatekeeper_message - Serial header for communicating with GK server 32 * @cmd: the command, one of ENROLL, VERIFY. Payload must be a serialized 33 * buffer of the corresponding request object. 34 * @payload: start of the serialized command specific payload 35 */ 36 struct gatekeeper_message { 37 uint32_t cmd; 38 uint8_t payload[0]; 39 }; 40 41