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
31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
32 * | Flags | Sub-Component Depth |
33 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
34 * | Specific Functional Component |
35 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
36 * | Specific Functional Component |
37 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
38 * | Measure. Type | Extended into PCR |
39 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 * | Hash Algorithm | PCR Transform | Reserved |
41 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42 * | Measurement Date/Time |
43 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44 * | Measurement Date/Time |
45 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
46 * | Measurement Date/Time |
47 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
48 * | Measurement Date/Time |
49 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
50 * | Measurement Date/Time |
51 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
52 * | Optional Policy URI Length | Opt. Verification Policy URI ~
53 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
54 * ~ Optional Verification Policy URI ~
55 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
56 * | Optional PCR Length | Optional PCR Before Value ~
57 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
58 * ~ Optional PCR Before Value (Variable Length) ~
59 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
60 * ~ Optional PCR After Value (Variable Length) ~
61 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
62 * ~ Component Measurement (Variable Length) ~
63 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
67 * Specific Functional Component -> Component Functional Name Structure
68 * see section 5.1 of PTS Protocol: Binding to TNC IF-M Specification
71 * 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
72 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
73 * | Component Functional Name Vendor ID |Fam| Qualifier |
74 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
75 * | Component Functional Name |
76 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
81 * Qualifier for Functional Component
82 * see section 5.2 of PTS Protocol: Binding to TNC IF-M Specification
93 #define PTS_SIMPLE_COMP_EVID_SIZE 40
94 #define PTS_SIMPLE_COMP_EVID_MEASUREMENT_TIME_SIZE 20
95 #define PTS_SIMPLE_COMP_EVID_RESERVED 0x00
96 #define PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM 0x00
99 * Private data of an tcg_pts_attr_simple_comp_evid_t object.
101 struct private_tcg_pts_attr_simple_comp_evid_t
{
104 * Public members of tcg_pts_attr_simple_comp_evid_t
106 tcg_pts_attr_simple_comp_evid_t
public;
109 * Attribute vendor ID
129 * Set of flags for Simple Component Evidence
131 pts_attr_simple_comp_evid_flag_t flags
;
134 * Sub-component Depth
139 * Component Functional Name Vendor ID
141 u_int32_t comp_vendor_id
;
144 * Functional Name Encoding Family
149 * Functional Name Category Qualifier
151 tcg_pts_qualifier_t qualifier
;
154 * Component Functional Name
156 pts_attr_req_funct_comp_name_bin_enum_t name
;
161 u_int8_t measurement_type
;
164 * Which PCR the functional component is extended into
166 u_int32_t extended_pcr
;
171 pts_meas_algorithms_t hash_algorithm
;
174 * Transformation type for PCR
176 pts_pcr_transform_t transformation
;
181 chunk_t measurement_time
;
184 * Optional Policy URI
189 * Optional PCR before value
194 * Optional PCR after value
199 * Component Measurement
205 METHOD(pa_tnc_attr_t
, get_vendor_id
, pen_t
,
206 private_tcg_pts_attr_simple_comp_evid_t
*this)
208 return this->vendor_id
;
211 METHOD(pa_tnc_attr_t
, get_type
, u_int32_t
,
212 private_tcg_pts_attr_simple_comp_evid_t
*this)
217 METHOD(pa_tnc_attr_t
, get_value
, chunk_t
,
218 private_tcg_pts_attr_simple_comp_evid_t
*this)
223 METHOD(pa_tnc_attr_t
, get_noskip_flag
, bool,
224 private_tcg_pts_attr_simple_comp_evid_t
*this)
226 return this->noskip_flag
;
229 METHOD(pa_tnc_attr_t
, set_noskip_flag
,void,
230 private_tcg_pts_attr_simple_comp_evid_t
*this, bool noskip
)
232 this->noskip_flag
= noskip
;
235 METHOD(pa_tnc_attr_t
, build
, void,
236 private_tcg_pts_attr_simple_comp_evid_t
*this)
238 bio_writer_t
*writer
;
240 u_int8_t qualifier
= 0;
242 writer
= bio_writer_create(PTS_SIMPLE_COMP_EVID_SIZE
);
244 /* Determine the flags to set*/
245 if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_PCR
)
249 if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_NO_VER
)
253 else if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL
)
257 else if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS
)
262 writer
->write_uint8(writer
, flags
);
264 writer
->write_uint24 (writer
, this->depth
);
265 writer
->write_uint24 (writer
, this->comp_vendor_id
);
267 if (this->family
!= PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM
)
269 DBG1(DBG_TNC
, "Functional Name Encoding Family is not set to 00");
272 qualifier
+= this->qualifier
.type
;
273 if (this->qualifier
.kernel
)
277 if (this->qualifier
.sub_component
)
282 /* Unknown or Wildcard should not be used for Qualification*/
283 if (!qualifier
|| qualifier
== 63)
285 DBG1(DBG_TNC
, "Unknown or Wildcard should not be used for"
286 " Functional Name Qualifier");
289 writer
->write_uint8 (writer
, qualifier
);
290 writer
->write_uint32(writer
, this->name
);
292 writer
->write_uint8 (writer
, (this->measurement_type
<< 7));
293 writer
->write_uint24(writer
, this->extended_pcr
);
294 writer
->write_uint16(writer
, this->hash_algorithm
);
295 writer
->write_uint8 (writer
, this->transformation
);
296 writer
->write_data (writer
, this->measurement_time
);
298 /* Optional fields */
299 if (this->policy_uri
.ptr
&& this->policy_uri
.len
> 0)
301 writer
->write_uint16(writer
, this->policy_uri
.len
);
302 writer
->write_data (writer
, this->policy_uri
);
304 if (this->pcr_before
.ptr
&& this->pcr_after
.ptr
&&
305 this->pcr_before
.len
== this->pcr_after
.len
&&
306 this->pcr_before
.len
> 0 && this->pcr_after
.len
> 0)
308 writer
->write_uint16(writer
, this->pcr_before
.len
);
309 writer
->write_data (writer
, this->pcr_before
);
310 writer
->write_data (writer
, this->pcr_after
);
313 writer
->write_data (writer
, this->measurement
);
315 this->value
= chunk_clone(writer
->get_buf(writer
));
316 writer
->destroy(writer
);
319 METHOD(pa_tnc_attr_t
, process
, status_t
,
320 private_tcg_pts_attr_simple_comp_evid_t
*this, u_int32_t
*offset
)
322 bio_reader_t
*reader
;
324 u_int8_t fam_and_qualifier
;
325 u_int8_t measurement_type
;
327 u_int8_t transformation
;
328 u_int32_t measurement_len
;
330 if (this->value
.len
< PTS_SIMPLE_COMP_EVID_SIZE
)
332 DBG1(DBG_TNC
, "insufficient data for Simple Component Evidence");
336 reader
= bio_reader_create(this->value
);
338 reader
->read_uint8(reader
, &flags
);
340 /* Determine the flags to set*/
341 if ((flags
>> 7) & 1)
343 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_PCR
;
345 if (!((flags
>> 6) & 1) && !((flags
>> 5) & 1))
347 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_NO_VALID
;
349 else if (!((flags
>> 6) & 1) && ((flags
>> 5) & 1))
351 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_NO_VER
;
353 else if (((flags
>> 6) & 1) && !((flags
>> 5) & 1))
355 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL
;
357 else if (((flags
>> 6) & 1) && ((flags
>> 5) & 1))
359 this->flags
|= PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS
;
362 reader
->read_uint24(reader
, &this->depth
);
363 reader
->read_uint24(reader
, &this->comp_vendor_id
);
364 reader
->read_uint8(reader
, &fam_and_qualifier
);
366 if (((fam_and_qualifier
>> 6) & 1) )
370 if (((fam_and_qualifier
>> 7) & 1) )
375 /* TODO: Generate an IF-M error attribute indicating */
376 /* TCG_PTS_INVALID_NAME_FAM */
377 //if(&this->comp_vendor_id==PEN_TCG && this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM)
379 // DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00");
382 if (((fam_and_qualifier
>> 5) & 1) )
384 this->qualifier
.kernel
= true;
386 if (((fam_and_qualifier
>> 4) & 1) )
388 this->qualifier
.sub_component
= true;
390 this->qualifier
.type
= ( fam_and_qualifier
& 0xF );
391 /* TODO: Check the type is defined in pts_attr_req_funct_comp_type_t */
393 /* Unknown or Wildcard should not be used for Qualification*/
394 if (!(fam_and_qualifier
& 0x3F) || (fam_and_qualifier
& 0x3F) == 0x3F)
396 DBG1(DBG_TNC
, "Unknown or Wildcard should not be used for"
397 " Functional Name Qualifier");
400 reader
->read_uint32(reader
, &this->name
);
401 /* TODO: Check the name is defined in pts_attr_req_funct_comp_name_bin_enum_t */
403 reader
->read_uint8(reader
, &measurement_type
);
404 this->measurement_type
= (measurement_type
>> 7 ) & 1;
406 reader
->read_uint24(reader
, &this->extended_pcr
);
407 reader
->read_uint16(reader
, &algorithm
);
408 this->hash_algorithm
= algorithm
;
410 reader
->read_uint8(reader
, &transformation
);
411 this->transformation
= transformation
;
412 /* TODO: Check the transformation is defined in pts_pcr_transform_t */
414 reader
->read_data(reader
, PTS_SIMPLE_COMP_EVID_MEASUREMENT_TIME_SIZE
,
415 &this->measurement_time
);
417 /* Optional Policy URI field is included */
418 if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL
||
419 this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS
)
421 u_int16_t policy_uri_len
;
422 reader
->read_uint16(reader
, &policy_uri_len
);
423 reader
->read_data(reader
, policy_uri_len
, &this->policy_uri
);
426 /* Optional PCR value fields are included */
427 if (this->flags
& PTS_SIMPLE_COMP_EVID_FLAG_PCR
)
429 u_int16_t pcr_value_len
;
430 reader
->read_uint16(reader
, &pcr_value_len
);
431 reader
->read_data(reader
, pcr_value_len
, &this->pcr_before
);
432 reader
->read_data(reader
, pcr_value_len
, &this->pcr_after
);
435 measurement_len
= reader
->remaining(reader
);
436 reader
->read_data(reader
, measurement_len
, &this->measurement
);
438 reader
->destroy(reader
);
442 METHOD(pa_tnc_attr_t
, destroy
, void,
443 private_tcg_pts_attr_simple_comp_evid_t
*this)
445 free(this->value
.ptr
);
446 free(this->measurement_time
.ptr
);
447 free(this->policy_uri
.ptr
);
448 free(this->pcr_before
.ptr
);
449 free(this->pcr_after
.ptr
);
450 free(this->measurement
.ptr
);
454 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_flags
, pts_attr_simple_comp_evid_flag_t
,
455 private_tcg_pts_attr_simple_comp_evid_t
*this)
460 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_flags
, void,
461 private_tcg_pts_attr_simple_comp_evid_t
*this, pts_attr_simple_comp_evid_flag_t flags
)
466 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_sub_component_depth
, u_int32_t
,
467 private_tcg_pts_attr_simple_comp_evid_t
*this)
472 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_spec_comp_funct_name_vendor_id
, u_int32_t
,
473 private_tcg_pts_attr_simple_comp_evid_t
*this)
475 return this->comp_vendor_id
;
478 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_family
, u_int8_t
,
479 private_tcg_pts_attr_simple_comp_evid_t
*this)
484 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_qualifier
, tcg_pts_qualifier_t
,
485 private_tcg_pts_attr_simple_comp_evid_t
*this)
487 return this->qualifier
;
490 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_qualifier
, void,
491 private_tcg_pts_attr_simple_comp_evid_t
*this,
492 tcg_pts_qualifier_t qualifier
)
494 this->qualifier
= qualifier
;
497 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_comp_funct_name
, pts_attr_req_funct_comp_name_bin_enum_t
,
498 private_tcg_pts_attr_simple_comp_evid_t
*this)
503 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_comp_funct_name
, void,
504 private_tcg_pts_attr_simple_comp_evid_t
*this, pts_attr_req_funct_comp_name_bin_enum_t name
)
509 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_measurement_type
, u_int8_t
,
510 private_tcg_pts_attr_simple_comp_evid_t
*this)
512 return this->measurement_type
;
515 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_extended_pcr
, u_int32_t
,
516 private_tcg_pts_attr_simple_comp_evid_t
*this)
518 return this->extended_pcr
;
521 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_extended_pcr
, void,
522 private_tcg_pts_attr_simple_comp_evid_t
*this, u_int32_t extended_pcr
)
524 this->extended_pcr
= extended_pcr
;
527 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_hash_algorithm
, pts_meas_algorithms_t
,
528 private_tcg_pts_attr_simple_comp_evid_t
*this)
530 return this->hash_algorithm
;
533 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_hash_algorithm
, void,
534 private_tcg_pts_attr_simple_comp_evid_t
*this,
535 pts_meas_algorithms_t hash_algorithm
)
537 this->hash_algorithm
= hash_algorithm
;
540 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_pcr_trans
, pts_pcr_transform_t
,
541 private_tcg_pts_attr_simple_comp_evid_t
*this)
543 return this->transformation
;
546 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_pcr_trans
, void,
547 private_tcg_pts_attr_simple_comp_evid_t
*this, pts_pcr_transform_t transformation
)
549 this->transformation
= transformation
;
552 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_measurement_time
, chunk_t
,
553 private_tcg_pts_attr_simple_comp_evid_t
*this)
555 return this->measurement_time
;
558 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_measurement_time
, void,
559 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t measurement_time
)
561 this->measurement_time
= measurement_time
;
564 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_policy_uri
, chunk_t
,
565 private_tcg_pts_attr_simple_comp_evid_t
*this)
567 return this->policy_uri
;
570 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_policy_uri
, void,
571 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t policy_uri
)
573 this->policy_uri
= policy_uri
;
576 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_pcr_before_value
, chunk_t
,
577 private_tcg_pts_attr_simple_comp_evid_t
*this)
579 return this->pcr_before
;
582 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_pcr_before_value
, void,
583 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t pcr_before
)
585 this->pcr_before
= pcr_before
;
588 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_pcr_after_value
, chunk_t
,
589 private_tcg_pts_attr_simple_comp_evid_t
*this)
591 return this->pcr_after
;
594 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_pcr_after_value
, void,
595 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t pcr_after
)
597 this->pcr_after
= pcr_after
;
600 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_pcr_len
, u_int16_t
,
601 private_tcg_pts_attr_simple_comp_evid_t
*this)
603 if(this->pcr_before
.ptr
&& this->pcr_after
.ptr
&&
604 this->pcr_before
.len
== this->pcr_after
.len
&&
605 this->pcr_before
.len
> 0 && this->pcr_after
.len
> 0)
606 return this->pcr_before
.len
;
610 METHOD(tcg_pts_attr_simple_comp_evid_t
, get_comp_measurement
, chunk_t
,
611 private_tcg_pts_attr_simple_comp_evid_t
*this)
613 return this->measurement
;
616 METHOD(tcg_pts_attr_simple_comp_evid_t
, set_comp_measurement
, void,
617 private_tcg_pts_attr_simple_comp_evid_t
*this, chunk_t measurement
)
619 this->measurement
= measurement
;
623 * Described in header.
625 pa_tnc_attr_t
*tcg_pts_attr_simple_comp_evid_create(
626 pts_attr_simple_comp_evid_flag_t flags
,
629 tcg_pts_qualifier_t qualifier
,
630 pts_attr_req_funct_comp_name_bin_enum_t name
,
631 u_int32_t extended_pcr
,
632 pts_meas_algorithms_t hash_algorithm
,
633 pts_pcr_transform_t transformation
,
634 chunk_t measurement_time
,
640 private_tcg_pts_attr_simple_comp_evid_t
*this;
644 .pa_tnc_attribute
= {
645 .get_vendor_id
= _get_vendor_id
,
646 .get_type
= _get_type
,
647 .get_value
= _get_value
,
648 .get_noskip_flag
= _get_noskip_flag
,
649 .set_noskip_flag
= _set_noskip_flag
,
654 .get_flags
= _get_flags
,
655 .set_flags
= _set_flags
,
656 .get_sub_component_depth
= _get_sub_component_depth
,
657 .get_spec_comp_funct_name_vendor_id
= _get_spec_comp_funct_name_vendor_id
,
658 .get_family
= _get_family
,
659 .get_qualifier
= _get_qualifier
,
660 .set_qualifier
= _set_qualifier
,
661 .get_comp_funct_name
= _get_comp_funct_name
,
662 .set_comp_funct_name
= _set_comp_funct_name
,
663 .get_measurement_type
= _get_measurement_type
,
664 .get_extended_pcr
= _get_extended_pcr
,
665 .set_extended_pcr
= _set_extended_pcr
,
666 .get_hash_algorithm
= _get_hash_algorithm
,
667 .set_hash_algorithm
= _set_hash_algorithm
,
668 .get_pcr_trans
= _get_pcr_trans
,
669 .set_pcr_trans
= _set_pcr_trans
,
670 .get_measurement_time
= _get_measurement_time
,
671 .set_measurement_time
= _set_measurement_time
,
672 .get_policy_uri
= _get_policy_uri
,
673 .set_policy_uri
= _set_policy_uri
,
674 .get_pcr_before_value
= _get_pcr_before_value
,
675 .set_pcr_before_value
= _set_pcr_before_value
,
676 .get_pcr_after_value
= _get_pcr_after_value
,
677 .set_pcr_after_value
= _set_pcr_after_value
,
678 .get_pcr_len
= _get_pcr_len
,
679 .get_comp_measurement
= _get_comp_measurement
,
680 .set_comp_measurement
= _set_comp_measurement
,
682 .vendor_id
= PEN_TCG
,
683 .type
= TCG_PTS_SIMPLE_COMP_EVID
,
686 .comp_vendor_id
= vendor_id
,
687 .family
= PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM
,
688 .qualifier
= qualifier
,
690 .extended_pcr
= extended_pcr
,
691 .hash_algorithm
= hash_algorithm
,
692 .transformation
= transformation
,
693 .measurement_time
= measurement_time
,
694 .policy_uri
= policy_uri
,
695 .pcr_before
= pcr_before
,
696 .pcr_after
= pcr_after
,
697 .measurement
= measurement
,
700 return &this->public.pa_tnc_attribute
;
705 * Described in header.
707 pa_tnc_attr_t
*tcg_pts_attr_simple_comp_evid_create_from_data(chunk_t data
)
709 private_tcg_pts_attr_simple_comp_evid_t
*this;
713 .pa_tnc_attribute
= {
714 .get_vendor_id
= _get_vendor_id
,
715 .get_type
= _get_type
,
716 .get_value
= _get_value
,
717 .get_noskip_flag
= _get_noskip_flag
,
718 .set_noskip_flag
= _set_noskip_flag
,
723 .get_flags
= _get_flags
,
724 .set_flags
= _set_flags
,
725 .get_sub_component_depth
= _get_sub_component_depth
,
726 .get_spec_comp_funct_name_vendor_id
= _get_spec_comp_funct_name_vendor_id
,
727 .get_family
= _get_family
,
728 .get_qualifier
= _get_qualifier
,
729 .set_qualifier
= _set_qualifier
,
730 .get_comp_funct_name
= _get_comp_funct_name
,
731 .set_comp_funct_name
= _set_comp_funct_name
,
732 .get_measurement_type
= _get_measurement_type
,
733 .get_extended_pcr
= _get_extended_pcr
,
734 .set_extended_pcr
= _set_extended_pcr
,
735 .get_hash_algorithm
= _get_hash_algorithm
,
736 .set_hash_algorithm
= _set_hash_algorithm
,
737 .get_pcr_trans
= _get_pcr_trans
,
738 .set_pcr_trans
= _set_pcr_trans
,
739 .get_measurement_time
= _get_measurement_time
,
740 .set_measurement_time
= _set_measurement_time
,
741 .get_policy_uri
= _get_policy_uri
,
742 .set_policy_uri
= _set_policy_uri
,
743 .get_pcr_before_value
= _get_pcr_before_value
,
744 .set_pcr_before_value
= _set_pcr_before_value
,
745 .get_pcr_after_value
= _get_pcr_after_value
,
746 .set_pcr_after_value
= _set_pcr_after_value
,
747 .get_pcr_len
= _get_pcr_len
,
748 .get_comp_measurement
= _get_comp_measurement
,
749 .set_comp_measurement
= _set_comp_measurement
,
751 .vendor_id
= PEN_TCG
,
752 .type
= TCG_PTS_SIMPLE_COMP_EVID
,
753 .value
= chunk_clone(data
),
756 return &this->public.pa_tnc_attribute
;