2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
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>.
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
16 #include "tcg_pts_attr_simple_comp_evid.h"
18 #include <pa_tnc/pa_tnc_msg.h>
19 #include <bio/bio_writer.h>
20 #include <bio/bio_reader.h>
23 typedef struct private_tcg_pts_attr_simple_comp_evid_t private_tcg_pts_attr_simple_comp_evid_t
;
26 * Simple Component Evidence
27 * see section 3.15.1 of PTS Protocol: Binding to TNC IF-M Specification
30 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
32 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
33 * | Flags | Sub-Component Depth |
34 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
35 * | Specific Functional Component |
36 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
37 * | Specific Functional Component |
38 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
39 * | Measure. Type | Extended into PCR |
40 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 * | Hash Algorithm | PCR Transform | Reserved |
42 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 * | Measurement Date/Time |
44 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 * | Measurement Date/Time |
46 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
47 * | Measurement Date/Time |
48 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
49 * | Measurement Date/Time |
50 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
51 * | Measurement Date/Time |
52 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
53 * | Optional Policy URI Length | Opt. Verification Policy URI ~
54 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
55 * ~ Optional Verification Policy URI ~
56 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
57 * | Optional PCR Length | Optional PCR Before Value ~
58 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
59 * ~ Optional PCR Before Value (Variable Length) ~
60 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
61 * ~ Optional PCR After Value (Variable Length) ~
62 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
63 * ~ Component Measurement (Variable Length) ~
64 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
68 * Specific Functional Component -> Component Functional Name Structure
69 * see section 5.1 of PTS Protocol: Binding to TNC IF-M Specification
72 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
74 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
75 * | Component Functional Name Vendor ID |Fam| Qualifier |
76 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
77 * | Component Functional Name |
78 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
83 * Qualifier for Functional Component
84 * see section 5.2 of PTS Protocol: Binding to TNC IF-M Specification
95 #define PTS_SIMPLE_COMP_EVID_SIZE 40
96 #define PTS_SIMPLE_COMP_EVID_MEASUREMENT_TIME_SIZE 20
97 #define PTS_SIMPLE_COMP_EVID_RESERVED 0x00
98 #define PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM 0x00
101 * Private data of an tcg_pts_attr_simple_comp_evid_t object.
103 struct private_tcg_pts_attr_simple_comp_evid_t
{
106 * Public members of tcg_pts_attr_simple_comp_evid_t
108 tcg_pts_attr_simple_comp_evid_t
public;
111 * Attribute vendor ID
131 * Set of flags for Simple Component Evidence
133 pts_attr_simple_comp_evid_flag_t flags
;
136 * Sub-component Depth
141 * Component Functional Name Vendor ID
143 u_int32_t comp_vendor_id
;
146 * Functional Name Encoding Family
151 * Functional Name Category Qualifier
153 tcg_pts_qualifier_t qualifier
;
156 * Component Functional Name
158 pts_attr_req_funct_comp_name_bin_enum_t name
;
163 u_int8_t measurement_type
;
166 * Which PCR the functional component is extended into
168 u_int32_t extended_pcr
;
173 pts_meas_algorithms_t hash_algorithm
;
176 * Transformation type for PCR
178 pts_attr_simple_comp_evid_pcr_transform_t transformation
;
183 chunk_t measurement_time
;
186 * Optional Policy URI
191 * Optional PCR before value
196 * Optional PCR after value
201 * Component Measurement
207 METHOD(pa_tnc_attr_t
, get_vendor_id
, pen_t
,
208 private_tcg_pts_attr_simple_comp_evid_t
*this)
210 return this->vendor_id
;
213 METHOD(pa_tnc_attr_t
, get_type
, u_int32_t
,
214 private_tcg_pts_attr_simple_comp_evid_t
*this)
219 METHOD(pa_tnc_attr_t
, get_value
, chunk_t
,
220 private_tcg_pts_attr_simple_comp_evid_t
*this)
225 METHOD(pa_tnc_attr_t
, get_noskip_flag
, bool,
226 private_tcg_pts_attr_simple_comp_evid_t
*this)
228 return this->noskip_flag
;
231 METHOD(pa_tnc_attr_t
, set_noskip_flag
,void,
232 private_tcg_pts_attr_simple_comp_evid_t
*this, bool noskip
)
234 this->noskip_flag
= noskip
;
237 METHOD(pa_tnc_attr_t
, build
, void,
238 private_tcg_pts_attr_simple_comp_evid_t
*this)
240 bio_writer_t
*writer
;
242 u_int8_t qualifier
= 0;
243 u_int16_t algorithm
= 0;
245 writer
= bio_writer_create(PTS_SIMPLE_COMP_EVID_SIZE
);
247 /* Determine the flags to set*/
248 if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_PCR
)
252 if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_NO_VER
)
256 else if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL
)
260 else if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS
)
265 writer
->write_uint8(writer
, flags
);
267 writer
->write_uint24 (writer
, this->depth
);
268 writer
->write_uint24 (writer
, this->comp_vendor_id
);
270 if (this->family
!= PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM
)
272 DBG1(DBG_TNC
, "Functional Name Encoding Family is not set to 00");
275 qualifier
+= this->qualifier
.type
;
276 if (this->qualifier
.kernel
)
280 if (this->qualifier
.sub_component
)
285 /* Unknown or Wildcard should not be used for Qualification*/
286 if (!qualifier
|| qualifier
== 63)
288 DBG1(DBG_TNC
, "Unknown or Wildcard should not be used for"
289 " Functional Name Qualifier");
292 writer
->write_uint8 (writer
, qualifier
);
293 writer
->write_uint32 (writer
, this->name
);
295 writer
->write_uint8 (writer
, (this->measurement_type
<< 7));
296 writer
->write_uint24 (writer
, this->extended_pcr
);
298 /* Determine the hash algorithm to set*/
299 if (this->hash_algorithm
& PTS_MEAS_ALGO_SHA384
)
303 else if (this->hash_algorithm
& PTS_MEAS_ALGO_SHA256
)
307 else if (this->hash_algorithm
& PTS_MEAS_ALGO_SHA1
)
311 writer
->write_uint16(writer
, algorithm
);
313 writer
->write_uint8 (writer
, this->transformation
);
314 writer
->write_data (writer
, this->measurement_time
);
316 /* Optional fields */
317 if (this->policy_uri
.ptr
&& this->policy_uri
.len
> 0)
319 writer
->write_uint16 (writer
, this->policy_uri
.len
);
320 writer
->write_data (writer
, this->policy_uri
);
322 if (this->pcr_before
.ptr
&& this->pcr_after
.ptr
&&
323 this->pcr_before
.len
== this->pcr_after
.len
&&
324 this->pcr_before
.len
> 0 && this->pcr_after
.len
> 0)
326 writer
->write_uint16 (writer
, this->pcr_before
.len
);
327 writer
->write_data (writer
, this->pcr_before
);
328 writer
->write_data (writer
, this->pcr_after
);
331 writer
->write_data (writer
, this->measurement
);
333 this->value
= chunk_clone(writer
->get_buf(writer
));
334 writer
->destroy(writer
);
337 METHOD(pa_tnc_attr_t
, process
, status_t
,
338 private_tcg_pts_attr_simple_comp_evid_t
*this, u_int32_t
*offset
)
340 bio_reader_t
*reader
;
342 u_int8_t fam_and_qualifier
;
343 u_int8_t measurement_type
;
345 u_int8_t transformation
;
346 u_int32_t measurement_len
;
348 if (this->value
.len
< PTS_SIMPLE_COMP_EVID_SIZE
)
350 DBG1(DBG_TNC
, "insufficient data for Simple Component Evidence");
354 reader
= bio_reader_create(this->value
);
356 reader
->read_uint8(reader
, &flags
);
358 /* Determine the flags to set*/
359 if ((flags
>> 7) & 1)
361 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_PCR
;
363 if (!((flags
>> 6) & 1) && !((flags
>> 5) & 1))
365 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_NO_VALID
;
367 else if (!((flags
>> 6) & 1) && ((flags
>> 5) & 1))
369 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_NO_VER
;
371 else if (((flags
>> 6) & 1) && !((flags
>> 5) & 1))
373 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL
;
375 else if (((flags
>> 6) & 1) && ((flags
>> 5) & 1))
377 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS
;
380 reader
->read_uint24(reader
, &this->depth
);
381 reader
->read_uint24(reader
, &this->comp_vendor_id
);
382 reader
->read_uint8(reader
, &fam_and_qualifier
);
384 if (((fam_and_qualifier
>> 6) & 1) )
388 if (((fam_and_qualifier
>> 7) & 1) )
393 /* TODO: Generate an IF-M error attribute indicating */
394 /* TCG_PTS_INVALID_NAME_FAM */
395 //if(&this->comp_vendor_id==PEN_TCG && this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM)
397 // DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00");
400 if (((fam_and_qualifier
>> 5) & 1) )
402 this->qualifier
.kernel
= true;
404 if (((fam_and_qualifier
>> 4) & 1) )
406 this->qualifier
.sub_component
= true;
408 this->qualifier
.type
= ( fam_and_qualifier
& 0xF );
409 /* TODO: Check the type is defined in pts_attr_req_funct_comp_type_t */
411 /* Unknown or Wildcard should not be used for Qualification*/
412 if (!(fam_and_qualifier
& 0x3F) || (fam_and_qualifier
& 0x3F) == 0x3F)
414 DBG1(DBG_TNC
, "Unknown or Wildcard should not be used for"
415 " Functional Name Qualifier");
418 reader
->read_uint32(reader
, &this->name
);
419 /* TODO: Check the name is defined in pts_attr_req_funct_comp_name_bin_enum_t */
421 reader
->read_uint8(reader
, &measurement_type
);
422 this->measurement_type
= (measurement_type
>> 7 ) & 1;
424 reader
->read_uint24(reader
, &this->extended_pcr
);
425 reader
->read_uint16(reader
, &algorithm
);
427 if ((algorithm
>> 13) & 1)
429 this->hash_algorithm
= PTS_MEAS_ALGO_SHA384
;
431 else if ((algorithm
>> 14) & 1)
433 this->hash_algorithm
= PTS_MEAS_ALGO_SHA256
;
435 else if ((algorithm
>> 15) & 1)
437 this->hash_algorithm
= PTS_MEAS_ALGO_SHA1
;
440 reader
->read_uint8(reader
, &transformation
);
441 this->transformation
= transformation
;
442 /* TODO: Check the transformation is defined in pts_attr_simple_comp_evid_pcr_transform_t */
444 reader
->read_data(reader
, PTS_SIMPLE_COMP_EVID_MEASUREMENT_TIME_SIZE
,
445 &this->measurement_time
);
447 /* Optional Policy URI field is included */
448 if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL
||
449 this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS
)
451 u_int16_t policy_uri_len
;
452 reader
->read_uint16(reader
, &policy_uri_len
);
453 reader
->read_data(reader
, policy_uri_len
, &this->policy_uri
);
456 /* Optional PCR value fields are included */
457 if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_PCR
)
459 u_int16_t pcr_value_len
;
460 reader
->read_uint16(reader
, &pcr_value_len
);
461 reader
->read_data(reader
, pcr_value_len
, &this->pcr_before
);
462 reader
->read_data(reader
, pcr_value_len
, &this->pcr_after
);
465 measurement_len
= reader
->remaining(reader
);
466 reader
->read_data(reader
, measurement_len
, &this->measurement
);
468 reader
->destroy(reader
);
472 METHOD(pa_tnc_attr_t
, destroy
, void,
473 private_tcg_pts_attr_simple_comp_evid_t
*this)
475 free(this->value
.ptr
);
476 free(this->measurement_time
.ptr
);
477 free(this->policy_uri
.ptr
);
478 free(this->pcr_before
.ptr
);
479 free(this->pcr_after
.ptr
);
480 free(this->measurement
.ptr
);
484 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_flags
, pts_attr_simple_comp_evid_flag_t
,
485 private_tcg_pts_attr_simple_comp_evid_t
*this)
490 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_flags
, void,
491 private_tcg_pts_attr_simple_comp_evid_t
*this, pts_attr_simple_comp_evid_flag_t flags
)
496 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_sub_component_depth
, u_int32_t
,
497 private_tcg_pts_attr_simple_comp_evid_t
*this)
502 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_spec_comp_funct_name_vendor_id
, u_int32_t
,
503 private_tcg_pts_attr_simple_comp_evid_t
*this)
505 return this->comp_vendor_id
;
508 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_family
, u_int8_t
,
509 private_tcg_pts_attr_simple_comp_evid_t
*this)
514 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_qualifier
, tcg_pts_qualifier_t
,
515 private_tcg_pts_attr_simple_comp_evid_t
*this)
517 return this->qualifier
;
520 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_qualifier
, void,
521 private_tcg_pts_attr_simple_comp_evid_t
*this,
522 tcg_pts_qualifier_t qualifier
)
524 this->qualifier
= qualifier
;
527 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_comp_funct_name
, pts_attr_req_funct_comp_name_bin_enum_t
,
528 private_tcg_pts_attr_simple_comp_evid_t
*this)
533 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_comp_funct_name
, void,
534 private_tcg_pts_attr_simple_comp_evid_t
*this, pts_attr_req_funct_comp_name_bin_enum_t name
)
539 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_measurement_type
, u_int8_t
,
540 private_tcg_pts_attr_simple_comp_evid_t
*this)
542 return this->measurement_type
;
545 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_extended_pcr
, u_int32_t
,
546 private_tcg_pts_attr_simple_comp_evid_t
*this)
548 return this->extended_pcr
;
551 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_extended_pcr
, void,
552 private_tcg_pts_attr_simple_comp_evid_t
*this, u_int32_t extended_pcr
)
554 this->extended_pcr
= extended_pcr
;
557 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_hash_algorithm
, pts_meas_algorithms_t
,
558 private_tcg_pts_attr_simple_comp_evid_t
*this)
560 return this->hash_algorithm
;
563 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_hash_algorithm
, void,
564 private_tcg_pts_attr_simple_comp_evid_t
*this, pts_meas_algorithms_t hash_algorithm
)
566 this->hash_algorithm
= hash_algorithm
;
569 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_pcr_trans
, pts_attr_simple_comp_evid_pcr_transform_t
,
570 private_tcg_pts_attr_simple_comp_evid_t
*this)
572 return this->transformation
;
575 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_pcr_trans
, void,
576 private_tcg_pts_attr_simple_comp_evid_t
*this, pts_attr_simple_comp_evid_pcr_transform_t transformation
)
578 this->transformation
= transformation
;
581 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_measurement_time
, chunk_t
,
582 private_tcg_pts_attr_simple_comp_evid_t
*this)
584 return this->measurement_time
;
587 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_measurement_time
, void,
588 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t measurement_time
)
590 this->measurement_time
= measurement_time
;
593 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_policy_uri
, chunk_t
,
594 private_tcg_pts_attr_simple_comp_evid_t
*this)
596 return this->policy_uri
;
599 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_policy_uri
, void,
600 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t policy_uri
)
602 this->policy_uri
= policy_uri
;
605 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_pcr_before_value
, chunk_t
,
606 private_tcg_pts_attr_simple_comp_evid_t
*this)
608 return this->pcr_before
;
611 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_pcr_before_value
, void,
612 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t pcr_before
)
614 this->pcr_before
= pcr_before
;
617 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_pcr_after_value
, chunk_t
,
618 private_tcg_pts_attr_simple_comp_evid_t
*this)
620 return this->pcr_after
;
623 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_pcr_after_value
, void,
624 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t pcr_after
)
626 this->pcr_after
= pcr_after
;
629 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_pcr_len
, u_int16_t
,
630 private_tcg_pts_attr_simple_comp_evid_t
*this)
632 if(this->pcr_before
.ptr
&& this->pcr_after
.ptr
&&
633 this->pcr_before
.len
== this->pcr_after
.len
&&
634 this->pcr_before
.len
> 0 && this->pcr_after
.len
> 0)
635 return this->pcr_before
.len
;
639 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_comp_measurement
, chunk_t
,
640 private_tcg_pts_attr_simple_comp_evid_t
*this)
642 return this->measurement
;
645 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_comp_measurement
, void,
646 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t measurement
)
648 this->measurement
= measurement
;
652 * Described in header.
654 pa_tnc_attr_t
*tcg_pts_attr_simple_comp_evid_create(
655 pts_attr_simple_comp_evid_flag_t flags
,
658 tcg_pts_qualifier_t qualifier
,
659 pts_attr_req_funct_comp_name_bin_enum_t name
,
660 u_int32_t extended_pcr
,
661 pts_meas_algorithms_t hash_algorithm
,
662 pts_attr_simple_comp_evid_pcr_transform_t transformation
,
663 chunk_t measurement_time
,
669 private_tcg_pts_attr_simple_comp_evid_t
*this;
673 .pa_tnc_attribute
= {
674 .get_vendor_id
= _get_vendor_id
,
675 .get_type
= _get_type
,
676 .get_value
= _get_value
,
677 .get_noskip_flag
= _get_noskip_flag
,
678 .set_noskip_flag
= _set_noskip_flag
,
683 .get_flags
= _get_flags
,
684 .set_flags
= _set_flags
,
685 .get_sub_component_depth
= _get_sub_component_depth
,
686 .get_spec_comp_funct_name_vendor_id
= _get_spec_comp_funct_name_vendor_id
,
687 .get_family
= _get_family
,
688 .get_qualifier
= _get_qualifier
,
689 .set_qualifier
= _set_qualifier
,
690 .get_comp_funct_name
= _get_comp_funct_name
,
691 .set_comp_funct_name
= _set_comp_funct_name
,
692 .get_measurement_type
= _get_measurement_type
,
693 .get_extended_pcr
= _get_extended_pcr
,
694 .set_extended_pcr
= _set_extended_pcr
,
695 .get_hash_algorithm
= _get_hash_algorithm
,
696 .set_hash_algorithm
= _set_hash_algorithm
,
697 .get_pcr_trans
= _get_pcr_trans
,
698 .set_pcr_trans
= _set_pcr_trans
,
699 .get_measurement_time
= _get_measurement_time
,
700 .set_measurement_time
= _set_measurement_time
,
701 .get_policy_uri
= _get_policy_uri
,
702 .set_policy_uri
= _set_policy_uri
,
703 .get_pcr_before_value
= _get_pcr_before_value
,
704 .set_pcr_before_value
= _set_pcr_before_value
,
705 .get_pcr_after_value
= _get_pcr_after_value
,
706 .set_pcr_after_value
= _set_pcr_after_value
,
707 .get_pcr_len
= _get_pcr_len
,
708 .get_comp_measurement
= _get_comp_measurement
,
709 .set_comp_measurement
= _set_comp_measurement
,
711 .vendor_id
= PEN_TCG
,
712 .type
= TCG_PTS_SIMPLE_COMP_EVID
,
715 .comp_vendor_id
= vendor_id
,
716 .family
= PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM
,
717 .qualifier
= qualifier
,
719 .extended_pcr
= extended_pcr
,
720 .hash_algorithm
= hash_algorithm
,
721 .transformation
= transformation
,
722 .measurement_time
= measurement_time
,
723 .policy_uri
= policy_uri
,
724 .pcr_before
= pcr_before
,
725 .pcr_after
= pcr_after
,
726 .measurement
= measurement
,
729 return &this->public.pa_tnc_attribute
;
734 * Described in header.
736 pa_tnc_attr_t
*tcg_pts_attr_simple_comp_evid_create_from_data(chunk_t data
)
738 private_tcg_pts_attr_simple_comp_evid_t
*this;
742 .pa_tnc_attribute
= {
743 .get_vendor_id
= _get_vendor_id
,
744 .get_type
= _get_type
,
745 .get_value
= _get_value
,
746 .get_noskip_flag
= _get_noskip_flag
,
747 .set_noskip_flag
= _set_noskip_flag
,
752 .get_flags
= _get_flags
,
753 .set_flags
= _set_flags
,
754 .get_sub_component_depth
= _get_sub_component_depth
,
755 .get_spec_comp_funct_name_vendor_id
= _get_spec_comp_funct_name_vendor_id
,
756 .get_family
= _get_family
,
757 .get_qualifier
= _get_qualifier
,
758 .set_qualifier
= _set_qualifier
,
759 .get_comp_funct_name
= _get_comp_funct_name
,
760 .set_comp_funct_name
= _set_comp_funct_name
,
761 .get_measurement_type
= _get_measurement_type
,
762 .get_extended_pcr
= _get_extended_pcr
,
763 .set_extended_pcr
= _set_extended_pcr
,
764 .get_hash_algorithm
= _get_hash_algorithm
,
765 .set_hash_algorithm
= _set_hash_algorithm
,
766 .get_pcr_trans
= _get_pcr_trans
,
767 .set_pcr_trans
= _set_pcr_trans
,
768 .get_measurement_time
= _get_measurement_time
,
769 .set_measurement_time
= _set_measurement_time
,
770 .get_policy_uri
= _get_policy_uri
,
771 .set_policy_uri
= _set_policy_uri
,
772 .get_pcr_before_value
= _get_pcr_before_value
,
773 .set_pcr_before_value
= _set_pcr_before_value
,
774 .get_pcr_after_value
= _get_pcr_after_value
,
775 .set_pcr_after_value
= _set_pcr_after_value
,
776 .get_pcr_len
= _get_pcr_len
,
777 .get_comp_measurement
= _get_comp_measurement
,
778 .set_comp_measurement
= _set_comp_measurement
,
780 .vendor_id
= PEN_TCG
,
781 .type
= TCG_PTS_SIMPLE_COMP_EVID
,
782 .value
= chunk_clone(data
),
785 return &this->public.pa_tnc_attribute
;