summaryrefslogtreecommitdiff
path: root/src/libpts/tcg
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-04-26 14:57:47 +0200
committerYves-Alexis Perez <corsac@debian.org>2013-04-26 14:57:47 +0200
commit10e5fb2b9b2f27c83b3e5a1d048b158d5cf42a43 (patch)
treebf1d05a2e37dbd1911b86fcc026fbe49b0239c71 /src/libpts/tcg
parent7585facf05d927eb6df3929ce09ed5e60d905437 (diff)
downloadvyos-strongswan-10e5fb2b9b2f27c83b3e5a1d048b158d5cf42a43.tar.gz
vyos-strongswan-10e5fb2b9b2f27c83b3e5a1d048b158d5cf42a43.zip
Imported Upstream version 5.0.3
Diffstat (limited to 'src/libpts/tcg')
-rw-r--r--src/libpts/tcg/tcg_attr.c17
-rw-r--r--src/libpts/tcg/tcg_attr.h17
-rw-r--r--src/libpts/tcg/tcg_pts_attr_aik.c4
-rw-r--r--src/libpts/tcg/tcg_pts_attr_aik.h6
-rw-r--r--src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.h6
-rw-r--r--src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.h2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.h8
-rw-r--r--src/libpts/tcg/tcg_pts_attr_file_meas.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_file_meas.h8
-rw-r--r--src/libpts/tcg/tcg_pts_attr_gen_attest_evid.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_gen_attest_evid.h2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_get_aik.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_get_aik.h2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.h2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_meas_algo.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_meas_algo.h2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_proto_caps.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_proto_caps.h2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_req_file_meas.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_req_file_meas.h11
-rw-r--r--src/libpts/tcg/tcg_pts_attr_req_file_meta.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_req_file_meta.h10
-rw-r--r--src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.h6
-rw-r--r--src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h8
-rw-r--r--src/libpts/tcg/tcg_pts_attr_simple_evid_final.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_simple_evid_final.h18
-rw-r--r--src/libpts/tcg/tcg_pts_attr_tpm_version_info.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_tpm_version_info.h6
-rw-r--r--src/libpts/tcg/tcg_pts_attr_unix_file_meta.c2
-rw-r--r--src/libpts/tcg/tcg_pts_attr_unix_file_meta.h8
36 files changed, 103 insertions, 74 deletions
diff --git a/src/libpts/tcg/tcg_attr.c b/src/libpts/tcg/tcg_attr.c
index 656791a8f..b91bf8283 100644
--- a/src/libpts/tcg/tcg_attr.c
+++ b/src/libpts/tcg/tcg_attr.c
@@ -31,8 +31,23 @@
#include "tcg/tcg_pts_attr_req_file_meta.h"
#include "tcg/tcg_pts_attr_unix_file_meta.h"
-ENUM_BEGIN(tcg_attr_names, TCG_PTS_REQ_FUNC_COMP_EVID,
+ENUM_BEGIN(tcg_attr_names, TCG_SCAP_REFERENCES,
+ TCG_SCAP_SUMMARY_RESULTS,
+ "SCAP References",
+ "SCAP Capabilities and Inventory",
+ "SCAP Content",
+ "SCAP Assessment",
+ "SCAP Results",
+ "SCAP Summary Results");
+ENUM_NEXT(tcg_attr_names, TCG_SWID_INVENTORY_REQUEST,
+ TCG_SWID_TAG_IDENTIFIER_RESPONSE,
+ TCG_SCAP_SUMMARY_RESULTS,
+ "SWID Inventory Request",
+ "SWID Tag Response",
+ "SWID Tag Identifier Response");
+ENUM_NEXT(tcg_attr_names, TCG_PTS_REQ_FUNC_COMP_EVID,
TCG_PTS_REQ_FUNC_COMP_EVID,
+ TCG_SWID_TAG_IDENTIFIER_RESPONSE,
"Request Functional Component Evidence");
ENUM_NEXT(tcg_attr_names, TCG_PTS_GEN_ATTEST_EVID,
TCG_PTS_GEN_ATTEST_EVID,
diff --git a/src/libpts/tcg/tcg_attr.h b/src/libpts/tcg/tcg_attr.h
index b45e1488f..ed6c97619 100644
--- a/src/libpts/tcg/tcg_attr.h
+++ b/src/libpts/tcg/tcg_attr.h
@@ -14,8 +14,8 @@
*/
/**
- * @defgroup tcg_attrt tcg_attr
- * @{ @ingroup tcg_attr
+ * @defgroup tcg_attr tcg_attr
+ * @{ @ingroup libpts
*/
#ifndef TCG_ATTR_H_
@@ -31,6 +31,19 @@ typedef enum tcg_attr_t tcg_attr_t;
*/
enum tcg_attr_t {
+ /* SCAP Messages */
+ TCG_SCAP_REFERENCES = 0x00000001,
+ TCG_SCAP_CAPS_AND_INVENTORY = 0x00000002,
+ TCG_SCAP_CONTENT = 0x00000003,
+ TCG_SCAP_ASSESSMENT = 0x00000004,
+ TCG_SCAP_RESULTS = 0x00000005,
+ TCG_SCAP_SUMMARY_RESULTS = 0x00000006,
+
+ /* SWID Messages */
+ TCG_SWID_INVENTORY_REQUEST = 0x00000011,
+ TCG_SWID_TAG_RESPONSE = 0x00000012,
+ TCG_SWID_TAG_IDENTIFIER_RESPONSE = 0x00000013,
+
/* PTS Protocol Negotiations */
TCG_PTS_REQ_PROTO_CAPS = 0x01000000,
TCG_PTS_PROTO_CAPS = 0x02000000,
diff --git a/src/libpts/tcg/tcg_pts_attr_aik.c b/src/libpts/tcg/tcg_pts_attr_aik.c
index d5bbdc9cd..17a8db5d6 100644
--- a/src/libpts/tcg/tcg_pts_attr_aik.c
+++ b/src/libpts/tcg/tcg_pts_attr_aik.c
@@ -123,9 +123,9 @@ METHOD(pa_tnc_attr_t, build, void,
writer = bio_writer_create(PTS_AIK_SIZE);
writer->write_uint8(writer, flags);
writer->write_data (writer, aik_blob);
- this->value = chunk_clone(writer->get_buf(writer));
- free(aik_blob.ptr);
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
+ free(aik_blob.ptr);
}
METHOD(pa_tnc_attr_t, process, status_t,
diff --git a/src/libpts/tcg/tcg_pts_attr_aik.h b/src/libpts/tcg/tcg_pts_attr_aik.h
index 96e90582b..758fd58db 100644
--- a/src/libpts/tcg/tcg_pts_attr_aik.h
+++ b/src/libpts/tcg/tcg_pts_attr_aik.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_aik tcg_pts_attr_aik
- * @{ @ingroup tcg_pts_attr_aik
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_AIK_H_
@@ -38,7 +38,7 @@ struct tcg_pts_attr_aik_t {
* Public PA-TNC attribute interface
*/
pa_tnc_attr_t pa_tnc_attribute;
-
+
/**
* Get AIK
*
@@ -50,7 +50,7 @@ struct tcg_pts_attr_aik_t {
/**
* Creates an tcg_pts_attr_aik_t object
- *
+ *
* @param aik Attestation Identity Key
*/
pa_tnc_attr_t* tcg_pts_attr_aik_create(certificate_t *aik);
diff --git a/src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.c b/src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.c
index 4d7281243..6119b4973 100644
--- a/src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.c
+++ b/src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.c
@@ -128,7 +128,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_data (writer, this->initiator_value);
writer->write_data (writer, this->initiator_nonce);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.h b/src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.h
index 7148065c5..57cb5a9b6 100644
--- a/src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.h
+++ b/src/libpts/tcg/tcg_pts_attr_dh_nonce_finish.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_dh_nonce_finish tcg_pts_attr_dh_nonce_finish
- * @{ @ingroup tcg_pts_attr_dh_nonce_finish
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_DH_NONCE_FINISH_H_
@@ -64,7 +64,7 @@ struct tcg_pts_attr_dh_nonce_finish_t {
* @return DH Initiator Nonce
*/
chunk_t (*get_initiator_nonce)(tcg_pts_attr_dh_nonce_finish_t *this);
-
+
};
/**
@@ -76,7 +76,7 @@ struct tcg_pts_attr_dh_nonce_finish_t {
*/
pa_tnc_attr_t* tcg_pts_attr_dh_nonce_finish_create(
pts_meas_algorithms_t hash_algo,
- chunk_t initiator_value,
+ chunk_t initiator_value,
chunk_t initiator_nonce);
/**
diff --git a/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.c b/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.c
index 7796dbaab..7761b977d 100644
--- a/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.c
+++ b/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.c
@@ -117,7 +117,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint8 (writer, this->min_nonce_len);
writer->write_uint16(writer, this->dh_groups);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.h b/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.h
index 170077156..22e1bd189 100644
--- a/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.h
+++ b/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_req.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_dh_nonce_params_req tcg_pts_attr_dh_nonce_params_req
- * @{ @ingroup tcg_pts_attr_dh_nonce_params_req
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_DH_NONCE_PARAMS_REQ_H_
diff --git a/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.c b/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.c
index 1e82e7098..eb0d0e533 100644
--- a/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.c
+++ b/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.c
@@ -136,7 +136,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_data (writer, this->responder_nonce);
writer->write_data (writer, this->responder_value);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.h b/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.h
index d2141f8b9..aaf85ef37 100644
--- a/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.h
+++ b/src/libpts/tcg/tcg_pts_attr_dh_nonce_params_resp.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_dh_nonce_params_resp tcg_pts_attr_dh_nonce_params_resp
- * @{ @ingroup tcg_pts_attr_dh_nonce_params_resp
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_DH_NONCE_PARAMS_RESP_H_
@@ -67,7 +67,7 @@ struct tcg_pts_attr_dh_nonce_params_resp_t {
* @return DH Responder Public Value
*/
chunk_t (*get_responder_value)(tcg_pts_attr_dh_nonce_params_resp_t *this);
-
+
};
/**
@@ -76,11 +76,11 @@ struct tcg_pts_attr_dh_nonce_params_resp_t {
* @param dh_group Selected DH group
* @param hash_algo_set Set of supported hash algorithms
* @param responder_nonce DH Responder Nonce
- * @param responder_pub_val DH Responder Public value
+ * @param responder_value DH Responder Public value
*/
pa_tnc_attr_t* tcg_pts_attr_dh_nonce_params_resp_create(pts_dh_group_t dh_group,
pts_meas_algorithms_t hash_algo_set,
- chunk_t responder_nonce,
+ chunk_t responder_nonce,
chunk_t responder_value);
/**
diff --git a/src/libpts/tcg/tcg_pts_attr_file_meas.c b/src/libpts/tcg/tcg_pts_attr_file_meas.c
index 1daac70e5..b9095f5be 100644
--- a/src/libpts/tcg/tcg_pts_attr_file_meas.c
+++ b/src/libpts/tcg/tcg_pts_attr_file_meas.c
@@ -154,7 +154,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint16(writer, 0);
}
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_file_meas.h b/src/libpts/tcg/tcg_pts_attr_file_meas.h
index c432ba9a9..8d50cd9c6 100644
--- a/src/libpts/tcg/tcg_pts_attr_file_meas.h
+++ b/src/libpts/tcg/tcg_pts_attr_file_meas.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_file_meas tcg_pts_attr_file_meas
- * @{ @ingroup tcg_pts_attr_file_meas
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_FILE_MEAS_H_
@@ -38,19 +38,19 @@ struct tcg_pts_attr_file_meas_t {
* Public PA-TNC attribute interface
*/
pa_tnc_attr_t pa_tnc_attribute;
-
+
/**
* Get PTS File Measurements
*
* @return PTS File Measurements
*/
pts_file_meas_t* (*get_measurements)(tcg_pts_attr_file_meas_t *this);
-
+
};
/**
* Creates an tcg_pts_attr_file_meas_t object
- *
+ *
* @param measurements PTS File Measurements
*/
pa_tnc_attr_t* tcg_pts_attr_file_meas_create(pts_file_meas_t *measurements);
diff --git a/src/libpts/tcg/tcg_pts_attr_gen_attest_evid.c b/src/libpts/tcg/tcg_pts_attr_gen_attest_evid.c
index 9103e06b2..f263747a3 100644
--- a/src/libpts/tcg/tcg_pts_attr_gen_attest_evid.c
+++ b/src/libpts/tcg/tcg_pts_attr_gen_attest_evid.c
@@ -106,7 +106,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer = bio_writer_create(PTS_GEN_ATTEST_EVID_SIZE);
writer->write_uint32 (writer, PTS_GEN_ATTEST_EVID_RESERVED);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_gen_attest_evid.h b/src/libpts/tcg/tcg_pts_attr_gen_attest_evid.h
index 0a65f2143..88f070406 100644
--- a/src/libpts/tcg/tcg_pts_attr_gen_attest_evid.h
+++ b/src/libpts/tcg/tcg_pts_attr_gen_attest_evid.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_gen_attest_evid tcg_pts_attr_gen_attest_evid
- * @{ @ingroup tcg_pts_attr_gen_attest_evid
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_GEN_ATTEST_EVID_H_
diff --git a/src/libpts/tcg/tcg_pts_attr_get_aik.c b/src/libpts/tcg/tcg_pts_attr_get_aik.c
index 6f35f5419..cf944d2a9 100644
--- a/src/libpts/tcg/tcg_pts_attr_get_aik.c
+++ b/src/libpts/tcg/tcg_pts_attr_get_aik.c
@@ -103,7 +103,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer = bio_writer_create(PTS_GET_AIK_SIZE);
writer->write_uint32 (writer, PTS_GET_AIK_RESERVED);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_get_aik.h b/src/libpts/tcg/tcg_pts_attr_get_aik.h
index e5c74b4dc..aca890a20 100644
--- a/src/libpts/tcg/tcg_pts_attr_get_aik.h
+++ b/src/libpts/tcg/tcg_pts_attr_get_aik.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_get_aik tcg_pts_attr_get_aik
- * @{ @ingroup tcg_pts_attr_get_aik
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_GET_AIK_H_
diff --git a/src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.c b/src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.c
index 4dd64e3a7..647c426ed 100644
--- a/src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.c
+++ b/src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.c
@@ -106,7 +106,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer = bio_writer_create(PTS_GET_TPM_VER_INFO_SIZE);
writer->write_uint32 (writer, PTS_GET_TPM_VER_INFO_RESERVED);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.h b/src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.h
index 1b693402a..360049690 100644
--- a/src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.h
+++ b/src/libpts/tcg/tcg_pts_attr_get_tpm_version_info.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_get_tpm_version_info tcg_pts_attr_get_tpm_version_info
- * @{ @ingroup tcg_pts_attr_get_tpm_version_info
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_GET_TPM_VERSION_INFO_H_
diff --git a/src/libpts/tcg/tcg_pts_attr_meas_algo.c b/src/libpts/tcg/tcg_pts_attr_meas_algo.c
index abef45bdd..a4dac9070 100644
--- a/src/libpts/tcg/tcg_pts_attr_meas_algo.c
+++ b/src/libpts/tcg/tcg_pts_attr_meas_algo.c
@@ -109,7 +109,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer = bio_writer_create(PTS_MEAS_ALGO_SIZE);
writer->write_uint16(writer, PTS_MEAS_ALGO_RESERVED);
writer->write_uint16(writer, this->algorithms);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_meas_algo.h b/src/libpts/tcg/tcg_pts_attr_meas_algo.h
index 885e2c16b..758100bbc 100644
--- a/src/libpts/tcg/tcg_pts_attr_meas_algo.h
+++ b/src/libpts/tcg/tcg_pts_attr_meas_algo.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_meas_algo tcg_pts_attr_meas_algo
- * @{ @ingroup tcg_pts_attr_meas_algo
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_MEAS_ALGO_H_
diff --git a/src/libpts/tcg/tcg_pts_attr_proto_caps.c b/src/libpts/tcg/tcg_pts_attr_proto_caps.c
index 360883282..6473ea808 100644
--- a/src/libpts/tcg/tcg_pts_attr_proto_caps.c
+++ b/src/libpts/tcg/tcg_pts_attr_proto_caps.c
@@ -110,7 +110,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint16(writer, PTS_PROTO_CAPS_RESERVED);
writer->write_uint16(writer, this->flags);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_proto_caps.h b/src/libpts/tcg/tcg_pts_attr_proto_caps.h
index 15cfbc7cb..cc59f4ef1 100644
--- a/src/libpts/tcg/tcg_pts_attr_proto_caps.h
+++ b/src/libpts/tcg/tcg_pts_attr_proto_caps.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_proto_caps tcg_pts_attr_proto_caps
- * @{ @ingroup tcg_pts_attr_proto_caps
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_PROTO_CAPS_H_
diff --git a/src/libpts/tcg/tcg_pts_attr_req_file_meas.c b/src/libpts/tcg/tcg_pts_attr_req_file_meas.c
index 8b4bfe54d..f0bc7cf60 100644
--- a/src/libpts/tcg/tcg_pts_attr_req_file_meas.c
+++ b/src/libpts/tcg/tcg_pts_attr_req_file_meas.c
@@ -143,7 +143,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint16(writer, this->request_id);
writer->write_uint32(writer, this->delimiter);
writer->write_data (writer, pathname);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_req_file_meas.h b/src/libpts/tcg/tcg_pts_attr_req_file_meas.h
index 19d189eff..85a6b9a43 100644
--- a/src/libpts/tcg/tcg_pts_attr_req_file_meas.h
+++ b/src/libpts/tcg/tcg_pts_attr_req_file_meas.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_req_file_meas tcg_pts_attr_req_file_meas
- * @{ @ingroup tcg_pts_attr_req_file_meas
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_REQ_FILE_MEAS_H_
@@ -36,7 +36,7 @@ struct tcg_pts_attr_req_file_meas_t {
* Public PA-TNC attribute interface
*/
pa_tnc_attr_t pa_tnc_attribute;
-
+
/**
* Get flag for PTS Request File Measurement
*
@@ -50,7 +50,6 @@ struct tcg_pts_attr_req_file_meas_t {
* @return Request ID
*/
u_int16_t (*get_request_id)(tcg_pts_attr_req_file_meas_t *this);
-
/**
* Get Delimiter
@@ -58,19 +57,19 @@ struct tcg_pts_attr_req_file_meas_t {
* @return UTF-8 encoding of a Delimiter Character
*/
u_int32_t (*get_delimiter)(tcg_pts_attr_req_file_meas_t *this);
-
+
/**
* Get Fully Qualified File Pathname
*
* @return Pathname
*/
char* (*get_pathname)(tcg_pts_attr_req_file_meas_t *this);
-
+
};
/**
* Creates an tcg_pts_attr_req_file_meas_t object
- *
+ *
* @param directory_flag Directory Contents Flag
* @param request_id Request ID
* @param delimiter Delimiter Character
diff --git a/src/libpts/tcg/tcg_pts_attr_req_file_meta.c b/src/libpts/tcg/tcg_pts_attr_req_file_meta.c
index ff5581435..e475cd35b 100644
--- a/src/libpts/tcg/tcg_pts_attr_req_file_meta.c
+++ b/src/libpts/tcg/tcg_pts_attr_req_file_meta.c
@@ -136,7 +136,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint16(writer, PTS_REQ_FILE_META_RESERVED);
writer->write_data (writer, pathname);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_req_file_meta.h b/src/libpts/tcg/tcg_pts_attr_req_file_meta.h
index 7620c50ab..311418be2 100644
--- a/src/libpts/tcg/tcg_pts_attr_req_file_meta.h
+++ b/src/libpts/tcg/tcg_pts_attr_req_file_meta.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_req_file_meta tcg_pts_attr_req_file_meta
- * @{ @ingroup tcg_pts_attr_req_file_meta
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_REQ_FILE_META_H_
@@ -36,7 +36,7 @@ struct tcg_pts_attr_req_file_meta_t {
* Public PA-TNC attribute interface
*/
pa_tnc_attr_t pa_tnc_attribute;
-
+
/**
* Get directory flag for PTS Request File Metadata
*
@@ -50,19 +50,19 @@ struct tcg_pts_attr_req_file_meta_t {
* @return UTF-8 encoding of a Delimiter Character
*/
u_int8_t (*get_delimiter)(tcg_pts_attr_req_file_meta_t *this);
-
+
/**
* Get Fully Qualified File Pathname
*
* @return Pathname
*/
char* (*get_pathname)(tcg_pts_attr_req_file_meta_t *this);
-
+
};
/**
* Creates an tcg_pts_attr_req_file_meta_t object
- *
+ *
* @param directory_flag Directory Contents Flag
* @param delimiter Delimiter Character
* @param pathname File Pathname
diff --git a/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.c b/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.c
index 8bb43aef8..5249fa2ad 100644
--- a/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.c
+++ b/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.c
@@ -183,7 +183,7 @@ METHOD(pa_tnc_attr_t, build, void,
}
enumerator->destroy(enumerator);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.h b/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.h
index 031955aca..749413c2e 100644
--- a/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.h
+++ b/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_req_func_comp_evid tcg_pts_attr_req_func_comp_evid
- * @{ @ingroup tcg_pts_attr_req_func_comp_evid
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_REQ_FUNC_COMP_EVID_H_
@@ -37,7 +37,7 @@ struct tcg_pts_attr_req_func_comp_evid_t {
* Public PA-TNC attribute interface
*/
pa_tnc_attr_t pa_tnc_attribute;
-
+
/**
* Add a component to the Functional Component Evidence Request
*
@@ -62,7 +62,7 @@ struct tcg_pts_attr_req_func_comp_evid_t {
* @return Entry enumerator
*/
enumerator_t* (*create_enumerator)(tcg_pts_attr_req_func_comp_evid_t *this);
-
+
};
/**
diff --git a/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c b/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c
index c659443b7..40f380ab4 100644
--- a/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c
+++ b/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c
@@ -242,7 +242,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_data(writer, measurement);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h b/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h
index 3a80904c8..494418261 100644
--- a/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h
+++ b/src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_simple_comp_evid tcg_pts_attr_simple_comp_evid
- * @{ @ingroup tcg_pts_attr_simple_comp_evid
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_SIMPLE_COMP_EVID_H_
@@ -24,7 +24,7 @@
typedef struct tcg_pts_attr_simple_comp_evid_t tcg_pts_attr_simple_comp_evid_t;
#include "tcg_attr.h"
-#include "pts/components/pts_comp_evidence.h"
+#include "pts/components/pts_comp_evidence.h"
#include "pa_tnc/pa_tnc_attr.h"
/**
@@ -44,12 +44,12 @@ struct tcg_pts_attr_simple_comp_evid_t {
* @return Component Evidence
*/
pts_comp_evidence_t* (*get_comp_evidence)(tcg_pts_attr_simple_comp_evid_t *this);
-
+
};
/**
* Creates an tcg_pts_attr_simple_comp_evid_t object
- *
+ *
* @param evid Component Evidence
*/
pa_tnc_attr_t* tcg_pts_attr_simple_comp_evid_create(pts_comp_evidence_t *evid);
diff --git a/src/libpts/tcg/tcg_pts_attr_simple_evid_final.c b/src/libpts/tcg/tcg_pts_attr_simple_evid_final.c
index 8c76651d6..baadd943f 100644
--- a/src/libpts/tcg/tcg_pts_attr_simple_evid_final.c
+++ b/src/libpts/tcg/tcg_pts_attr_simple_evid_final.c
@@ -194,7 +194,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_data (writer, this->evid_sig);
}
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_simple_evid_final.h b/src/libpts/tcg/tcg_pts_attr_simple_evid_final.h
index 3d98bfce7..6778afbdc 100644
--- a/src/libpts/tcg/tcg_pts_attr_simple_evid_final.h
+++ b/src/libpts/tcg/tcg_pts_attr_simple_evid_final.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_simple_evid_final tcg_pts_attr_simple_evid_final
- * @{ @ingroup tcg_pts_attr_simple_evid_final
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_SIMPLE_EVID_FINAL_H_
@@ -44,27 +44,29 @@ struct tcg_pts_attr_simple_evid_final_t {
* @param comp_hash_algo Optional Composite Hash Algorithm
* @param pcr_comp Optional PCR Composite
* @param tpm_quote sig Optional TPM Quote Signature
- * @return PTS_SIMPLE_EVID_FINAL flags
+ * @return PTS_SIMPLE_EVID_FINAL flags
*/
u_int8_t (*get_quote_info)(tcg_pts_attr_simple_evid_final_t *this,
pts_meas_algorithms_t *comp_hash_algo,
chunk_t *pcr_comp, chunk_t *tpm_quote_sig);
-
+
/**
* Get Optional Evidence Signature
*
- * @evid_sig Optional Evidence Signature
+ * @param evid_sig Optional Evidence Signature
* @return TRUE if Evidence Signature is available
*/
- bool (*get_evid_sig)(tcg_pts_attr_simple_evid_final_t *this, chunk_t *evid_sig);
+ bool (*get_evid_sig)(tcg_pts_attr_simple_evid_final_t *this,
+ chunk_t *evid_sig);
/**
* Set Optional Evidence Signature
*
- * @evid_sig Optional Evidence Signature
+ * @param vid_sig Optional Evidence Signature
*/
- void (*set_evid_sig)(tcg_pts_attr_simple_evid_final_t *this, chunk_t evid_sig);
-
+ void (*set_evid_sig)(tcg_pts_attr_simple_evid_final_t *this,
+ chunk_t evid_sig);
+
};
/**
diff --git a/src/libpts/tcg/tcg_pts_attr_tpm_version_info.c b/src/libpts/tcg/tcg_pts_attr_tpm_version_info.c
index 5143e1676..b776cb662 100644
--- a/src/libpts/tcg/tcg_pts_attr_tpm_version_info.c
+++ b/src/libpts/tcg/tcg_pts_attr_tpm_version_info.c
@@ -110,7 +110,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer = bio_writer_create(PTS_TPM_VER_INFO_SIZE);
writer->write_data(writer, this->tpm_version_info);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_tpm_version_info.h b/src/libpts/tcg/tcg_pts_attr_tpm_version_info.h
index 2c12bb068..4ac18fb9e 100644
--- a/src/libpts/tcg/tcg_pts_attr_tpm_version_info.h
+++ b/src/libpts/tcg/tcg_pts_attr_tpm_version_info.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_tpm_version_info tcg_pts_attr_tpm_version_info
- * @{ @ingroup tcg_pts_attr_tpm_version_info
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_TPM_VERSION_INFO_H_
@@ -36,7 +36,7 @@ struct tcg_pts_attr_tpm_version_info_t {
* Public PA-TNC attribute interface
*/
pa_tnc_attr_t pa_tnc_attribute;
-
+
/**
* Get TPM Version Info
*
@@ -55,7 +55,7 @@ struct tcg_pts_attr_tpm_version_info_t {
/**
* Creates an tcg_pts_attr_tpm_version_info_t object
- *
+ *
* @param tpm_version_info TPM version info
*/
pa_tnc_attr_t* tcg_pts_attr_tpm_version_info_create(chunk_t tpm_version_info);
diff --git a/src/libpts/tcg/tcg_pts_attr_unix_file_meta.c b/src/libpts/tcg/tcg_pts_attr_unix_file_meta.c
index 56686d8ca..f96371b8b 100644
--- a/src/libpts/tcg/tcg_pts_attr_unix_file_meta.c
+++ b/src/libpts/tcg/tcg_pts_attr_unix_file_meta.c
@@ -166,7 +166,7 @@ METHOD(pa_tnc_attr_t, build, void,
}
enumerator->destroy(enumerator);
- this->value = chunk_clone(writer->get_buf(writer));
+ this->value = writer->extract_buf(writer);
writer->destroy(writer);
}
diff --git a/src/libpts/tcg/tcg_pts_attr_unix_file_meta.h b/src/libpts/tcg/tcg_pts_attr_unix_file_meta.h
index 8a594eab5..ad9794b45 100644
--- a/src/libpts/tcg/tcg_pts_attr_unix_file_meta.h
+++ b/src/libpts/tcg/tcg_pts_attr_unix_file_meta.h
@@ -15,7 +15,7 @@
/**
* @defgroup tcg_pts_attr_unix_file_meta tcg_pts_attr_unix_file_meta
- * @{ @ingroup tcg_pts_attr_unix_file_meta
+ * @{ @ingroup tcg_attr
*/
#ifndef TCG_PTS_ATTR_UNIX_FILE_META_H_
@@ -38,19 +38,19 @@ struct tcg_pts_attr_file_meta_t {
* Public PA-TNC attribute interface
*/
pa_tnc_attr_t pa_tnc_attribute;
-
+
/**
* Get PTS File Metadata
*
* @return PTS File Metadata
*/
pts_file_meta_t* (*get_metadata)(tcg_pts_attr_file_meta_t *this);
-
+
};
/**
* Creates an tcg_pts_attr_file_meta_t object
- *
+ *
* @param metadata PTS File Metadata
*/
pa_tnc_attr_t* tcg_pts_attr_unix_file_meta_create(pts_file_meta_t *metadata);