Added add_segment() method to TCG/PTS attributes
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 5 Oct 2014 17:43:27 +0000 (19:43 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 5 Oct 2014 17:43:27 +0000 (19:43 +0200)
18 files changed:
src/libimcv/seg/seg_env.c
src/libimcv/tcg/pts/tcg_pts_attr_aik.c
src/libimcv/tcg/pts/tcg_pts_attr_dh_nonce_finish.c
src/libimcv/tcg/pts/tcg_pts_attr_dh_nonce_params_req.c
src/libimcv/tcg/pts/tcg_pts_attr_dh_nonce_params_resp.c
src/libimcv/tcg/pts/tcg_pts_attr_file_meas.c
src/libimcv/tcg/pts/tcg_pts_attr_gen_attest_evid.c
src/libimcv/tcg/pts/tcg_pts_attr_get_aik.c
src/libimcv/tcg/pts/tcg_pts_attr_get_tpm_version_info.c
src/libimcv/tcg/pts/tcg_pts_attr_meas_algo.c
src/libimcv/tcg/pts/tcg_pts_attr_proto_caps.c
src/libimcv/tcg/pts/tcg_pts_attr_req_file_meas.c
src/libimcv/tcg/pts/tcg_pts_attr_req_file_meta.c
src/libimcv/tcg/pts/tcg_pts_attr_req_func_comp_evid.c
src/libimcv/tcg/pts/tcg_pts_attr_simple_comp_evid.c
src/libimcv/tcg/pts/tcg_pts_attr_simple_evid_final.c
src/libimcv/tcg/pts/tcg_pts_attr_tpm_version_info.c
src/libimcv/tcg/pts/tcg_pts_attr_unix_file_meta.c

index b961589..c47ce29 100644 (file)
@@ -171,11 +171,6 @@ METHOD(seg_env_t, add_segment, bool,
        chunk_t msg_info;
        status_t status;
 
-       /* not all attributes might have implemented the add_segment method */
-       if (!this->base_attr->add_segment)
-       {
-               return FALSE;
-       }
        this->base_attr->add_segment(this->base_attr, segment);
        status = this->base_attr->process(this->base_attr, &attr_offset);
 
index ad1ad7e..194cf1b 100644 (file)
@@ -173,6 +173,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_aik_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_aik_t *this)
 {
@@ -213,6 +219,7 @@ pa_tnc_attr_t *tcg_pts_attr_aik_create(certificate_t *aik)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -243,6 +250,7 @@ pa_tnc_attr_t *tcg_pts_attr_aik_create_from_data(size_t length, chunk_t data)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 8a09720..2a15068 100644 (file)
@@ -172,6 +172,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_dh_nonce_finish_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_dh_nonce_finish_t *this)
 {
@@ -228,6 +234,7 @@ pa_tnc_attr_t *tcg_pts_attr_dh_nonce_finish_create(
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -262,6 +269,7 @@ pa_tnc_attr_t *tcg_pts_attr_dh_nonce_finish_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 6ad3157..0349ce5 100644 (file)
@@ -156,6 +156,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_dh_nonce_params_req_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_dh_nonce_params_req_t *this)
 {
@@ -202,6 +208,7 @@ pa_tnc_attr_t *tcg_pts_attr_dh_nonce_params_req_create(u_int8_t min_nonce_len,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -234,6 +241,7 @@ pa_tnc_attr_t *tcg_pts_attr_dh_nonce_params_req_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 9dfc81f..fa1dbdd 100644 (file)
@@ -182,6 +182,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_dh_nonce_params_resp_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_dh_nonce_params_resp_t *this)
 {
@@ -244,6 +250,7 @@ pa_tnc_attr_t *tcg_pts_attr_dh_nonce_params_resp_create(pts_dh_group_t dh_group,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -280,6 +287,7 @@ pa_tnc_attr_t *tcg_pts_attr_dh_nonce_params_resp_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 723f8f5..7ab444e 100644 (file)
@@ -224,6 +224,12 @@ end:
        return status;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_file_meas_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_file_meas_t *this)
 {
@@ -263,6 +269,7 @@ pa_tnc_attr_t *tcg_pts_attr_file_meas_create(pts_file_meas_t *measurements)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -294,6 +301,7 @@ pa_tnc_attr_t *tcg_pts_attr_file_meas_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index d724819..b7b4d7e 100644 (file)
@@ -141,6 +141,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_gen_attest_evid_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_gen_attest_evid_t *this)
 {
@@ -174,6 +180,7 @@ pa_tnc_attr_t *tcg_pts_attr_gen_attest_evid_create()
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -203,6 +210,7 @@ pa_tnc_attr_t *tcg_pts_attr_gen_attest_evid_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index ed98197..8fda2b1 100644 (file)
@@ -114,6 +114,12 @@ METHOD(pa_tnc_attr_t, build, void,
        writer->destroy(writer);
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_get_aik_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, process, status_t,
        private_tcg_pts_attr_get_aik_t *this, u_int32_t *offset)
 {
@@ -171,6 +177,7 @@ pa_tnc_attr_t *tcg_pts_attr_get_aik_create()
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -200,6 +207,7 @@ pa_tnc_attr_t *tcg_pts_attr_get_aik_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index c922f2f..a4c9dba 100644 (file)
@@ -141,6 +141,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_get_tpm_version_info_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_get_tpm_version_info_t *this)
 {
@@ -174,6 +180,7 @@ pa_tnc_attr_t *tcg_pts_attr_get_tpm_version_info_create()
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -203,6 +210,7 @@ pa_tnc_attr_t *tcg_pts_attr_get_tpm_version_info_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 4445079..8b0502a 100644 (file)
@@ -146,14 +146,10 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
-METHOD(pa_tnc_attr_t, destroy, void,
-       private_tcg_pts_attr_meas_algo_t *this)
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_meas_algo_t *this, chunk_t segment)
 {
-       if (ref_put(&this->ref))
-       {
-               free(this->value.ptr);
-               free(this);
-       }
+       this->value = chunk_cat("mc", this->value, segment);
 }
 
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
@@ -163,6 +159,16 @@ METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        return &this->public.pa_tnc_attribute;
 }
 
+METHOD(pa_tnc_attr_t, destroy, void,
+       private_tcg_pts_attr_meas_algo_t *this)
+{
+       if (ref_put(&this->ref))
+       {
+               free(this->value.ptr);
+               free(this);
+       }
+}
+
 METHOD(tcg_pts_attr_meas_algo_t, get_algorithms, pts_meas_algorithms_t,
        private_tcg_pts_attr_meas_algo_t *this)
 {
@@ -186,6 +192,7 @@ pa_tnc_attr_t *tcg_pts_attr_meas_algo_create(pts_meas_algorithms_t algorithms,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -219,6 +226,7 @@ pa_tnc_attr_t *tcg_pts_attr_meas_algo_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 501e24d..0a562c0 100644 (file)
@@ -148,14 +148,10 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
-METHOD(pa_tnc_attr_t, destroy, void,
-       private_tcg_pts_attr_proto_caps_t *this)
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_proto_caps_t *this, chunk_t segment)
 {
-       if (ref_put(&this->ref))
-       {
-               free(this->value.ptr);
-               free(this);
-       }
+       this->value = chunk_cat("mc", this->value, segment);
 }
 
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
@@ -165,6 +161,16 @@ METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        return &this->public.pa_tnc_attribute;
 }
 
+METHOD(pa_tnc_attr_t, destroy, void,
+       private_tcg_pts_attr_proto_caps_t *this)
+{
+       if (ref_put(&this->ref))
+       {
+               free(this->value.ptr);
+               free(this);
+       }
+}
+
 METHOD(tcg_pts_attr_proto_caps_t, get_flags, pts_proto_caps_flag_t,
        private_tcg_pts_attr_proto_caps_t *this)
 {
@@ -188,6 +194,7 @@ pa_tnc_attr_t *tcg_pts_attr_proto_caps_create(pts_proto_caps_flag_t flags,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -220,6 +227,7 @@ pa_tnc_attr_t *tcg_pts_attr_proto_caps_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index c4d192c..a3c3ce5 100644 (file)
@@ -190,6 +190,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_req_file_meas_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_req_file_meas_t *this)
 {
@@ -251,6 +257,7 @@ pa_tnc_attr_t *tcg_pts_attr_req_file_meas_create(bool directory_flag,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -288,6 +295,7 @@ pa_tnc_attr_t *tcg_pts_attr_req_file_meas_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index dffce9a..f6befa8 100644 (file)
@@ -182,6 +182,19 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_req_file_meta_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+       private_tcg_pts_attr_req_file_meta_t *this)
+{
+       ref_get(&this->ref);
+       return &this->public.pa_tnc_attribute;
+}
+
 METHOD(pa_tnc_attr_t, destroy, void,
        private_tcg_pts_attr_req_file_meta_t *this)
 {
@@ -193,13 +206,6 @@ METHOD(pa_tnc_attr_t, destroy, void,
        }
 }
 
-METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
-       private_tcg_pts_attr_req_file_meta_t *this)
-{
-       ref_get(&this->ref);
-       return &this->public.pa_tnc_attribute;
-}
-
 METHOD(tcg_pts_attr_req_file_meta_t, get_directory_flag, bool,
        private_tcg_pts_attr_req_file_meta_t *this)
 {
@@ -236,6 +242,7 @@ pa_tnc_attr_t *tcg_pts_attr_req_file_meta_create(bool directory_flag,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -271,6 +278,7 @@ pa_tnc_attr_t *tcg_pts_attr_req_file_meta_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 6069488..0389110 100644 (file)
@@ -271,6 +271,12 @@ end:
        return status;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_req_func_comp_evid_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_req_func_comp_evid_t *this)
 {
@@ -331,6 +337,7 @@ pa_tnc_attr_t *tcg_pts_attr_req_func_comp_evid_create(void)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -363,6 +370,7 @@ pa_tnc_attr_t *tcg_pts_attr_req_func_comp_evid_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 189fb0f..d94ee89 100644 (file)
@@ -438,6 +438,12 @@ end:
        return status;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_simple_comp_evid_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_simple_comp_evid_t *this)
 {
@@ -478,6 +484,7 @@ pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create(pts_comp_evidence_t *evid)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -509,6 +516,7 @@ pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 119d342..cfeaec6 100644 (file)
@@ -132,6 +132,12 @@ METHOD(pa_tnc_attr_t, get_noskip_flag, bool,
        return this->noskip_flag;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_simple_evid_final_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, set_noskip_flag,void,
        private_tcg_pts_attr_simple_evid_final_t *this, bool noskip)
 {
@@ -344,6 +350,7 @@ pa_tnc_attr_t *tcg_pts_attr_simple_evid_final_create(u_int8_t flags,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -380,6 +387,7 @@ pa_tnc_attr_t *tcg_pts_attr_simple_evid_final_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index 5fa4db0..db877e9 100644 (file)
@@ -145,6 +145,12 @@ METHOD(pa_tnc_attr_t, process, status_t,
        return SUCCESS;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_tpm_version_info_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_tpm_version_info_t *this)
 {
@@ -192,6 +198,7 @@ pa_tnc_attr_t *tcg_pts_attr_tpm_version_info_create(chunk_t tpm_version_info)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -224,6 +231,7 @@ pa_tnc_attr_t *tcg_pts_attr_tpm_version_info_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
index c8c2708..7c176fd 100644 (file)
@@ -278,6 +278,12 @@ end:
        return status;
 }
 
+METHOD(pa_tnc_attr_t, add_segment, void,
+       private_tcg_pts_attr_file_meta_t *this, chunk_t segment)
+{
+       this->value = chunk_cat("mc", this->value, segment);
+}
+
 METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
        private_tcg_pts_attr_file_meta_t *this)
 {
@@ -318,6 +324,7 @@ pa_tnc_attr_t *tcg_pts_attr_unix_file_meta_create(pts_file_meta_t *metadata)
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
@@ -349,6 +356,7 @@ pa_tnc_attr_t *tcg_pts_attr_unix_file_meta_create_from_data(size_t length,
                                .set_noskip_flag = _set_noskip_flag,
                                .build = _build,
                                .process = _process,
+                               .add_segment = _add_segment,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },