Use struct containing the parameters for Create function
[strongswan.git] / src / libpts / tcg / tcg_pts_attr_simple_comp_evid.c
1 /*
2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
4 *
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>.
9 *
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
13 * for more details.
14 */
15
16 #include "tcg_pts_attr_simple_comp_evid.h"
17
18 #include <pa_tnc/pa_tnc_msg.h>
19 #include <bio/bio_writer.h>
20 #include <bio/bio_reader.h>
21 #include <debug.h>
22
23 typedef struct private_tcg_pts_attr_simple_comp_evid_t private_tcg_pts_attr_simple_comp_evid_t;
24
25 /**
26 * Simple Component Evidence
27 * see section 3.15.1 of PTS Protocol: Binding to TNC IF-M Specification
28 *
29 * 1 2 3
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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
64 */
65
66 /**
67 * Specific Functional Component -> Component Functional Name Structure
68 * see section 5.1 of PTS Protocol: Binding to TNC IF-M Specification
69 *
70 * 1 2 3
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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
77 *
78 */
79
80 /**
81 * Qualifier for Functional Component
82 * see section 5.2 of PTS Protocol: Binding to TNC IF-M Specification
83 *
84 *
85 * 0 1 2 3 4 5
86 * +-+-+-+-+-+-+
87 * |K|S| Type |
88 * +-+-+-+-+-+-+
89 */
90
91
92
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
97
98 /**
99 * Private data of an tcg_pts_attr_simple_comp_evid_t object.
100 */
101 struct private_tcg_pts_attr_simple_comp_evid_t {
102
103 /**
104 * Public members of tcg_pts_attr_simple_comp_evid_t
105 */
106 tcg_pts_attr_simple_comp_evid_t public;
107
108 /**
109 * Attribute vendor ID
110 */
111 pen_t vendor_id;
112
113 /**
114 * Attribute type
115 */
116 u_int32_t type;
117
118 /**
119 * Attribute value
120 */
121 chunk_t value;
122
123 /**
124 * Noskip flag
125 */
126 bool noskip_flag;
127
128 /**
129 * Set of flags for Simple Component Evidence
130 */
131 pts_attr_simple_comp_evid_flag_t flags;
132
133 /**
134 * Sub-component Depth
135 */
136 u_int32_t depth;
137
138 /**
139 * Component Functional Name Vendor ID
140 */
141 u_int32_t comp_vendor_id;
142
143 /**
144 * Functional Name Encoding Family
145 */
146 u_int8_t family;
147
148 /**
149 * Functional Name Category Qualifier
150 */
151 pts_qualifier_t qualifier;
152
153 /**
154 * Component Functional Name
155 */
156 pts_funct_comp_name_t name;
157
158 /**
159 * Measurement type
160 */
161 u_int8_t measurement_type;
162
163 /**
164 * Which PCR the functional component is extended into
165 */
166 u_int32_t extended_pcr;
167
168 /**
169 * Hash Algorithm
170 */
171 pts_meas_algorithms_t hash_algorithm;
172
173 /**
174 * Transformation type for PCR
175 */
176 pts_pcr_transform_t transformation;
177
178 /**
179 * Measurement time
180 */
181 chunk_t measurement_time;
182
183 /**
184 * Optional Policy URI
185 */
186 chunk_t policy_uri;
187
188 /**
189 * Optional PCR before value
190 */
191 chunk_t pcr_before;
192
193 /**
194 * Optional PCR after value
195 */
196 chunk_t pcr_after;
197
198 /**
199 * Component Measurement
200 */
201 chunk_t measurement;
202
203 };
204
205 METHOD(pa_tnc_attr_t, get_vendor_id, pen_t,
206 private_tcg_pts_attr_simple_comp_evid_t *this)
207 {
208 return this->vendor_id;
209 }
210
211 METHOD(pa_tnc_attr_t, get_type, u_int32_t,
212 private_tcg_pts_attr_simple_comp_evid_t *this)
213 {
214 return this->type;
215 }
216
217 METHOD(pa_tnc_attr_t, get_value, chunk_t,
218 private_tcg_pts_attr_simple_comp_evid_t *this)
219 {
220 return this->value;
221 }
222
223 METHOD(pa_tnc_attr_t, get_noskip_flag, bool,
224 private_tcg_pts_attr_simple_comp_evid_t *this)
225 {
226 return this->noskip_flag;
227 }
228
229 METHOD(pa_tnc_attr_t, set_noskip_flag,void,
230 private_tcg_pts_attr_simple_comp_evid_t *this, bool noskip)
231 {
232 this->noskip_flag = noskip;
233 }
234
235 METHOD(pa_tnc_attr_t, build, void,
236 private_tcg_pts_attr_simple_comp_evid_t *this)
237 {
238 bio_writer_t *writer;
239 u_int8_t qualifier = 0;
240
241 writer = bio_writer_create(PTS_SIMPLE_COMP_EVID_SIZE);
242 writer->write_uint8(writer, this->flags);
243 writer->write_uint24 (writer, this->depth);
244 writer->write_uint24 (writer, this->comp_vendor_id);
245
246 if (this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM)
247 {
248 DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00");
249 }
250
251 qualifier += this->qualifier.type;
252 if (this->qualifier.kernel)
253 {
254 qualifier += 16;
255 }
256 if (this->qualifier.sub_component)
257 {
258 qualifier += 32;
259 }
260
261 /* Unknown or Wildcard should not be used for Qualification*/
262 if (!qualifier || qualifier == 63)
263 {
264 DBG1(DBG_TNC, "Unknown or Wildcard should not be used for"
265 " Functional Name Qualifier");
266 }
267
268 writer->write_uint8 (writer, qualifier);
269 writer->write_uint32(writer, this->name);
270
271 writer->write_uint8 (writer, (this->measurement_type << 7));
272 writer->write_uint24(writer, this->extended_pcr);
273 writer->write_uint16(writer, this->hash_algorithm);
274 writer->write_uint8 (writer, this->transformation);
275 writer->write_data (writer, this->measurement_time);
276
277 /* Optional fields */
278 if (this->policy_uri.ptr && this->policy_uri.len > 0)
279 {
280 writer->write_uint16(writer, this->policy_uri.len);
281 writer->write_data (writer, this->policy_uri);
282 }
283 if (this->pcr_before.ptr && this->pcr_after.ptr &&
284 this->pcr_before.len == this->pcr_after.len &&
285 this->pcr_before.len > 0 && this->pcr_after.len > 0)
286 {
287 writer->write_uint16(writer, this->pcr_before.len);
288 writer->write_data (writer, this->pcr_before);
289 writer->write_data (writer, this->pcr_after);
290 }
291
292 writer->write_data (writer, this->measurement);
293
294 this->value = chunk_clone(writer->get_buf(writer));
295 writer->destroy(writer);
296 }
297
298 METHOD(pa_tnc_attr_t, process, status_t,
299 private_tcg_pts_attr_simple_comp_evid_t *this, u_int32_t *offset)
300 {
301 bio_reader_t *reader;
302 u_int8_t flags;
303 u_int8_t fam_and_qualifier;
304 u_int8_t measurement_type;
305 u_int16_t algorithm;
306 u_int8_t transformation;
307 u_int32_t measurement_len;
308
309 if (this->value.len < PTS_SIMPLE_COMP_EVID_SIZE)
310 {
311 DBG1(DBG_TNC, "insufficient data for Simple Component Evidence");
312 *offset = 0;
313 return FAILED;
314 }
315 reader = bio_reader_create(this->value);
316
317 reader->read_uint8(reader, &flags);
318 this->flags = flags;
319
320 reader->read_uint24(reader, &this->depth);
321 reader->read_uint24(reader, &this->comp_vendor_id);
322 reader->read_uint8(reader, &fam_and_qualifier);
323
324 if (((fam_and_qualifier >> 6) & 1) )
325 {
326 this->family += 1;
327 }
328 if (((fam_and_qualifier >> 7) & 1) )
329 {
330 this->family += 2;
331 }
332
333 /* TODO: Generate an IF-M error attribute indicating */
334 /* TCG_PTS_INVALID_NAME_FAM */
335 //if (&this->comp_vendor_id==PEN_TCG && this->family != PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM)
336 //{
337 // DBG1(DBG_TNC, "Functional Name Encoding Family is not set to 00");
338 //}
339
340 if (((fam_and_qualifier >> 5) & 1) )
341 {
342 this->qualifier.kernel = true;
343 }
344 if (((fam_and_qualifier >> 4) & 1) )
345 {
346 this->qualifier.sub_component = true;
347 }
348 this->qualifier.type = ( fam_and_qualifier & 0xF );
349 /* TODO: Check the type is defined in pts_attr_req_funct_comp_type_t */
350
351 /* Unknown or Wildcard should not be used for Qualification*/
352 if (!(fam_and_qualifier & 0x3F) || (fam_and_qualifier & 0x3F) == 0x3F)
353 {
354 DBG1(DBG_TNC, "Unknown or Wildcard should not be used for"
355 " Functional Name Qualifier");
356 }
357
358 reader->read_uint32(reader, &this->name);
359 /* TODO: Check the name is defined in pts_funct_comp_name_t */
360
361 reader->read_uint8(reader, &measurement_type);
362 this->measurement_type = (measurement_type >> 7 ) & 1;
363
364 reader->read_uint24(reader, &this->extended_pcr);
365 reader->read_uint16(reader, &algorithm);
366 this->hash_algorithm = algorithm;
367
368 reader->read_uint8(reader, &transformation);
369 this->transformation = transformation;
370 /* TODO: Check the transformation is defined in pts_pcr_transform_t */
371
372 reader->read_data(reader, PTS_SIMPLE_COMP_EVID_MEASUREMENT_TIME_SIZE,
373 &this->measurement_time);
374 this->measurement_time = chunk_clone(this->measurement_time);
375
376 /* Optional Policy URI field is included */
377 if (this->flags & PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL ||
378 this->flags & PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS)
379 {
380 u_int16_t policy_uri_len;
381 reader->read_uint16(reader, &policy_uri_len);
382 reader->read_data(reader, policy_uri_len, &this->policy_uri);
383 this->policy_uri = chunk_clone(this->policy_uri);
384 }
385
386 /* Optional PCR value fields are included */
387 if (this->flags & PTS_SIMPLE_COMP_EVID_FLAG_PCR)
388 {
389 u_int16_t pcr_value_len;
390 reader->read_uint16(reader, &pcr_value_len);
391 reader->read_data(reader, pcr_value_len, &this->pcr_before);
392 this->pcr_before = chunk_clone(this->pcr_before);
393 reader->read_data(reader, pcr_value_len, &this->pcr_after);
394 this->pcr_after = chunk_clone(this->pcr_after);
395 }
396
397 measurement_len = reader->remaining(reader);
398 reader->read_data(reader, measurement_len, &this->measurement);
399 this->measurement = chunk_clone(this->measurement);
400
401 reader->destroy(reader);
402 return SUCCESS;
403 }
404
405 METHOD(pa_tnc_attr_t, destroy, void,
406 private_tcg_pts_attr_simple_comp_evid_t *this)
407 {
408 free(this->value.ptr);
409 free(this->measurement_time.ptr);
410 free(this->policy_uri.ptr);
411 free(this->pcr_before.ptr);
412 free(this->pcr_after.ptr);
413 free(this->measurement.ptr);
414 free(this);
415 }
416
417 METHOD(tcg_pts_attr_simple_comp_evid_t, get_flags, pts_attr_simple_comp_evid_flag_t,
418 private_tcg_pts_attr_simple_comp_evid_t *this)
419 {
420 return this->flags;
421 }
422
423 METHOD(tcg_pts_attr_simple_comp_evid_t, get_sub_component_depth, u_int32_t,
424 private_tcg_pts_attr_simple_comp_evid_t *this)
425 {
426 return this->depth;
427 }
428
429 METHOD(tcg_pts_attr_simple_comp_evid_t, get_spec_comp_funct_name_vendor_id, u_int32_t,
430 private_tcg_pts_attr_simple_comp_evid_t *this)
431 {
432 return this->comp_vendor_id;
433 }
434
435 METHOD(tcg_pts_attr_simple_comp_evid_t, get_family, u_int8_t,
436 private_tcg_pts_attr_simple_comp_evid_t *this)
437 {
438 return this->family;
439 }
440
441 METHOD(tcg_pts_attr_simple_comp_evid_t, get_qualifier, pts_qualifier_t,
442 private_tcg_pts_attr_simple_comp_evid_t *this)
443 {
444 return this->qualifier;
445 }
446
447 METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_funct_name, pts_funct_comp_name_t,
448 private_tcg_pts_attr_simple_comp_evid_t *this)
449 {
450 return this->name;
451 }
452
453 METHOD(tcg_pts_attr_simple_comp_evid_t, get_measurement_type, u_int8_t,
454 private_tcg_pts_attr_simple_comp_evid_t *this)
455 {
456 return this->measurement_type;
457 }
458
459 METHOD(tcg_pts_attr_simple_comp_evid_t, get_extended_pcr, u_int32_t,
460 private_tcg_pts_attr_simple_comp_evid_t *this)
461 {
462 return this->extended_pcr;
463 }
464
465 METHOD(tcg_pts_attr_simple_comp_evid_t, get_hash_algorithm, pts_meas_algorithms_t,
466 private_tcg_pts_attr_simple_comp_evid_t *this)
467 {
468 return this->hash_algorithm;
469 }
470
471 METHOD(tcg_pts_attr_simple_comp_evid_t, get_pcr_trans, pts_pcr_transform_t,
472 private_tcg_pts_attr_simple_comp_evid_t *this)
473 {
474 return this->transformation;
475 }
476
477 METHOD(tcg_pts_attr_simple_comp_evid_t, get_measurement_time, chunk_t,
478 private_tcg_pts_attr_simple_comp_evid_t *this)
479 {
480 return this->measurement_time;
481 }
482
483 METHOD(tcg_pts_attr_simple_comp_evid_t, get_policy_uri, chunk_t,
484 private_tcg_pts_attr_simple_comp_evid_t *this)
485 {
486 return this->policy_uri;
487 }
488
489 METHOD(tcg_pts_attr_simple_comp_evid_t, get_pcr_before_value, chunk_t,
490 private_tcg_pts_attr_simple_comp_evid_t *this)
491 {
492 return this->pcr_before;
493 }
494
495 METHOD(tcg_pts_attr_simple_comp_evid_t, get_pcr_after_value, chunk_t,
496 private_tcg_pts_attr_simple_comp_evid_t *this)
497 {
498 return this->pcr_after;
499 }
500
501 METHOD(tcg_pts_attr_simple_comp_evid_t, get_pcr_len, u_int16_t,
502 private_tcg_pts_attr_simple_comp_evid_t *this)
503 {
504 if (this->pcr_before.ptr && this->pcr_after.ptr &&
505 this->pcr_before.len == this->pcr_after.len &&
506 this->pcr_before.len > 0 && this->pcr_after.len > 0)
507 {
508 return this->pcr_before.len;
509 }
510 return 0;
511 }
512
513 METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_measurement, chunk_t,
514 private_tcg_pts_attr_simple_comp_evid_t *this)
515 {
516 return this->measurement;
517 }
518
519 /**
520 * Described in header.
521 */
522 pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create(
523 tcg_pts_attr_simple_comp_evid_params_t params)
524 {
525 private_tcg_pts_attr_simple_comp_evid_t *this;
526
527 INIT(this,
528 .public = {
529 .pa_tnc_attribute = {
530 .get_vendor_id = _get_vendor_id,
531 .get_type = _get_type,
532 .get_value = _get_value,
533 .get_noskip_flag = _get_noskip_flag,
534 .set_noskip_flag = _set_noskip_flag,
535 .build = _build,
536 .process = _process,
537 .destroy = _destroy,
538 },
539 .get_flags= _get_flags,
540 .get_sub_component_depth = _get_sub_component_depth,
541 .get_spec_comp_funct_name_vendor_id = _get_spec_comp_funct_name_vendor_id,
542 .get_family = _get_family,
543 .get_qualifier = _get_qualifier,
544 .get_comp_funct_name = _get_comp_funct_name,
545 .get_measurement_type = _get_measurement_type,
546 .get_extended_pcr = _get_extended_pcr,
547 .get_hash_algorithm = _get_hash_algorithm,
548 .get_pcr_trans = _get_pcr_trans,
549 .get_measurement_time = _get_measurement_time,
550 .get_policy_uri = _get_policy_uri,
551 .get_pcr_before_value = _get_pcr_before_value,
552 .get_pcr_after_value = _get_pcr_after_value,
553 .get_pcr_len = _get_pcr_len,
554 .get_comp_measurement = _get_comp_measurement,
555 },
556 .vendor_id = PEN_TCG,
557 .type = TCG_PTS_SIMPLE_COMP_EVID,
558 .flags = params.flags,
559 .depth = params.depth,
560 .comp_vendor_id = params.vendor_id,
561 .family = PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM,
562 .qualifier = params.qualifier,
563 .name = params.name,
564 .extended_pcr = params.extended_pcr,
565 .hash_algorithm = params.hash_algorithm,
566 .transformation = params.transformation,
567 .measurement_time = params.measurement_time,
568 .policy_uri = params.policy_uri,
569 .pcr_before = params.pcr_before,
570 .pcr_after = params.pcr_after,
571 .measurement = params.measurement,
572 );
573
574 return &this->public.pa_tnc_attribute;
575 }
576
577
578 /**
579 * Described in header.
580 */
581 pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create_from_data(chunk_t data)
582 {
583 private_tcg_pts_attr_simple_comp_evid_t *this;
584
585 INIT(this,
586 .public = {
587 .pa_tnc_attribute = {
588 .get_vendor_id = _get_vendor_id,
589 .get_type = _get_type,
590 .get_value = _get_value,
591 .get_noskip_flag = _get_noskip_flag,
592 .set_noskip_flag = _set_noskip_flag,
593 .build = _build,
594 .process = _process,
595 .destroy = _destroy,
596 },
597 .get_flags= _get_flags,
598 .get_sub_component_depth = _get_sub_component_depth,
599 .get_spec_comp_funct_name_vendor_id = _get_spec_comp_funct_name_vendor_id,
600 .get_family = _get_family,
601 .get_qualifier = _get_qualifier,
602 .get_comp_funct_name = _get_comp_funct_name,
603 .get_measurement_type = _get_measurement_type,
604 .get_extended_pcr = _get_extended_pcr,
605 .get_hash_algorithm = _get_hash_algorithm,
606 .get_pcr_trans = _get_pcr_trans,
607 .get_measurement_time = _get_measurement_time,
608 .get_policy_uri = _get_policy_uri,
609 .get_pcr_before_value = _get_pcr_before_value,
610 .get_pcr_after_value = _get_pcr_after_value,
611 .get_pcr_len = _get_pcr_len,
612 .get_comp_measurement = _get_comp_measurement,
613 },
614 .vendor_id = PEN_TCG,
615 .type = TCG_PTS_SIMPLE_COMP_EVID,
616 .family = PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM,
617 .value = chunk_clone(data),
618 );
619
620 return &this->public.pa_tnc_attribute;
621 }