Skip to content

Commit

Permalink
nfc: chain rapdus in rx_init
Browse files Browse the repository at this point in the history
Some cards erroneously interpret Le=0 as requesting no response data.
When this happens, they send a 61nn response instead.
  • Loading branch information
LDVG committed Sep 16, 2024
1 parent ebc2d87 commit 2323ca4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nfc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022 Yubico AB. All rights reserved.
* Copyright (c) 2020-2024 Yubico AB. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
* SPDX-License-Identifier: BSD-2-Clause
Expand Down Expand Up @@ -249,7 +249,7 @@ rx_init(fido_dev_t *d, unsigned char *buf, size_t count, int ms)

memset(attr, 0, sizeof(*attr));

if ((n = d->io.read(d->io_handle, f, sizeof(f), ms)) < 2 ||
if ((n = rx_msg(d, f, sizeof(f), ms, false)) < 2 ||
(f[n - 2] << 8 | f[n - 1]) != SW_NO_ERROR) {
fido_log_debug("%s: read", __func__);
return -1;
Expand Down

0 comments on commit 2323ca4

Please sign in to comment.