Skip to content

Commit

Permalink
idrpime: Get applet version based on (OpenSC#2953)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakuje committed Feb 7, 2024
1 parent 7dcfe6e commit 4deace2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/libopensc/card-idprime.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,19 @@ static int idprime_init(sc_card_t *card)
r, apdu.resplen);
}

/* Proprietary data -- Applet version */
sc_format_apdu(card, &apdu, SC_APDU_CASE_2, 0xCA, 0xDF, 0x30);
apdu.resp = rbuf;
apdu.resplen = rbuflen;
apdu.le = rbuflen;
r = sc_transmit_apdu(card, &apdu);
if (r == SC_SUCCESS && apdu.resplen >= 10) {
/* Ber-TLV encoded */
if (rbuf[0] == 0xDF && rbuf[1] == 0x30 && rbuf[2] == apdu.resplen - 3) {
sc_log(card->ctx, "IDPrime Java Applet version %.*s", (int)apdu.resplen - 3, rbuf + 3);
}
}

priv = idprime_new_private_data();
if (!priv) {
LOG_FUNC_RETURN(card->ctx, SC_ERROR_OUT_OF_MEMORY);
Expand Down

0 comments on commit 4deace2

Please sign in to comment.