Skip to content

Commit 69efd88

Browse files
Ondrej Krc-Jedinykongeo
authored andcommitted
nfc: only append Le field in final APDU segment
1 parent 7ede5cd commit 69efd88

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/nfc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ tx_short_apdu(fido_dev_t *d, const iso7816_header_t *h, const uint8_t *payload,
3434
apdu[3] = h->p2;
3535
apdu[4] = payload_len;
3636
memcpy(&apdu[5], payload, payload_len);
37-
apdu_len = (size_t)(5 + payload_len + 1);
37+
apdu_len = (size_t)(5 + payload_len);
38+
39+
if (!(cla_flags & 0x10))
40+
apdu_len += 1;
3841

3942
if (d->io.write(d->io_handle, apdu, apdu_len) < 0) {
4043
fido_log_debug("%s: write", __func__);

0 commit comments

Comments
 (0)