| 327 | | r = sc_pkcs15_read_data_object(p15card, cinfo, &data_object); |
| 328 | | if (r) { |
| 329 | | fprintf(stderr, "Data object read failed: %s\n", sc_strerror(r)); |
| 330 | | if (r == SC_ERROR_FILE_NOT_FOUND) |
| 331 | | continue; /* DEE emulation may say there is a file */ |
| | 327 | r = authenticate(objs[i]); |
| | 328 | if (r >= 0) { |
| | 329 | r = sc_pkcs15_read_data_object(p15card, cinfo, &data_object); |
| | 330 | if (r) { |
| | 331 | fprintf(stderr, "Data object read failed: %s\n", sc_strerror(r)); |
| | 332 | if (r == SC_ERROR_FILE_NOT_FOUND) |
| | 333 | continue; /* DEE emulation may say there is a file */ |
| | 334 | return 1; |
| | 335 | } |
| | 336 | r = print_data_object("Data Object", data_object->data, data_object->data_len); |
| | 337 | sc_pkcs15_free_data_object(data_object); |
| | 338 | return r; |
| | 339 | } else { |
| | 340 | fprintf(stderr, "Authentication error: %s\n", sc_strerror(r)); |
| 372 | | printf("Path : %s\n", sc_print_path(&cinfo->path)); |
| 373 | | r = sc_pkcs15_read_data_object(p15card, cinfo, &data_object); |
| 374 | | if (r) { |
| 375 | | fprintf(stderr, "Data object read failed: %s\n", sc_strerror(r)); |
| 376 | | if (r == SC_ERROR_FILE_NOT_FOUND) |
| 377 | | continue; /* DEE emulation may say there is a file */ |
| 378 | | return 1; |
| 379 | | } |
| 380 | | r = list_data_object("Data Object", data_object->data, data_object->data_len); |
| 381 | | sc_pkcs15_free_data_object(data_object); |
| | 377 | printf("Path: %s\n", sc_print_path(&cinfo->path)); |
| | 378 | printf("Auth ID: %s\n", sc_pkcs15_print_id(&objs[i]->auth_id)); |
| | 379 | if (objs[i]->auth_id.len == 0) { |
| | 380 | struct sc_pkcs15_data *data_object; |
| | 381 | r = sc_pkcs15_read_data_object(p15card, cinfo, &data_object); |
| | 382 | if (r) { |
| | 383 | fprintf(stderr, "Data object read failed: %s\n", sc_strerror(r)); |
| | 384 | if (r == SC_ERROR_FILE_NOT_FOUND) |
| | 385 | continue; /* DEE emulation may say there is a file */ |
| | 386 | return 1; |
| | 387 | } |
| | 388 | r = list_data_object("Data Object", data_object->data, data_object->data_len); |
| | 389 | sc_pkcs15_free_data_object(data_object); |
| | 390 | } |