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 KEYMASTER_SECURE_PORT "com.android.trusty.keymaster.secure" 20 21 /** 22 * keymaster_command - command identifier for secure KM operations 23 * @GET_AUTH_TOKEN_KEY: retrieves the auth token key from KM. 24 * Payload not required. 25 */ 26 #define KM_RESP_BIT 1U 27 #define KM_STOP_BIT 2U 28 #define KM_REQ_SHIFT 2U 29 #define KM_GET_AUTH_TOKEN_KEY (0U << KM_REQ_SHIFT) 30 #define KM_GET_DEVICE_INFO (1U << KM_REQ_SHIFT) 31 #define KM_SET_ATTESTATION_IDS_SECURE (0xc000 << KM_REQ_SHIFT) 32 33 /** 34 * keymaster_message - Serial header for communicating with KM server 35 * @cmd: the command, one of keymaster_command. 36 * @payload: start of the serialized command specific payload 37 */ 38 struct keymaster_message { 39 uint32_t cmd; 40 uint8_t payload[0]; 41 }; 42