sm: misplaced check of the 'get-sm-apdus' return code
This commit is contained in:
parent
e34866f188
commit
49e7f529b2
|
@ -473,14 +473,13 @@ sc_single_sm_transmit(struct sc_card *card, struct sc_apdu *apdu)
|
||||||
|
|
||||||
/* get SM encoded APDU */
|
/* get SM encoded APDU */
|
||||||
rv = card->sm_ctx.ops.get_sm_apdu(card, apdu, &sm_apdu);
|
rv = card->sm_ctx.ops.get_sm_apdu(card, apdu, &sm_apdu);
|
||||||
LOG_TEST_RET(ctx, rv, "get SM APDU error");
|
|
||||||
|
|
||||||
if (rv == SC_ERROR_SM_NOT_APPLIED) {
|
if (rv == SC_ERROR_SM_NOT_APPLIED) {
|
||||||
/* SM wrap of this APDU is ignored by card driver.
|
/* SM wrap of this APDU is ignored by card driver.
|
||||||
* Send plain APDU to the reader driver */
|
* Send plain APDU to the reader driver */
|
||||||
rv = card->reader->ops->transmit(card->reader, apdu);
|
rv = card->reader->ops->transmit(card->reader, apdu);
|
||||||
LOG_FUNC_RETURN(ctx, rv);
|
LOG_FUNC_RETURN(ctx, rv);
|
||||||
}
|
}
|
||||||
|
LOG_TEST_RET(ctx, rv, "get SM APDU error");
|
||||||
|
|
||||||
/* check if SM APDU is still valid */
|
/* check if SM APDU is still valid */
|
||||||
rv = sc_check_apdu(card, sm_apdu);
|
rv = sc_check_apdu(card, sm_apdu);
|
||||||
|
|
Loading…
Reference in New Issue