Skip to content

Commit b83c358

Browse files
committed
openpgp: ignore errors on SELECT DATA for OpenPGP 2 and below
fixes #2752
1 parent 4e9f4e0 commit b83c358

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/libopensc/pkcs15-openpgp.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -556,14 +556,9 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
556556
memset(&cert_info, 0, sizeof(cert_info));
557557
memset(&cert_obj, 0, sizeof(cert_obj));
558558

559-
/* only try to SELECT DATA for OpenPGP >= v3 */
560-
if (card->type >= SC_CARD_TYPE_OPENPGP_V3) {
561-
r = sc_card_ctl(card, SC_CARDCTL_OPENPGP_SELECT_DATA, &i);
562-
if (r < 0) {
563-
free(buffer);
564-
LOG_TEST_RET(card->ctx, r, "Failed OpenPGP - select data");
565-
}
566-
}
559+
/* try to SELECT DATA. Will only work for OpenPGP >= v3, errors are non-critical */
560+
sc_card_ctl(card, SC_CARDCTL_OPENPGP_SELECT_DATA, &i);
561+
567562
sc_format_path(certs[i].path, &cert_info.path);
568563

569564
/* Certificate ID. We use the same ID as the authentication key */

0 commit comments

Comments
 (0)