pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/security/py-yubikey-manager



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Sun Dec 14 13:15:04 UTC 2025

Modified Files:
        pkgsrc/security/py-yubikey-manager: Makefile distinfo
        pkgsrc/security/py-yubikey-manager/patches: patch-ykman_hid_netbsd.py

Log Message:
security/py-yubikey-manager: Fix uhid(4) handling for fido subcommand for NetBSD

* Define NetBSD specific values and structs for ioctl(2).
* Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 pkgsrc/security/py-yubikey-manager/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/security/py-yubikey-manager/distinfo
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/security/py-yubikey-manager/patches/patch-ykman_hid_netbsd.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/security/py-yubikey-manager/Makefile
diff -u pkgsrc/security/py-yubikey-manager/Makefile:1.19 pkgsrc/security/py-yubikey-manager/Makefile:1.20
--- pkgsrc/security/py-yubikey-manager/Makefile:1.19    Fri Oct 31 14:56:39 2025
+++ pkgsrc/security/py-yubikey-manager/Makefile Sun Dec 14 13:15:03 2025
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.19 2025/10/31 14:56:39 ryoon Exp $
+# $NetBSD: Makefile,v 1.20 2025/12/14 13:15:03 ryoon Exp $
 
 .include "../../security/ykman/version.mk"
 
 DISTNAME=      yubikey_manager-${VERSION}
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME:S/_/-/}
+PKGREVISION=   1
 CATEGORIES=    security sysutils
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=Yubico/}
 GITHUB_PROJECT=        yubikey-manager

Index: pkgsrc/security/py-yubikey-manager/distinfo
diff -u pkgsrc/security/py-yubikey-manager/distinfo:1.12 pkgsrc/security/py-yubikey-manager/distinfo:1.13
--- pkgsrc/security/py-yubikey-manager/distinfo:1.12    Fri Oct 31 14:56:39 2025
+++ pkgsrc/security/py-yubikey-manager/distinfo Sun Dec 14 13:15:03 2025
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.12 2025/10/31 14:56:39 ryoon Exp $
+$NetBSD: distinfo,v 1.13 2025/12/14 13:15:03 ryoon Exp $
 
 BLAKE2s (yubikey_manager-5.8.0.tar.gz) = c3b01d48edd26fbfa1b2c652f58ea2576eae9e094e32756265b7c3dd3655b110
 SHA512 (yubikey_manager-5.8.0.tar.gz) = 8c22dd65e37d4bc78a16c62b24244f2cd180237354d4b325d2786614ef75651104eb92a0ad751f66af7812746669b397e4cab7ed41c9016cb73081f6740ca604
 Size (yubikey_manager-5.8.0.tar.gz) = 228631 bytes
 SHA1 (patch-ykman_hid_____init____.py) = 916a119019484ae5d6dec3a0f499250bab86b774
-SHA1 (patch-ykman_hid_netbsd.py) = 473c0e8a0c2c945bc6135daec1c765b859c00cd8
+SHA1 (patch-ykman_hid_netbsd.py) = f97abae1ed3f9bebf48c58910a4b3030dcf75f01

Index: pkgsrc/security/py-yubikey-manager/patches/patch-ykman_hid_netbsd.py
diff -u pkgsrc/security/py-yubikey-manager/patches/patch-ykman_hid_netbsd.py:1.1 pkgsrc/security/py-yubikey-manager/patches/patch-ykman_hid_netbsd.py:1.2
--- pkgsrc/security/py-yubikey-manager/patches/patch-ykman_hid_netbsd.py:1.1    Fri Oct 31 14:56:39 2025
+++ pkgsrc/security/py-yubikey-manager/patches/patch-ykman_hid_netbsd.py        Sun Dec 14 13:15:03 2025
@@ -1,10 +1,10 @@
-$NetBSD: patch-ykman_hid_netbsd.py,v 1.1 2025/10/31 14:56:39 ryoon Exp $
+$NetBSD: patch-ykman_hid_netbsd.py,v 1.2 2025/12/14 13:15:03 ryoon Exp $
 
 * For NetBSD. Copied from freebsd.py.
 
---- ykman/hid/netbsd.py.orig   2025-10-31 07:41:33.798174909 +0000
+--- ykman/hid/netbsd.py.orig   2025-12-14 00:19:41.651361866 +0000
 +++ ykman/hid/netbsd.py
-@@ -0,0 +1,188 @@
+@@ -0,0 +1,179 @@
 +# Original work Copyright 2016 Google Inc. All Rights Reserved.
 +#
 +# Licensed under the Apache License, Version 2.0 (the "License");
