Skip to content

Commit 4d8b2c1

Browse files
Jakujefrankmorgner
authored andcommitted
card-openpgp: Workaround parsing historical bytes on Yubikey to set correct capabilities
1 parent 26aed94 commit 4d8b2c1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/libopensc/card-openpgp.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,17 @@ pgp_get_card_features(sc_card_t *card)
710710
pgp_parse_hist_bytes(card, hist_bytes+2, hist_bytes_len-2);
711711
}
712712
break;
713+
default:
714+
/* Something else is non-standard according to
715+
* ISO7816-4 section 8 - Historical bytes,
716+
* but used by Yubico, which should have all
717+
* the needed capabilities*/
718+
if (hist_bytes_len >= 7 &&
719+
memcmp(hist_bytes, "Yubikey", 7) == 0) {
720+
card->caps |= SC_CARD_CAP_APDU_EXT;
721+
priv->ext_caps |= EXT_CAP_APDU_EXT
722+
| EXT_CAP_CHAINING;
723+
}
713724
}
714725
}
715726

0 commit comments

Comments
 (0)