1/* 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 */ 16 17// We check in the prebuilt nanopb protobuf file under the current folder 18// because the compile tool chain using trusty/user/base/make/compile_proto.mk 19// might not work under certain environment with lower version of python 20// protobuf installed. You need to generate and check in the new protobuf file 21// if you change this file in order for the change to take effect! 22// 23// To generate the file using the tool chain in trusty tree, add the following 24// command to rules.mk: 25// 26// PB_GEN_DIR := [Your generation folder] 27// include trusty/user/base/make/compile_proto.mk 28// $(eval $(call compile_proto,$(KEYMASTER_DIR)/keymaster_attributes.proto,$(PB_GEN_DIR))) 29// 30// The generated .pb.c and .pb.h file would be under PB_GEN_DIR, include them 31// to the source path. 32// 33// To generate the file using your own tool chain, please follow the guide at 34// https://github.com/nanopb/nanopb. 35// Please check the nanopb version in trusty tree at external/nanopb-c to make 36// sure you are using the same nanopb version. 37 38syntax = "proto2"; 39 40import "nanopb.proto"; 41 42message KeymasterAttributes { 43 optional bytes uuid = 1 [(nanopb).max_size=32]; 44 optional bytes product_id = 2 [(nanopb).max_size=16]; 45}; 46 47message AttestationIds { 48 optional bytes brand = 1 [(nanopb).max_size=64]; 49 optional bytes device = 2 [(nanopb).max_size=64]; 50 optional bytes product = 3 [(nanopb).max_size=64]; 51 optional bytes serial = 4 [(nanopb).max_size=64]; 52 optional bytes imei = 5 [(nanopb).max_size=64]; 53 optional bytes meid = 6 [(nanopb).max_size=64]; 54 optional bytes manufacturer = 7 [(nanopb).max_size=64]; 55 optional bytes model = 8 [(nanopb).max_size=64]; 56 optional bytes second_imei = 9 [(nanopb).max_size=64]; 57}; 58 59message AttestationKey { 60 optional bytes key = 1 [(nanopb).max_size=2048]; 61 repeated AttestationCert certs = 2 [(nanopb).max_count=3]; 62}; 63 64message AttestationCert { 65 required bytes content = 1 [(nanopb).max_size=2048]; 66}; 67