update to yubikey-manager-3.1.1
This commit is contained in:
parent
cdf5c54bc2
commit
ce59e21888
@ -1,8 +1,8 @@
|
||||
# $OpenBSD: Makefile,v 1.2 2019/12/11 03:48:00 kmos Exp $
|
||||
# $OpenBSD: Makefile,v 1.3 2020/01/30 14:24:19 sthen Exp $
|
||||
|
||||
COMMENT = library and CLI tool (ykman) for configuring a YubiKey
|
||||
|
||||
MODPY_EGG_VERSION = 3.1.0
|
||||
MODPY_EGG_VERSION = 3.1.1
|
||||
|
||||
DISTNAME = yubikey-manager-${MODPY_EGG_VERSION}
|
||||
YK_PROJECT = yubikey-manager
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (yubikey-manager-3.1.0.tar.gz) = ATes0wz/pgQh3egnezuwxdXiF5023w0ZDeb69+7HY1k=
|
||||
SIZE (yubikey-manager-3.1.0.tar.gz) = 115010
|
||||
SHA256 (yubikey-manager-3.1.1.tar.gz) = aO9BrDzS6JEBnnVaSSQn7N1j2IFlJdBfLzLDe4xEDPo=
|
||||
SIZE (yubikey-manager-3.1.1.tar.gz) = 116632
|
||||
|
@ -1,72 +0,0 @@
|
||||
$OpenBSD: patch-ykman_cli___main___py,v 1.1.1.1 2019/11/21 23:38:08 sthen Exp $
|
||||
|
||||
From c838a4d6f2a9350a6c1feb2956695d1a3c103f37 Mon Sep 17 00:00:00 2001
|
||||
From: Emil Lundberg <emil@yubico.com>
|
||||
Date: Tue, 29 Oct 2019 13:32:51 +0100
|
||||
Subject: [PATCH] Catch error when pcscd is not running
|
||||
|
||||
Index: ykman/cli/__main__.py
|
||||
--- ykman/cli/__main__.py.orig
|
||||
+++ ykman/cli/__main__.py
|
||||
@@ -28,6 +28,8 @@
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import ykman.logging_setup
|
||||
+import smartcard.pcsc.PCSCExceptions
|
||||
+
|
||||
from ykman import __version__
|
||||
from ..util import TRANSPORT, Cve201715361VulnerableError, YUBIKEY
|
||||
from ..native.pyusb import get_usb_backend_version
|
||||
@@ -221,26 +223,32 @@ def list_keys(ctx, serials, readers):
|
||||
|
||||
descriptors = get_descriptors()
|
||||
handled_serials = set()
|
||||
- for dev in list_devices():
|
||||
- if dev.key_type == YUBIKEY.SKY:
|
||||
- # We have nothing to match on, so just drop a SKY descriptor
|
||||
- d = next(x for x in descriptors if x.key_type == YUBIKEY.SKY)
|
||||
- descriptors.remove(d)
|
||||
- _print_device(dev, None)
|
||||
- else:
|
||||
- serial = dev.serial
|
||||
- if serial not in handled_serials:
|
||||
- # Drop a descriptor with a matching serial and mode
|
||||
- handled_serials.add(serial)
|
||||
- matches = [d for d in descriptors if (d.key_type, d.mode)
|
||||
- == (dev.driver.key_type, dev.driver.mode)]
|
||||
- if len(matches) > 0:
|
||||
- d = matches[0]
|
||||
- descriptors.remove(d)
|
||||
- _print_device(dev, serial)
|
||||
- dev.close()
|
||||
- if not descriptors:
|
||||
- break
|
||||
+
|
||||
+ try:
|
||||
+ for dev in list_devices(transports=TRANSPORT.CCID):
|
||||
+ if dev.key_type == YUBIKEY.SKY:
|
||||
+ # We have nothing to match on, so just drop a SKY descriptor
|
||||
+ d = next(x for x in descriptors if x.key_type == YUBIKEY.SKY)
|
||||
+ descriptors.remove(d)
|
||||
+ _print_device(dev, None)
|
||||
+ else:
|
||||
+ serial = dev.serial
|
||||
+ if serial not in handled_serials:
|
||||
+ # Drop a descriptor with a matching serial and mode
|
||||
+ handled_serials.add(serial)
|
||||
+ matches = [d for d in descriptors if (d.key_type, d.mode)
|
||||
+ == (dev.driver.key_type, dev.driver.mode)]
|
||||
+ if len(matches) > 0:
|
||||
+ d = matches[0]
|
||||
+ descriptors.remove(d)
|
||||
+ _print_device(dev, serial)
|
||||
+ dev.close()
|
||||
+ if not descriptors:
|
||||
+ break
|
||||
+ except smartcard.pcsc.PCSCExceptions.EstablishContextException as e:
|
||||
+ logger.error('Failed to list devices', exc_info=e)
|
||||
+ ctx.fail(
|
||||
+ 'Failed to establish CCID context. Is the pcscd service running?')
|
||||
|
||||
# List descriptors that failed to open.
|
||||
logger.debug('Failed to open all devices, listing based on descriptors')
|
Loading…
Reference in New Issue
Block a user