Annotation of embedaddon/strongswan/src/libtpmtss/tpm_tss_quote_info.h, revision 1.1
1.1 ! misho 1: /*
! 2: * Copyright (C) 2016 Andreas Steffen
! 3: * HSR Hochschule fuer Technik Rapperswil
! 4: *
! 5: * This program is free software; you can redistribute it and/or modify it
! 6: * under the terms of the GNU General Public License as published by the
! 7: * Free Software Foundation; either version 2 of the License, or (at your
! 8: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
! 9: *
! 10: * This program is distributed in the hope that it will be useful, but
! 11: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! 12: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
! 13: * for more details.
! 14: */
! 15:
! 16: /**
! 17: * @defgroup tpm_tss_quote_info tpm_tss_quote_info
! 18: * @{ @ingroup libtpmtss
! 19: */
! 20:
! 21: #ifndef TPM_TSS_QUOTE_INFO_H_
! 22: #define TPM_TSS_QUOTE_INFO_H_
! 23:
! 24: #include <library.h>
! 25:
! 26: #include <crypto/hashers/hasher.h>
! 27:
! 28: typedef enum tpm_quote_mode_t tpm_quote_mode_t;
! 29: typedef struct tpm_tss_quote_info_t tpm_tss_quote_info_t;
! 30: typedef struct tpm_tss_pcr_composite_t tpm_tss_pcr_composite_t;
! 31:
! 32: /**
! 33: * TPM Quote Modes
! 34: */
! 35: enum tpm_quote_mode_t {
! 36: TPM_QUOTE_NONE,
! 37: TPM_QUOTE,
! 38: TPM_QUOTE2,
! 39: TPM_QUOTE2_VERSION_INFO,
! 40: TPM_QUOTE_TPM2
! 41: };
! 42:
! 43: struct tpm_tss_pcr_composite_t {
! 44:
! 45: /**
! 46: * Bit map of selected PCRs
! 47: */
! 48: chunk_t pcr_select;
! 49:
! 50: /**
! 51: * Array of selected PCRs
! 52: */
! 53: chunk_t pcr_composite;
! 54:
! 55: };
! 56:
! 57: /**
! 58: * TPM Quote Information needed to verify the Quote Signature
! 59: */
! 60: struct tpm_tss_quote_info_t {
! 61:
! 62: /**
! 63: * Get TPM Quote Mode
! 64: *
! 65: * @return TPM Quote Mode
! 66: */
! 67: tpm_quote_mode_t (*get_quote_mode)(tpm_tss_quote_info_t *this);
! 68:
! 69: /**
! 70: * Get PCR Composite digest algorithm
! 71: *
! 72: * @return PCR Composite digest algorithm
! 73: */
! 74: hash_algorithm_t (*get_pcr_digest_alg)(tpm_tss_quote_info_t *this);
! 75:
! 76: /**
! 77: * Get PCR Composite digest
! 78: *
! 79: * @return PCR Composite digest
! 80: */
! 81: chunk_t (*get_pcr_digest)(tpm_tss_quote_info_t *this);
! 82:
! 83: /**
! 84: * Get TPM Quote Info digest, the basis of the TPM Quote Signature
! 85: *
! 86: * @param nonce Derived from the Diffie-Hellman exchange
! 87: * @param composite PCR Composite as computed by IMV
! 88: * @param quoted Encoded TPM Quote
! 89: * @return TRUE if TPM Quote was successfully constructed
! 90: */
! 91: bool (*get_quote)(tpm_tss_quote_info_t *this, chunk_t nonce,
! 92: tpm_tss_pcr_composite_t *composite,
! 93: chunk_t *quoted);
! 94:
! 95: /**
! 96: * Set TPM version info (needed for TPM 1.2)
! 97: *
! 98: * @param version_info TPM 1.2 version info
! 99: */
! 100: void (*set_version_info)(tpm_tss_quote_info_t *this, chunk_t version_info);
! 101:
! 102: /**
! 103: * Get TPM 2.0 version info (needed for TPM 2.0)
! 104: *
! 105: * @return TPM 2.0 firmwareVersion
! 106: */
! 107: chunk_t (*get_version_info)(tpm_tss_quote_info_t *this);
! 108:
! 109: /**
! 110: * Set TPM 2.0 info parameters (needed for TPM 2.0)
! 111: *
! 112: * @param qualified_signer TPM 2.0 qualifiedSigner
! 113: * @param clock_info TPM 2.0 clockInfo
! 114: * @param pcr_select TPM 2.0 pcrSelect
! 115: */
! 116: void (*set_tpm2_info)(tpm_tss_quote_info_t *this, chunk_t qualified_signer,
! 117: chunk_t clock_info, chunk_t pcr_select);
! 118:
! 119:
! 120: /**
! 121: * Get TPM 2.0 info parameters (needed for TPM 2.0)
! 122: *
! 123: * @param qualified_signer TPM 2.0 qualifiedSigner
! 124: * @param clock_info TPM 2.0 clockInfo
! 125: * @param pcr_select TPM 2.0 pcrSelect
! 126: */
! 127: void (*get_tpm2_info)(tpm_tss_quote_info_t *this, chunk_t *qualified_signer,
! 128: chunk_t *clock_info, chunk_t *pcr_select);
! 129:
! 130: /**
! 131: * Get reference to Quote Info object.
! 132: */
! 133: tpm_tss_quote_info_t* (*get_ref)(tpm_tss_quote_info_t *this);
! 134:
! 135: /**
! 136: * Destroy a tpm_tss_quote_info_t.
! 137: */
! 138: void (*destroy)(tpm_tss_quote_info_t *this);
! 139: };
! 140:
! 141: /**
! 142: * Create a tpm_tss_quote_info instance.
! 143: *
! 144: * @param quote_mode TPM Quote mode
! 145: * @param pcr_digest_alg PCR Composite digest algorithm
! 146: * @param pcr_digest PCR Composite digest
! 147: */
! 148: tpm_tss_quote_info_t *tpm_tss_quote_info_create(tpm_quote_mode_t quote_mode,
! 149: hash_algorithm_t pcr_digest_alg, chunk_t pcr_digest);
! 150:
! 151: #endif /** TPM_TSS_QUOTE_INFO_H_ @}*/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>