Fix returning error message.

If return code is not 0x9000, RAPDU is cleared.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2022-06-03 16:04:31 +02:00
parent 8bdcfa1041
commit 07305e6fd7
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -340,6 +340,8 @@ int process_apdu() {
uint16_t set_res_sw(uint8_t sw1, uint8_t sw2) {
apdu.sw = (sw1 << 8) | sw2;
if (sw1 != 0x90 || sw2 != 0x00)
res_APDU_size = 0;
return make_uint16_t(sw1, sw2);
}