* List of Port Filter entries
*/
linked_list_t *ports;
+
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_ietf_attr_port_filter_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_ietf_attr_port_filter_t *this)
{
- this->ports->destroy_function(this->ports, free);
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ this->ports->destroy_function(this->ports, free);
+ free(this->value.ptr);
+ free(this);
+ }
}
METHOD(ietf_attr_port_filter_t, add_port, void,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.add_port = _add_port,
.vendor_id = PEN_IETF,
.type = IETF_ATTR_PORT_FILTER,
.ports = linked_list_create(),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.get_value = _get_value,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.add_port = _add_port,
.type = IETF_ATTR_PORT_FILTER,
.value = chunk_clone(data),
.ports = linked_list_create(),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
char *product_name;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_ietf_attr_product_info_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_ietf_attr_product_info_t *this)
{
- free(this->product_name);
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->product_name);
+ free(this->value.ptr);
+ free(this);
+ }
}
METHOD(ietf_attr_product_info_t, get_info, char*,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_info = _get_info,
.product_vendor_id = vendor_id,
.product_id = id,
.product_name = strdup(name),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.get_value = _get_value,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_info = _get_info,
.vendor_id = PEN_IETF,
.type = IETF_ATTR_PRODUCT_INFORMATION,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
* AIK Certificate or Public Key
*/
certificate_t *aik;
+
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_aik_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_aik_t *this)
{
- DESTROY_IF(this->aik);
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ DESTROY_IF(this->aik);
+ free(this->value.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_aik_t, get_aik, certificate_t*,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_aik = _get_aik,
.vendor_id = PEN_TCG,
.type = TCG_PTS_AIK,
.aik = aik->get_ref(aik),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_aik = _get_aik,
.vendor_id = PEN_TCG,
.type = TCG_PTS_AIK,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
* DH Initiator Nonce
*/
chunk_t initiator_nonce;
+
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_dh_nonce_finish_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_dh_nonce_finish_t *this)
{
- free(this->value.ptr);
- free(this->initiator_value.ptr);
- free(this->initiator_nonce.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this->initiator_value.ptr);
+ free(this->initiator_nonce.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_dh_nonce_finish_t, get_hash_algo, pts_meas_algorithms_t,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_hash_algo = _get_hash_algo,
.hash_algo = hash_algo,
.initiator_value = initiator_value,
.initiator_nonce = chunk_clone(initiator_nonce),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_hash_algo = _get_hash_algo,
.vendor_id = PEN_TCG,
.type = TCG_PTS_DH_NONCE_FINISH,
.value = chunk_clone(value),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
pts_dh_group_t dh_groups;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_dh_nonce_params_req_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_dh_nonce_params_req_t *this)
{
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_dh_nonce_params_req_t, get_min_nonce_len, u_int8_t,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_min_nonce_len = _get_min_nonce_len,
.type = TCG_PTS_DH_NONCE_PARAMS_REQ,
.min_nonce_len = min_nonce_len,
.dh_groups = dh_groups,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_min_nonce_len = _get_min_nonce_len,
.vendor_id = PEN_TCG,
.type = TCG_PTS_DH_NONCE_PARAMS_REQ,
.value = chunk_clone(value),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
* DH Responder Public Value
*/
chunk_t responder_value;
-
+
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_dh_nonce_params_resp_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_dh_nonce_params_resp_t *this)
{
- free(this->value.ptr);
- free(this->responder_nonce.ptr);
- free(this->responder_value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this->responder_nonce.ptr);
+ free(this->responder_value.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_dh_nonce_params_resp_t, get_dh_group, pts_dh_group_t,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_dh_group = _get_dh_group,
.hash_algo_set = hash_algo_set,
.responder_nonce = chunk_clone(responder_nonce),
.responder_value = responder_value,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_dh_group = _get_dh_group,
.vendor_id = PEN_TCG,
.type = TCG_PTS_DH_NONCE_PARAMS_RESP,
.value = chunk_clone(value),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
pts_file_meas_t *measurements;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return status;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_file_meas_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_file_meas_t *this)
{
- this->measurements->destroy(this->measurements);
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ this->measurements->destroy(this->measurements);
+ free(this->value.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_file_meas_t, get_measurements, pts_file_meas_t*,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_measurements = _get_measurements,
.vendor_id = PEN_TCG,
.type = TCG_PTS_FILE_MEAS,
.measurements = measurements,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_measurements = _get_measurements,
.vendor_id = PEN_TCG,
.type = TCG_PTS_FILE_MEAS,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
* Noskip flag
*/
bool noskip_flag;
+
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_gen_attest_evid_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_gen_attest_evid_t *this)
{
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this);
+ }
}
/**
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
},
.vendor_id = PEN_TCG,
.type = TCG_PTS_GEN_ATTEST_EVID,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
},
.vendor_id = PEN_TCG,
.type = TCG_PTS_GEN_ATTEST_EVID,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
* Noskip flag
*/
bool noskip_flag;
+
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_get_aik_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_get_aik_t *this)
{
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this);
+ }
}
/**
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
},
.vendor_id = PEN_TCG,
.type = TCG_PTS_GET_AIK,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
},
.vendor_id = PEN_TCG,
.type = TCG_PTS_GET_AIK,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
* Noskip flag
*/
bool noskip_flag;
+
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_get_tpm_version_info_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_get_tpm_version_info_t *this)
{
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this);
+ }
}
/**
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
},
.vendor_id = PEN_TCG,
.type = TCG_PTS_GET_TPM_VERSION_INFO,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
},
.vendor_id = PEN_TCG,
.type = TCG_PTS_GET_TPM_VERSION_INFO,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
pts_meas_algorithms_t algorithms;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_meas_algo_t *this)
{
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this);
+ }
+}
+
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_meas_algo_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
}
METHOD(tcg_pts_attr_meas_algo_t, get_algorithms, pts_meas_algorithms_t,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_algorithms = _get_algorithms,
.vendor_id = PEN_TCG,
.type = selection ? TCG_PTS_MEAS_ALGO_SELECTION : TCG_PTS_MEAS_ALGO,
.algorithms = algorithms,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_algorithms = _get_algorithms,
.vendor_id = PEN_TCG,
.type = selection ? TCG_PTS_MEAS_ALGO_SELECTION : TCG_PTS_MEAS_ALGO,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
pts_proto_caps_flag_t flags;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_proto_caps_t *this)
{
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this);
+ }
+}
+
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_proto_caps_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
}
METHOD(tcg_pts_attr_proto_caps_t, get_flags, pts_proto_caps_flag_t,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_flags = _get_flags,
.vendor_id = PEN_TCG,
.type = request ? TCG_PTS_REQ_PROTO_CAPS : TCG_PTS_PROTO_CAPS,
.flags = flags,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_flags = _get_flags,
.vendor_id = PEN_TCG,
.type = request ? TCG_PTS_REQ_PROTO_CAPS : TCG_PTS_PROTO_CAPS,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
char *pathname;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_req_file_meas_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_meas_t *this)
{
- free(this->pathname);
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->pathname);
+ free(this->value.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_req_file_meas_t, get_directory_flag, bool,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_directory_flag = _get_directory_flag,
.request_id = request_id,
.delimiter = delimiter,
.pathname = strdup(pathname),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_directory_flag = _get_directory_flag,
.vendor_id = PEN_TCG,
.type = TCG_PTS_REQ_FILE_MEAS,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
char *pathname;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_req_file_meta_t *this)
{
- free(this->pathname);
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->pathname);
+ free(this->value.ptr);
+ free(this);
+ }
+}
+
+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,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_directory_flag = _get_directory_flag,
.directory_flag = directory_flag,
.delimiter = delimiter,
.pathname = strdup(pathname),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_directory_flag = _get_directory_flag,
.vendor_id = PEN_TCG,
.type = TCG_PTS_REQ_FILE_META,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
* List of Functional Components
*/
linked_list_t *list;
+
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
typedef struct entry_t entry_t;
return status;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_req_func_comp_evid_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_req_func_comp_evid_t *this)
{
- this->list->destroy_function(this->list, (void *)free_entry);
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ this->list->destroy_function(this->list, (void *)free_entry);
+ free(this->value.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_req_func_comp_evid_t, add_component, void,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.add_component = _add_component,
.vendor_id = PEN_TCG,
.type = TCG_PTS_REQ_FUNC_COMP_EVID,
.list = linked_list_create(),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.add_component = _add_component,
.type = TCG_PTS_REQ_FUNC_COMP_EVID,
.list = linked_list_create(),
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
pts_comp_evidence_t *evidence;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return status;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_simple_comp_evid_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
- this->evidence->destroy(this->evidence);
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ this->evidence->destroy(this->evidence);
+ free(this->value.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_evidence, pts_comp_evidence_t*,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_comp_evidence = _get_comp_evidence,
.vendor_id = PEN_TCG,
.type = TCG_PTS_SIMPLE_COMP_EVID,
.evidence = evid,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_comp_evidence = _get_comp_evidence,
.vendor_id = PEN_TCG,
.type = TCG_PTS_SIMPLE_COMP_EVID,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
chunk_t evid_sig;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
this->noskip_flag = noskip;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_simple_evid_final_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_simple_evid_final_t *this)
{
- free(this->value.ptr);
- free(this->pcr_comp.ptr);
- free(this->tpm_quote_sig.ptr);
- free(this->evid_sig.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this->pcr_comp.ptr);
+ free(this->tpm_quote_sig.ptr);
+ free(this->evid_sig.ptr);
+ free(this);
+ }
}
METHOD(pa_tnc_attr_t, build, void,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_quote_info = _get_quote_info,
.comp_hash_algorithm = comp_hash_algorithm,
.pcr_comp = pcr_comp,
.tpm_quote_sig = tpm_quote_sig,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_quote_info = _get_quote_info,
.vendor_id = PEN_TCG,
.type = TCG_PTS_SIMPLE_EVID_FINAL,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
* TPM Version Information
*/
chunk_t tpm_version_info;
+
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return SUCCESS;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_tpm_version_info_t *this)
+{
+ ref_get(&this->ref);
+ return &this->public.pa_tnc_attribute;
+}
+
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_tpm_version_info_t *this)
{
- free(this->value.ptr);
- free(this->tpm_version_info.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ free(this->value.ptr);
+ free(this->tpm_version_info.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_tpm_version_info_t, get_tpm_version_info, chunk_t,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_tpm_version_info = _get_tpm_version_info,
.vendor_id = PEN_TCG,
.type = TCG_PTS_TPM_VERSION_INFO,
.tpm_version_info = chunk_clone(tpm_version_info),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_tpm_version_info = _get_tpm_version_info,
.vendor_id = PEN_TCG,
.type = TCG_PTS_TPM_VERSION_INFO,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
*/
pts_file_meta_t *metadata;
+ /**
+ * Reference count
+ */
+ refcount_t ref;
};
METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
return status;
}
+METHOD(pa_tnc_attr_t, get_ref, pa_tnc_attr_t*,
+ private_tcg_pts_attr_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_file_meta_t *this)
{
- this->metadata->destroy(this->metadata);
- free(this->value.ptr);
- free(this);
+ if (ref_put(&this->ref))
+ {
+ this->metadata->destroy(this->metadata);
+ free(this->value.ptr);
+ free(this);
+ }
}
METHOD(tcg_pts_attr_file_meta_t, get_metadata, pts_file_meta_t*,
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_metadata = _get_metadata,
.vendor_id = PEN_TCG,
.type = TCG_PTS_UNIX_FILE_META,
.metadata = metadata,
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;
.set_noskip_flag = _set_noskip_flag,
.build = _build,
.process = _process,
+ .get_ref = _get_ref,
.destroy = _destroy,
},
.get_metadata = _get_metadata,
.vendor_id = PEN_TCG,
.type = TCG_PTS_UNIX_FILE_META,
.value = chunk_clone(data),
+ .ref = 1,
);
return &this->public.pa_tnc_attribute;