github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/src/tpm2/quote_protocol.h (about) 1 // Copyright 2015 Google Corporation, All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // or in the the file LICENSE-2.0.txt in the top level sourcedirectory 8 // Unless required by applicable law or agreed to in writing, software 9 // distributed under the License is distributed on an "AS IS" BASIS, 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // See the License for the specific language governing permissions and 12 // limitations under the License 13 // 14 // Portions of this code were derived TPM2.0-TSS published 15 // by Intel under the license set forth in intel_license.txt 16 // and downloaded on or about August 6, 2015. 17 // File: quote_protocol.h 18 19 // standard buffer size 20 21 #ifndef __QUOTE_PROTOCOL__ 22 #define __QUOTE_PROTOCOL__ 23 #include <stdio.h> 24 #include <stdlib.h> 25 #include <sys/types.h> 26 #include <sys/stat.h> 27 #include <fcntl.h> 28 #include <unistd.h> 29 #include <string.h> 30 #include <tpm20.h> 31 #include <tpm2_lib.h> 32 #include <errno.h> 33 34 #include <openssl/sha.h> 35 36 #include <tpm2.pb.h> 37 38 #include <string> 39 using std::string; 40 41 void print_quote_certifyinfo(TPMS_ATTEST& in); 42 bool MarshalCertifyInfo(TPMS_ATTEST& in, int* size, byte* out); 43 bool UnmarshalCertifyInfo(int size, byte* in, TPMS_ATTEST* out); 44 bool ProtoToCertifyInfo(quote_certification_information& message, TPMS_ATTEST* out); 45 bool CertifyInfoToProto(TPMS_ATTEST& in, quote_certification_information& message); 46 bool ComputeQuotedValue(TPM_ALG_ID alg, int credInfo_size, byte* credInfo, 47 int* size_quoted, byte* quoted); 48 #endif 49