fcfb7207fb0774dabda6b3ac6bdb45cbbf8e78bf
[strongswan.git] / src / libimcv / plugins / imc_attestation / imc_attestation_process.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 #define _GNU_SOURCE
17
18 #include <stdio.h>
19
20 #include "imc_attestation_process.h"
21
22 #include <ietf/ietf_attr_pa_tnc_error.h>
23 #include <pts/pts.h>
24
25 #include <tcg/tcg_pts_attr_proto_caps.h>
26 #include <tcg/tcg_pts_attr_meas_algo.h>
27 #include <tcg/tcg_pts_attr_dh_nonce_params_req.h>
28 #include <tcg/tcg_pts_attr_dh_nonce_params_resp.h>
29 #include <tcg/tcg_pts_attr_dh_nonce_finish.h>
30 #include <tcg/tcg_pts_attr_get_tpm_version_info.h>
31 #include <tcg/tcg_pts_attr_tpm_version_info.h>
32 #include <tcg/tcg_pts_attr_get_aik.h>
33 #include <tcg/tcg_pts_attr_aik.h>
34 #include <tcg/tcg_pts_attr_req_funct_comp_evid.h>
35 #include <tcg/tcg_pts_attr_gen_attest_evid.h>
36 #include <tcg/tcg_pts_attr_simple_comp_evid.h>
37 #include <tcg/tcg_pts_attr_simple_evid_final.h>
38 #include <tcg/tcg_pts_attr_req_file_meas.h>
39 #include <tcg/tcg_pts_attr_file_meas.h>
40 #include <tcg/tcg_pts_attr_req_file_meta.h>
41 #include <tcg/tcg_pts_attr_unix_file_meta.h>
42
43 #include <debug.h>
44
45 #define DEFAULT_NONCE_LEN 20
46 #define EXTEND_PCR 16
47
48 bool imc_attestation_process(pa_tnc_attr_t *attr, linked_list_t *attr_list,
49 imc_attestation_state_t *attestation_state,
50 pts_meas_algorithms_t supported_algorithms,
51 pts_dh_group_t supported_dh_groups,
52 linked_list_t *evidences)
53 {
54 chunk_t attr_info;
55 pts_t *pts;
56 pts_error_code_t pts_error;
57 bool valid_path;
58
59 pts = attestation_state->get_pts(attestation_state);
60 switch (attr->get_type(attr))
61 {
62 case TCG_PTS_REQ_PROTO_CAPS:
63 {
64 tcg_pts_attr_proto_caps_t *attr_cast;
65 pts_proto_caps_flag_t imc_caps, imv_caps;
66
67 attr_cast = (tcg_pts_attr_proto_caps_t*)attr;
68 imv_caps = attr_cast->get_flags(attr_cast);
69 imc_caps = pts->get_proto_caps(pts);
70 pts->set_proto_caps(pts, imc_caps & imv_caps);
71
72 /* Send PTS Protocol Capabilities attribute */
73 attr = tcg_pts_attr_proto_caps_create(imc_caps & imv_caps, FALSE);
74 attr_list->insert_last(attr_list, attr);
75 break;
76 }
77 case TCG_PTS_MEAS_ALGO:
78 {
79 tcg_pts_attr_meas_algo_t *attr_cast;
80 pts_meas_algorithms_t offered_algorithms, selected_algorithm;
81
82 attr_cast = (tcg_pts_attr_meas_algo_t*)attr;
83 offered_algorithms = attr_cast->get_algorithms(attr_cast);
84 selected_algorithm = pts_meas_algo_select(supported_algorithms,
85 offered_algorithms);
86 if (selected_algorithm == PTS_MEAS_ALGO_NONE)
87 {
88 attr = pts_hash_alg_error_create(supported_algorithms);
89 attr_list->insert_last(attr_list, attr);
90 break;
91 }
92
93 /* Send Measurement Algorithm Selection attribute */
94 pts->set_meas_algorithm(pts, selected_algorithm);
95 attr = tcg_pts_attr_meas_algo_create(selected_algorithm, TRUE);
96 attr_list->insert_last(attr_list, attr);
97 break;
98 }
99 case TCG_PTS_DH_NONCE_PARAMS_REQ:
100 {
101 tcg_pts_attr_dh_nonce_params_req_t *attr_cast;
102 pts_dh_group_t offered_dh_groups, selected_dh_group;
103 chunk_t responder_value, responder_nonce;
104 int nonce_len, min_nonce_len;
105
106 nonce_len = lib->settings->get_int(lib->settings,
107 "libimcv.plugins.imc-attestation.nonce_len",
108 DEFAULT_NONCE_LEN);
109
110 attr_cast = (tcg_pts_attr_dh_nonce_params_req_t*)attr;
111 min_nonce_len = attr_cast->get_min_nonce_len(attr_cast);
112 if (nonce_len < PTS_MIN_NONCE_LEN ||
113 (min_nonce_len > 0 && nonce_len < min_nonce_len))
114 {
115 attr = pts_dh_nonce_error_create(nonce_len, PTS_MAX_NONCE_LEN);
116 attr_list->insert_last(attr_list, attr);
117 break;
118 }
119
120 offered_dh_groups = attr_cast->get_dh_groups(attr_cast);
121 selected_dh_group = pts_dh_group_select(supported_dh_groups,
122 offered_dh_groups);
123 if (selected_dh_group == PTS_DH_GROUP_NONE)
124 {
125 attr = pts_dh_group_error_create(supported_dh_groups);
126 attr_list->insert_last(attr_list, attr);
127 break;
128 }
129
130 /* Create own DH factor and nonce */
131 if (!pts->create_dh_nonce(pts, selected_dh_group, nonce_len))
132 {
133 return FALSE;
134 }
135 pts->get_my_public_value(pts, &responder_value, &responder_nonce);
136
137 /* Send DH Nonce Parameters Response attribute */
138 attr = tcg_pts_attr_dh_nonce_params_resp_create(selected_dh_group,
139 supported_algorithms, responder_nonce, responder_value);
140 attr_list->insert_last(attr_list, attr);
141 break;
142 }
143 case TCG_PTS_DH_NONCE_FINISH:
144 {
145 tcg_pts_attr_dh_nonce_finish_t *attr_cast;
146 pts_meas_algorithms_t selected_algorithm;
147 chunk_t initiator_nonce, initiator_value;
148 int nonce_len;
149
150 attr_cast = (tcg_pts_attr_dh_nonce_finish_t*)attr;
151 selected_algorithm = attr_cast->get_hash_algo(attr_cast);
152 if (!(selected_algorithm & supported_algorithms))
153 {
154 DBG1(DBG_IMC, "PTS-IMV selected unsupported DH hash algorithm");
155 return FALSE;
156 }
157 pts->set_dh_hash_algorithm(pts, selected_algorithm);
158
159 initiator_value = attr_cast->get_initiator_value(attr_cast);
160 initiator_nonce = attr_cast->get_initiator_nonce(attr_cast);
161
162 nonce_len = lib->settings->get_int(lib->settings,
163 "libimcv.plugins.imc-attestation.nonce_len",
164 DEFAULT_NONCE_LEN);
165 if (nonce_len != initiator_nonce.len)
166 {
167 DBG1(DBG_IMC, "initiator and responder DH nonces "
168 "have differing lengths");
169 return FALSE;
170 }
171
172 pts->set_peer_public_value(pts, initiator_value, initiator_nonce);
173 if (!pts->calculate_secret(pts))
174 {
175 return FALSE;
176 }
177 break;
178 }
179 case TCG_PTS_GET_TPM_VERSION_INFO:
180 {
181 chunk_t tpm_version_info, attr_info;
182
183 if (!pts->get_tpm_version_info(pts, &tpm_version_info))
184 {
185 attr_info = attr->get_value(attr);
186 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
187 TCG_PTS_TPM_VERS_NOT_SUPPORTED, attr_info);
188 attr_list->insert_last(attr_list, attr);
189 break;
190 }
191
192 /* Send TPM Version Info attribute */
193 attr = tcg_pts_attr_tpm_version_info_create(tpm_version_info);
194 attr_list->insert_last(attr_list, attr);
195 break;
196 }
197 case TCG_PTS_GET_AIK:
198 {
199 certificate_t *aik;
200
201 aik = pts->get_aik(pts);
202 if (!aik)
203 {
204 DBG1(DBG_IMC, "no AIK certificate or public key available");
205 break;
206 }
207
208 /* Send AIK attribute */
209 attr = tcg_pts_attr_aik_create(aik);
210 attr_list->insert_last(attr_list, attr);
211 break;
212 }
213 case TCG_PTS_REQ_FUNCT_COMP_EVID:
214 {
215 tcg_pts_attr_req_funct_comp_evid_t *attr_cast;
216 pts_proto_caps_flag_t negotiated_caps;
217 pts_attr_req_funct_comp_evid_flag_t flags;
218 u_int32_t sub_comp_depth;
219 u_int32_t comp_name_vendor_id;
220 u_int8_t family;
221 pts_qualifier_t qualifier;
222 pts_funct_comp_name_t name;
223
224 attr_info = attr->get_value(attr);
225 attr_cast = (tcg_pts_attr_req_funct_comp_evid_t*)attr;
226 negotiated_caps = pts->get_proto_caps(pts);
227 flags = attr_cast->get_flags(attr_cast);
228
229 if (flags & PTS_REQ_FUNC_COMP_FLAG_TTC)
230 {
231 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
232 TCG_PTS_UNABLE_DET_TTC, attr_info);
233 attr_list->insert_last(attr_list, attr);
234 break;
235 }
236 if (flags & PTS_REQ_FUNC_COMP_FLAG_VER &&
237 !(negotiated_caps & PTS_PROTO_CAPS_V))
238 {
239 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
240 TCG_PTS_UNABLE_LOCAL_VAL, attr_info);
241 attr_list->insert_last(attr_list, attr);
242 break;
243 }
244 if (flags & PTS_REQ_FUNC_COMP_FLAG_CURR &&
245 !(negotiated_caps & PTS_PROTO_CAPS_C))
246 {
247 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
248 TCG_PTS_UNABLE_CUR_EVID, attr_info);
249 attr_list->insert_last(attr_list, attr);
250 break;
251 }
252 if (flags & PTS_REQ_FUNC_COMP_FLAG_PCR &&
253 !(negotiated_caps & PTS_PROTO_CAPS_T))
254 {
255 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
256 TCG_PTS_UNABLE_DET_PCR, attr_info);
257 attr_list->insert_last(attr_list, attr);
258 break;
259 }
260
261 sub_comp_depth = attr_cast->get_sub_component_depth(attr_cast);
262 /* TODO: Implement checking of components with its sub-components */
263 if (sub_comp_depth != 0)
264 {
265 DBG1(DBG_IMC, "current version of Attestation IMC does not support"
266 "sub component measurement deeper than zero. "
267 "Measuring top level component only.");
268 }
269
270 comp_name_vendor_id = attr_cast->get_comp_funct_name_vendor_id(attr_cast);
271 if (comp_name_vendor_id != PEN_TCG)
272 {
273 DBG1(DBG_IMC, "current version of Attestation IMC supports"
274 "only functional component namings by TCG ");
275 break;
276 }
277
278 family = attr_cast->get_family(attr_cast);
279 if (family)
280 {
281 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
282 TCG_PTS_INVALID_NAME_FAM, attr_info);
283 attr_list->insert_last(attr_list, attr);
284 break;
285 }
286
287 qualifier = attr_cast->get_qualifier(attr_cast);
288
289 /* Check if Unknown or Wildcard was set for qualifier */
290 if (qualifier.kernel && qualifier.sub_component &&
291 (qualifier.type & PTS_FUNC_COMP_TYPE_ALL))
292 {
293 DBG2(DBG_IMC, "wildcard was set for the qualifier of functional"
294 " component. Identifying the component with name binary enumeration");
295 }
296 else if (!qualifier.kernel && !qualifier.sub_component &&
297 (qualifier.type & PTS_FUNC_COMP_TYPE_UNKNOWN))
298 {
299 DBG2(DBG_IMC, "unknown was set for the qualifier of functional"
300 " component. Identifying the component with name binary enumeration");
301 }
302 else
303 {
304 /* TODO: Implement what todo with received qualifier */
305 }
306
307 name = attr_cast->get_comp_funct_name(attr_cast);
308 switch (name)
309 {
310 case PTS_FUNC_COMP_NAME_BIOS:
311 {
312 tcg_pts_attr_simple_comp_evid_params_t params;
313 pts_qualifier_t qualifier;
314 time_t measurement_time_t;
315 struct tm *time_now;
316 char *utc_time;
317 hasher_t *hasher;
318 u_char hash_output[HASH_SIZE_SHA384];
319 hash_algorithm_t hash_alg;
320
321 /* TODO: Implement BIOS measurement */
322 DBG1(DBG_IMC, "experimental implementation:"
323 " Extend TPM with etc/tnc_config file");
324
325 params.flags = PTS_SIMPLE_COMP_EVID_FLAG_PCR | PTS_SIMPLE_COMP_EVID_FLAG_NO_VALID;
326 params.depth = 0;
327 params.vendor_id = PEN_TCG;
328
329 qualifier.kernel = FALSE;
330 qualifier.sub_component = FALSE;
331 qualifier.type = PTS_FUNC_COMP_TYPE_TNC;
332 params.qualifier = qualifier;
333
334 params.name = PTS_FUNC_COMP_NAME_BIOS;
335 params.extended_pcr = EXTEND_PCR;
336 params.hash_algorithm = pts->get_meas_algorithm(pts);
337
338 if (!(params.flags & PTS_SIMPLE_COMP_EVID_FLAG_PCR))
339 {
340 params.transformation = PTS_PCR_TRANSFORM_NO;
341 }
342 else if (pts->get_meas_algorithm(pts) & PTS_MEAS_ALGO_SHA1)
343 {
344 params.transformation = PTS_PCR_TRANSFORM_MATCH;
345 }
346 else if (pts->get_meas_algorithm(pts) & PTS_MEAS_ALGO_SHA256)
347 {
348 params.transformation = PTS_PCR_TRANSFORM_LONG;
349 }
350
351 /* Create a hasher */
352 hash_alg = pts_meas_algo_to_hash(pts->get_meas_algorithm(pts));
353 hasher = lib->crypto->create_hasher(lib->crypto, hash_alg);
354 if (!hasher)
355 {
356 DBG1(DBG_IMC, " hasher %N not available",
357 hash_algorithm_names, hash_alg);
358 return FALSE;
359 }
360
361 if (!pts->hash_file(pts, hasher, "/etc/tnc_config", hash_output))
362 {
363 hasher->destroy(hasher);
364 return FALSE;
365 }
366
367 measurement_time_t = time(NULL);
368 if (!measurement_time_t)
369 {
370 params.measurement_time = chunk_create("0000-00-00T00:00:00Z", 20);
371 }
372 else
373 {
374 time_now = localtime(&measurement_time_t);
375 if (asprintf(&utc_time, "%d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2dZ",
376 time_now->tm_year + 1900,
377 time_now->tm_mon + 1,
378 time_now->tm_mday,
379 time_now->tm_hour,
380 time_now->tm_min,
381 time_now->tm_sec) < 0)
382 {
383 DBG1(DBG_IMC, "could not format local time to UTC");
384 hasher->destroy(hasher);
385 return FALSE;
386 }
387 params.measurement_time = chunk_create(utc_time, 20);
388 params.measurement_time = chunk_clone(params.measurement_time);
389 free(utc_time);
390
391 }
392
393 params.measurement = chunk_create(hash_output, hasher->get_hash_size(hasher));
394 hasher->destroy(hasher);
395
396 params.policy_uri = chunk_empty;
397 if (!pts->read_pcr(pts, EXTEND_PCR, &params.pcr_before))
398 {
399 DBG1(DBG_IMC, "error occured while reading PCR: %d", EXTEND_PCR);
400 return FALSE;
401 }
402
403 if (!pts->extend_pcr(pts, EXTEND_PCR,
404 params.measurement, &params.pcr_after))
405 {
406 DBG1(DBG_IMC, "error occured while extending PCR: %d", EXTEND_PCR);
407 return FALSE;
408 }
409
410 /* Buffer Simple Component Evidence attribute */
411 attr = tcg_pts_attr_simple_comp_evid_create(params);
412 evidences->insert_last(evidences, attr);
413
414 break;
415 }
416 case PTS_FUNC_COMP_NAME_IGNORE:
417 case PTS_FUNC_COMP_NAME_CRTM:
418 case PTS_FUNC_COMP_NAME_PLATFORM_EXT:
419 case PTS_FUNC_COMP_NAME_BOARD:
420 case PTS_FUNC_COMP_NAME_INIT_LOADER:
421 case PTS_FUNC_COMP_NAME_OPT_ROMS:
422 default:
423 {
424 DBG1(DBG_IMC, "unsupported Functional Component Name");
425 break;
426 }
427 }
428 break;
429 }
430 case TCG_PTS_GEN_ATTEST_EVID:
431 {
432 enumerator_t *e;
433 pts_simple_evid_final_flag_t flags;
434 chunk_t pcr_composite, quote_signature;
435 linked_list_t *pcrs;
436
437 /* Send buffered Simple Component Evidences */
438 pcrs = linked_list_create();
439
440 e = evidences->create_enumerator(evidences);
441 while (e->enumerate(e, &attr))
442 {
443 tcg_pts_attr_simple_comp_evid_t *attr_cast;
444 u_int32_t extended_pcr;
445
446 attr_cast = (tcg_pts_attr_simple_comp_evid_t*)attr;
447 extended_pcr = attr_cast->get_extended_pcr(attr_cast);
448
449 /* Add extended PCR number to PCR list to quote */
450 /* Duplicated PCR numbers have no influence */
451 pcrs->insert_last(pcrs, &extended_pcr);
452 /* Send Simple Compoenent Evidence */
453 attr_list->insert_last(attr_list, attr);
454 }
455
456 /* Quote */
457 if (!pts->quote_tpm(pts, pcrs, &pcr_composite, &quote_signature))
458 {
459 DBG1(DBG_IMC, "error occured while TPM quote operation");
460 DESTROY_IF(e);
461 DESTROY_IF(pcrs);
462 DESTROY_IF(evidences);
463 return FALSE;
464 }
465
466 /* Send Simple Evidence Final attribute */
467 flags = PTS_SIMPLE_EVID_FINAL_FLAG_TPM_QUOTE_INFO;
468
469 attr = tcg_pts_attr_simple_evid_final_create(flags, 0,
470 pcr_composite, quote_signature, chunk_empty);
471 attr_list->insert_last(attr_list, attr);
472
473 DESTROY_IF(e);
474 DESTROY_IF(pcrs);
475 DESTROY_IF(evidences);
476
477 break;
478 }
479 case TCG_PTS_REQ_FILE_META:
480 {
481 tcg_pts_attr_req_file_meta_t *attr_cast;
482 char *pathname;
483 bool is_directory;
484 u_int8_t delimiter;
485 pts_file_meta_t *metadata;
486
487 attr_info = attr->get_value(attr);
488 attr_cast = (tcg_pts_attr_req_file_meta_t*)attr;
489 is_directory = attr_cast->get_directory_flag(attr_cast);
490 delimiter = attr_cast->get_delimiter(attr_cast);
491 pathname = attr_cast->get_pathname(attr_cast);
492
493 valid_path = pts->is_path_valid(pts, pathname, &pts_error);
494 if (valid_path && pts_error)
495 {
496 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
497 pts_error, attr_info);
498 attr_list->insert_last(attr_list, attr);
499 break;
500 }
501 else if (!valid_path)
502 {
503 break;
504 }
505 if (delimiter != SOLIDUS_UTF && delimiter != REVERSE_SOLIDUS_UTF)
506 {
507 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
508 TCG_PTS_INVALID_DELIMITER, attr_info);
509 attr_list->insert_last(attr_list, attr);
510 break;
511 }
512 /* Get File Metadata and send them to PTS-IMV */
513 DBG2(DBG_IMC, "metadata request for %s '%s'",
514 is_directory ? "directory" : "file",
515 pathname);
516 metadata = pts->get_metadata(pts, pathname, is_directory);
517
518 if (!metadata)
519 {
520 /* TODO handle error codes from measurements */
521 return FALSE;
522 }
523 attr = tcg_pts_attr_unix_file_meta_create(metadata);
524 attr->set_noskip_flag(attr, TRUE);
525 attr_list->insert_last(attr_list, attr);
526
527 break;
528 }
529 case TCG_PTS_REQ_FILE_MEAS:
530 {
531 tcg_pts_attr_req_file_meas_t *attr_cast;
532 char *pathname;
533 u_int16_t request_id;
534 bool is_directory;
535 u_int32_t delimiter;
536 pts_file_meas_t *measurements;
537
538 attr_info = attr->get_value(attr);
539 attr_cast = (tcg_pts_attr_req_file_meas_t*)attr;
540 is_directory = attr_cast->get_directory_flag(attr_cast);
541 request_id = attr_cast->get_request_id(attr_cast);
542 delimiter = attr_cast->get_delimiter(attr_cast);
543 pathname = attr_cast->get_pathname(attr_cast);
544 valid_path = pts->is_path_valid(pts, pathname, &pts_error);
545
546 if (valid_path && pts_error)
547 {
548 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
549 pts_error, attr_info);
550 attr_list->insert_last(attr_list, attr);
551 break;
552 }
553 else if (!valid_path)
554 {
555 break;
556 }
557
558 if (delimiter != SOLIDUS_UTF && delimiter != REVERSE_SOLIDUS_UTF)
559 {
560 attr = ietf_attr_pa_tnc_error_create(PEN_TCG,
561 TCG_PTS_INVALID_DELIMITER, attr_info);
562 attr_list->insert_last(attr_list, attr);
563 break;
564 }
565
566 /* Do PTS File Measurements and send them to PTS-IMV */
567 DBG2(DBG_IMC, "measurement request %d for %s '%s'",
568 request_id, is_directory ? "directory" : "file",
569 pathname);
570 measurements = pts->do_measurements(pts, request_id,
571 pathname, is_directory);
572 if (!measurements)
573 {
574 /* TODO handle error codes from measurements */
575 return FALSE;
576 }
577 attr = tcg_pts_attr_file_meas_create(measurements);
578 attr->set_noskip_flag(attr, TRUE);
579 attr_list->insert_last(attr_list, attr);
580 break;
581 }
582 /* TODO: Not implemented yet */
583 case TCG_PTS_REQ_INTEG_MEAS_LOG:
584 /* Attributes using XML */
585 case TCG_PTS_REQ_TEMPL_REF_MANI_SET_META:
586 case TCG_PTS_UPDATE_TEMPL_REF_MANI:
587 /* On Windows only*/
588 case TCG_PTS_REQ_REGISTRY_VALUE:
589 /* Received on IMV side only*/
590 case TCG_PTS_PROTO_CAPS:
591 case TCG_PTS_DH_NONCE_PARAMS_RESP:
592 case TCG_PTS_MEAS_ALGO_SELECTION:
593 case TCG_PTS_TPM_VERSION_INFO:
594 case TCG_PTS_TEMPL_REF_MANI_SET_META:
595 case TCG_PTS_AIK:
596 case TCG_PTS_SIMPLE_COMP_EVID:
597 case TCG_PTS_SIMPLE_EVID_FINAL:
598 case TCG_PTS_VERIFICATION_RESULT:
599 case TCG_PTS_INTEG_REPORT:
600 case TCG_PTS_UNIX_FILE_META:
601 case TCG_PTS_FILE_MEAS:
602 case TCG_PTS_INTEG_MEAS_LOG:
603 default:
604 DBG1(DBG_IMC, "received unsupported attribute '%N'",
605 tcg_attr_names, attr->get_type(attr));
606 break;
607 }
608 return TRUE;
609 }