Lines Matching +full:micro +full:- +full:ab

2  * Copyright (c) 2022 Micro Focus or one of its affiliates.
3 * Copyright (c) 2022 Yubico AB. All rights reserved.
4 * Use of this source code is governed by a BSD-style
6 * SPDX-License-Identifier: BSD-2-Clause
56 /* sanity check "multi-string" */ in list_readers()
61 if ((*buf)[len - 1] != 0 || (*buf)[len - 2] != '\0') { in list_readers()
84 n > READERS - 1) { in get_reader()
97 n--; in get_reader()
111 req->dwProtocol = SCARD_PCI_T0->dwProtocol; in prepare_io_request()
112 req->cbPciLength = SCARD_PCI_T0->cbPciLength; in prepare_io_request()
115 req->dwProtocol = SCARD_PCI_T1->dwProtocol; in prepare_io_request()
116 req->cbPciLength = SCARD_PCI_T1->cbPciLength; in prepare_io_request()
121 return -1; in prepare_io_request()
134 int ok = -1; in copy_info()
148 if (asprintf(&di->path, "%s//slot%zu", FIDO_PCSC_PREFIX, idx) == -1) { in copy_info()
149 di->path = NULL; in copy_info()
153 if (nfc_is_fido(di->path) == false) { in copy_info()
154 fido_log_debug("%s: nfc_is_fido: %s", __func__, di->path); in copy_info()
157 if ((di->manufacturer = strdup("PC/SC")) == NULL || in copy_info()
158 (di->product = strdup(reader)) == NULL) in copy_info()
166 free(di->path); in copy_info()
167 free(di->manufacturer); in copy_info()
168 free(di->product); in copy_info()
275 dev->ctx = ctx; in fido_pcsc_open()
276 dev->h = h; in fido_pcsc_open()
277 dev->req = req; in fido_pcsc_open()
295 if (dev->h != 0) in fido_pcsc_close()
296 SCardDisconnect(dev->h, SCARD_LEAVE_CARD); in fido_pcsc_close()
297 if (dev->ctx != 0) in fido_pcsc_close()
298 SCardReleaseContext(dev->ctx); in fido_pcsc_close()
300 explicit_bzero(dev->rx_buf, sizeof(dev->rx_buf)); in fido_pcsc_close()
311 if (dev->rx_len == 0 || dev->rx_len > len || in fido_pcsc_read()
312 dev->rx_len > sizeof(dev->rx_buf)) { in fido_pcsc_read()
314 return -1; in fido_pcsc_read()
316 fido_log_xxd(dev->rx_buf, dev->rx_len, "%s: reading", __func__); in fido_pcsc_read()
317 memcpy(buf, dev->rx_buf, dev->rx_len); in fido_pcsc_read()
318 explicit_bzero(dev->rx_buf, sizeof(dev->rx_buf)); in fido_pcsc_read()
319 r = (int)dev->rx_len; in fido_pcsc_read()
320 dev->rx_len = 0; in fido_pcsc_read()
334 return -1; in fido_pcsc_write()
337 explicit_bzero(dev->rx_buf, sizeof(dev->rx_buf)); in fido_pcsc_write()
338 dev->rx_len = 0; in fido_pcsc_write()
339 n = (DWORD)sizeof(dev->rx_buf); in fido_pcsc_write()
343 if ((s = SCardTransmit(dev->h, &dev->req, buf, (DWORD)len, NULL, in fido_pcsc_write()
344 dev->rx_buf, &n)) != SCARD_S_SUCCESS) { in fido_pcsc_write()
346 explicit_bzero(dev->rx_buf, sizeof(dev->rx_buf)); in fido_pcsc_write()
347 return -1; in fido_pcsc_write()
349 dev->rx_len = (size_t)n; in fido_pcsc_write()
351 fido_log_xxd(dev->rx_buf, dev->rx_len, "%s: read", __func__); in fido_pcsc_write()
377 if (d->io_handle != NULL) { in fido_dev_set_pcsc()
379 return -1; in fido_dev_set_pcsc()
381 d->io_own = true; in fido_dev_set_pcsc()
382 d->io = (fido_dev_io_t) { in fido_dev_set_pcsc()
388 d->transport = (fido_dev_transport_t) { in fido_dev_set_pcsc()