security/py-yubikey-manager: patch missing FreeBSD backend support

PR:		254580
Reported by:	nwhitehorn
This commit is contained in:
Vinícius Zavam 2021-04-19 19:57:38 +00:00
parent 6c92546a2c
commit 99b3ddf04f
No known key found for this signature in database
GPG Key ID: 415C653413B43475
2 changed files with 22 additions and 0 deletions

View File

@ -1,5 +1,6 @@
PORTNAME= yubikey-manager
PORTVERSION= 4.0.2
PORTREVISION= 1
CATEGORIES= security python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

View File

@ -0,0 +1,21 @@
--- ykman/hid/__init__.py.orig 2021-04-12 07:23:08 UTC
+++ ykman/hid/__init__.py
@@ -42,12 +42,15 @@ elif sys.platform.startswith("win32"):
from . import windows as backend
elif sys.platform.startswith("darwin"):
from . import macos as backend
+elif sys.platform.startswith("freebsd"):
+ backend = None
else:
raise Exception("Unsupported platform")
-
-list_otp_devices: Callable[[], List[OtpYubiKeyDevice]] = backend.list_devices
-
+if backend is not None:
+ list_otp_devices: Callable[[], List[OtpYubiKeyDevice]] = backend.list_devices
+else:
+ list_otp_devices: Callable[[], List[OtpYubiKeyDevice]] = lambda: []
class CtapYubiKeyDevice(YkmanDevice):
"""YubiKey FIDO USB HID device"""