@@ -49,34 +49,29 @@ $NetBSD: patch-ykman_hid_netbsd.py,v 1.1
 +
 +devdir = "/dev/"
 +
-+# /usr/include/dev/usb/usb_ioctl.h
-+USB_GET_REPORT = 0xC0205517
-+USB_SET_REPORT = 0x80205518
-+USB_GET_REPORT_DESC = 0xC0205515
++# /usr/include/dev/usb/usb.h
++USB_GET_REPORT = 0xc4045517
++USB_SET_REPORT = 0x84045518
++USB_GET_REPORT_DESC = 0x44045515
++
++# /usr/src/sys/dev/usb/usbhid.h
++UHID_FEATURE_REPORT = 0x03
 +
 +# For UhidConnection
 +libc = ctypes.CDLL(find_library("c"))
 +
 +
-+class usb_gen_descriptor(ctypes.Structure):
++class usb_ctl_report(ctypes.Structure):
 +    _fields_ = [
-+        (
-+            "ugd_data",
-+            ctypes.c_void_p,
-+        ),
-+        ("ugd_lang_id", ctypes.c_uint16),
-+        ("ugd_maxlen", ctypes.c_uint16),
-+        ("ugd_actlen", ctypes.c_uint16),
-+        ("ugd_offset", ctypes.c_uint16),
-+        ("ugd_config_index", ctypes.c_uint8),
-+        ("ugd_string_index", ctypes.c_uint8),
-+        ("ugd_iface_index", ctypes.c_uint8),
-+        ("ugd_altif_index", ctypes.c_uint8),
-+        ("ugd_endpt_index", ctypes.c_uint8),
-+        ("ugd_report_type", ctypes.c_uint8),
-+        ("reserved", ctypes.c_uint8 * 8),
++        ("ucr_report", ctypes.c_int),
++        ("ucr_data", ctypes.c_ubyte),
 +    ]
 +
++class usb_ctl_report_desc(ctypes.Structure):
++    _fields_ = [
++        ("ucrd_size", ctypes.c_int),
++        ("ucrd_data", ctypes.c_ubyte),
++    ]
 +
 +class UhidConnection(OtpConnection):
 +    """
@@ -90,11 +85,10 @@ $NetBSD: patch-ykman_hid_netbsd.py,v 1.1
 +        os.close(self.fd)
 +
 +    def receive(self):
-+        buf = ctypes.create_string_buffer(9)
-+        desc = usb_gen_descriptor(
-+            ugd_data=ctypes.addressof(buf),
-+            ugd_maxlen=ctypes.sizeof(buf),
-+            ugd_report_type=3,
++        buf = ctypes.create_string_buffer(1024)
++        desc = usb_ctl_report(
++            ucr_report=UHID_FEATURE_REPORT,
++            ucr_data=ctypes.addressof(buf),
 +        )
 +        ret = libc.ioctl(self.fd, USB_GET_REPORT, ctypes.pointer(desc))
 +        if ret != 0:
@@ -103,14 +97,13 @@ $NetBSD: patch-ykman_hid_netbsd.py,v 1.1
 +        return buf.raw[:-1]
 +
 +    def send(self, data):
-+        buf = ctypes.create_string_buffer(8)
++        buf = ctypes.create_string_buffer(1024)
 +        for i in range(0, len(data)):
 +            buf[i] = data[i]
 +
-+        desc = usb_gen_descriptor(
-+            ugd_data=ctypes.addressof(buf),
-+            ugd_maxlen=len(buf),
-+            ugd_report_type=0x3,
++        desc = usb_ctl_report(
++            ucr_report=UHID_FEATURE_REPORT,
++            ucr_data=ctypes.addressof(buf),
 +        )
 +        ret = libc.ioctl(self.fd, USB_SET_REPORT, ctypes.pointer(desc))
 +        if ret != 0:
@@ -118,11 +111,9 @@ $NetBSD: patch-ykman_hid_netbsd.py,v 1.1
 +
 +    @staticmethod
 +    def get_usage(dev):
-+        c_data = ctypes.create_string_buffer(4096)
-+        desc = usb_gen_descriptor(
-+            ugd_data=ctypes.addressof(c_data),
-+            ugd_maxlen=ctypes.sizeof(c_data),
-+            ugd_report_type=3,
++        c_data = ctypes.create_string_buffer(1024)
++        desc = usb_ctl_report_desc(
++            ucrd_data=ctypes.addressof(c_data),
 +        )
 +        ret = libc.ioctl(dev, USB_GET_REPORT_DESC, ctypes.pointer(desc))
 +        if ret != 0:



Home | Main Index | Thread Index | Old Index