differences incurred by rebasing - thanks Linus
This commit is contained in:
@@ -1111,33 +1111,6 @@ METHOD(pts_t, add_pcr, bool,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(pts_t, does_pcr_value_match, bool,
|
||||
private_pts_t *this, chunk_t pcr_after_value)
|
||||
{
|
||||
enumerator_t *e;
|
||||
pcr_entry_t *entry;
|
||||
|
||||
if (!this->pcrs)
|
||||
{
|
||||
this->pcrs = linked_list_create();
|
||||
}
|
||||
|
||||
e = this->pcrs->create_enumerator(this->pcrs);
|
||||
while (e->enumerate(e, &entry))
|
||||
{
|
||||
if (entry->pcr_number == new->pcr_number)
|
||||
{
|
||||
DBG4(DBG_PTS, "updating already added PCR%d value",
|
||||
entry->pcr_number);
|
||||
this->pcrs->remove_at(this->pcrs, e);
|
||||
free(entry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
DESTROY_IF(e);
|
||||
this->pcrs->insert_last(this->pcrs, new);
|
||||
}
|
||||
|
||||
/**
|
||||
* TPM_QUOTE_INFO structure:
|
||||
* 4 bytes of version
|
||||
@@ -1229,26 +1202,6 @@ METHOD(pts_t, get_quote_info, bool,
|
||||
hasher->allocate_hash(hasher, pcr_comp, &hash_pcr_comp);
|
||||
hasher->destroy(hasher);
|
||||
|
||||
writer->write_data(writer, hash_pcr_composite);
|
||||
chunk_clear(&pcr_composite);
|
||||
chunk_clear(&hash_pcr_composite);
|
||||
|
||||
/* Hash the PCR Composite Structure */
|
||||
hasher->allocate_hash(hasher, pcr_composite, out_pcr_composite);
|
||||
DBG4(DBG_PTS, "Hash of calculated PCR Composite: %B", out_pcr_composite);
|
||||
hasher->destroy(hasher);
|
||||
}
|
||||
else
|
||||
{
|
||||
*out_pcr_composite = chunk_clone(pcr_composite);
|
||||
DBG3(DBG_PTS, "calculated PCR Composite: %B", out_pcr_composite);
|
||||
}
|
||||
|
||||
/* SHA1 hash of PCR Composite to construct TPM_QUOTE_INFO */
|
||||
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA1);
|
||||
hasher->allocate_hash(hasher, pcr_composite, &hash_pcr_composite);
|
||||
hasher->destroy(hasher);
|
||||
|
||||
/* Construct TPM_QUOTE_INFO/TPM_QUOTE_INFO2 structure */
|
||||
writer = bio_writer_create(TPM_QUOTE_INFO_LEN);
|
||||
|
||||
@@ -1330,15 +1283,7 @@ METHOD(pts_t, verify_quote_signature, bool,
|
||||
DESTROY_IF(aik_pub_key);
|
||||
return FALSE;
|
||||
}
|
||||
*/
|
||||
|
||||
if (!aik_pub_key->get_encoding(aik_pub_key,
|
||||
PUBKEY_SPKI_ASN1_DER, &key_encoding))
|
||||
{
|
||||
DBG1(DBG_PTS, "failed to get encoding of AIK public key");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
aik_pub_key->destroy(aik_pub_key);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+1
-96
@@ -160,37 +160,6 @@ struct pts_t {
|
||||
*/
|
||||
bool (*calculate_secret) (pts_t *this);
|
||||
|
||||
/**
|
||||
* Set PTS Diffie Hellman Object
|
||||
*
|
||||
* @param dh D-H object
|
||||
*/
|
||||
bool (*create_dh_nonce)(pts_t *this, pts_dh_group_t group, int nonce_len);
|
||||
|
||||
/**
|
||||
* Get my Diffie-Hellman public value
|
||||
*
|
||||
* @param value My public DH value
|
||||
* @param nonce My DH nonce
|
||||
*/
|
||||
void (*get_my_public_value)(pts_t *this, chunk_t *value, chunk_t *nonce);
|
||||
|
||||
/**
|
||||
* Set peer Diffie.Hellman public value
|
||||
*
|
||||
* @param value Peer public DH value
|
||||
* @param nonce Peer DH nonce
|
||||
*/
|
||||
void (*set_peer_public_value) (pts_t *this, chunk_t value, chunk_t nonce);
|
||||
|
||||
/**
|
||||
* Calculates secret assessment value to be used for TPM Quote as ExternalData
|
||||
*
|
||||
* @return TRUE unless both DH public values
|
||||
* and nonces are set
|
||||
*/
|
||||
bool (*calculate_secret) (pts_t *this);
|
||||
|
||||
/**
|
||||
* Get Platform and OS Info
|
||||
*
|
||||
@@ -261,8 +230,7 @@ struct pts_t {
|
||||
bool (*is_path_valid)(pts_t *this, char *path, pts_error_code_t *error_code);
|
||||
|
||||
/**
|
||||
* Compute a hash over a file
|
||||
*
|
||||
* Compute a hash over a file
|
||||
* @param hasher Hasher to be used
|
||||
* @param pathname Absolute path of a file
|
||||
* @param hash Buffer to keep hash output
|
||||
@@ -368,68 +336,6 @@ struct pts_t {
|
||||
*/
|
||||
bool (*verify_quote_signature)(pts_t *this, chunk_t data, chunk_t signature);
|
||||
|
||||
/**
|
||||
* Reads given PCR value and returns it
|
||||
* Expects owner secret to be WELL_KNOWN_SECRET
|
||||
*
|
||||
* @param pcr_num Number of PCR to read
|
||||
* @param pcr_value Chunk to save pcr read output
|
||||
* @return NULL in case of TSS error, PCR value otherwise
|
||||
*/
|
||||
bool (*read_pcr)(pts_t *this, u_int32_t pcr_num, chunk_t *pcr_value);
|
||||
|
||||
/**
|
||||
* Extends given PCR with given value
|
||||
* Expects owner secret to be WELL_KNOWN_SECRET
|
||||
*
|
||||
* @param pcr_num Number of PCR to extend
|
||||
* @param input Value to extend
|
||||
* @param output Chunk to save PCR value after extension
|
||||
* @return FALSE in case of TSS error, TRUE otherwise
|
||||
*/
|
||||
bool (*extend_pcr)(pts_t *this, u_int32_t pcr_num, chunk_t input,
|
||||
chunk_t *output);
|
||||
|
||||
/**
|
||||
* Quote over PCR's
|
||||
* Expects owner and SRK secret to be WELL_KNOWN_SECRET and no password set for AIK
|
||||
*
|
||||
* @param pcrs Array of PCR's to make quotation over
|
||||
* @param num_of_pcrs Number of elements in pcrs array
|
||||
* @param pcr_composite Chunk to save pcr composite structure
|
||||
* @param quote_signature Chunk to save quote operation output
|
||||
* without external data (anti-replay protection)
|
||||
* @return FALSE in case of TSS error, TRUE otherwise
|
||||
*/
|
||||
bool (*quote_tpm)(pts_t *this, u_int32_t *pcrs, u_int32_t num_of_pcrs,
|
||||
chunk_t *pcr_composite, chunk_t *quote_signature);
|
||||
|
||||
/**
|
||||
* Add extended PCR with its corresponding value
|
||||
*
|
||||
* @return FALSE in case of any error or non-match, TRUE otherwise
|
||||
*/
|
||||
void (*add_pcr_entry)(pts_t *this, pcr_entry_t *entry);
|
||||
|
||||
/**
|
||||
* Constructs and returns TPM Quote Info structure expected from IMC
|
||||
*
|
||||
* @param pcr_composite Output variable to store PCR Composite
|
||||
* @param quote_info Output variable to store TPM Quote Info
|
||||
* @return FALSE in case of any error, TRUE otherwise
|
||||
*/
|
||||
bool (*get_quote_info)(pts_t *this, chunk_t *pcr_composite,
|
||||
chunk_t *quote_info);
|
||||
|
||||
/**
|
||||
* Constructs and returns PCR Quote Digest structure expected from IMC
|
||||
*
|
||||
* @param data Calculated TPM Quote Digest
|
||||
* @param signature TPM Quote Signature received from IMC
|
||||
* @return FALSE in case signature is not verified, TRUE otherwise
|
||||
*/
|
||||
bool (*verify_quote_signature)(pts_t *this, chunk_t data, chunk_t signature);
|
||||
|
||||
/**
|
||||
* Destroys a pts_t object.
|
||||
*/
|
||||
@@ -445,4 +351,3 @@ struct pts_t {
|
||||
pts_t* pts_create(bool is_imc);
|
||||
|
||||
#endif /** PTS_H_ @}*/
|
||||
|
||||
|
||||
@@ -93,17 +93,6 @@ bool pts_dh_group_update(char *dh_group, pts_dh_group_t *dh_groups);
|
||||
pts_dh_group_t pts_dh_group_select(pts_dh_group_t supported_dh_groups,
|
||||
pts_dh_group_t offered_dh_groups);
|
||||
|
||||
/**
|
||||
* Select the strongest supported Diffie-Hellman group
|
||||
* among a set of offered DH groups
|
||||
*
|
||||
* @param dh_group set of supported DH groups
|
||||
* @param groups set of offered DH groups
|
||||
* @return selected DH group
|
||||
*/
|
||||
pts_dh_group_t pts_dh_group_select(pts_dh_group_t supported_dh_groups,
|
||||
pts_dh_group_t offered_dh_groups);
|
||||
|
||||
/**
|
||||
* Convert pts_dh_group_t to diffie_hellman_group_t
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user