From nobody Thu Jun 09 23:20:43 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 51C9283F04D; Thu, 9 Jun 2022 23:20:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LK0Sr1b6Gz4f1X; Thu, 9 Jun 2022 23:20:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654816844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OdYqATI8zw1gUmDgz/wCJ2UxAxI+Rccfuqrslk54K3g=; b=Khy6Bq7ctPhXbV9vVZ1fZVMY1pPZutXkhH6cTdkCQRGrDhPUGHPq0e7+3sYBWexruf/3nC WdYqLMIGoHFL9gsBYz1bYd3EATDZbq5JVaYmWJsDBx/+cgnW8l9pvl9+8xY8dlJYB8epBz KK3jQykR8TumL9oG/ONkBfeft2c9YX3WUgXQN4PtFDqEdW3hNEQuuC0xCVP1g3eaSZvHsd Aux3Ny5JSkUduBvWlMeRr9jiawdyqJS735+tTkUayZY5awreeXvBlQY1HdXm86HMlCAT5k ruA/uYiYBv8sbFXQZ3zD5Q2B1C+r8kXwwHurvx2XCj4kwWP8bBjQzF6amGdpXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B4D0525C; Thu, 9 Jun 2022 23:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 259NKhAC052524; Thu, 9 Jun 2022 23:20:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 259NKh8C052523; Thu, 9 Jun 2022 23:20:43 GMT (envelope-from git) Date: Thu, 9 Jun 2022 23:20:43 GMT Message-Id: <202206092320.259NKh8C052523@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 232a658e49f8 - main - security/py-fido2: Update to 1.0.0 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 232a658e49f8a72efd8dcacfb50c930eed3bf0c9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654816844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OdYqATI8zw1gUmDgz/wCJ2UxAxI+Rccfuqrslk54K3g=; b=AFHyiPHv0umlkjGpMsBrxLHa2BCVeiCe0zihHo4wzZtYeQN8gHaL/twPHWyzImiLh2qSYZ RM/fl2zeUEARTwaEQXdVxb3u17vwfp9t/cZXZTAJif6yt4lb4vGAIHxhz8YE/wDsr3C0d2 0x1bcJsDHvelLoqhnoaqJuyGi6KSePEd0lqdTvxRx35DCA7iehXDbfVHUJvsAcGzra8rFO r2PtmMSiY1uzSjIBYQgOWtVXQnHzL6bc8ZRekML0VL3v9Ax0k1NWhIaEP5RYd/mj/zO7B7 swfYbd31IrzVCTFotzewl16zT+f4/JBgkry1yEzN/aF3ZTcnQWxDOpakjLYvHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654816844; a=rsa-sha256; cv=none; b=RPwFu2ekL+GpIG8x1QYXqJs6/fDeCWYqDVKWNg5ZKcbq89MHndWZ20OVUJDvPYaOfGd/B7 Cav4STTXiN7bQ0c+GBrMW8MY09HB4LOa6KCyiIBHAFBeXH6KhKOvbBRM6glFMFWuexZ+kK +KeexjMNN7N4SMP7fVFLCwCuDtzSIBWf2kYLzHDuBUHsFQ0/FRkFGbPFC2YtnfOP3i1dBC DCuQc6Ra1FRo0KP+ilAo5dzGSzTXnYm15fcBBlvjBxJWmg75AthPEQjvNAkqMS89qu6PnQ a/pXC0mIZl5TOfFTMiy+plgVrWgtmsCTo9Dh6wTjmaDB9SPBka+FZHD/HFafQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=232a658e49f8a72efd8dcacfb50c930eed3bf0c9 commit 232a658e49f8a72efd8dcacfb50c930eed3bf0c9 Author: Po-Chuan Hsieh AuthorDate: 2022-06-09 23:12:37 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-06-09 23:16:15 +0000 security/py-fido2: Update to 1.0.0 Changes: https://github.com/Yubico/python-fido2/releases --- security/py-fido2/Makefile | 7 +- security/py-fido2/distinfo | 6 +- security/py-fido2/files/patch-fido2_hid_freebsd.py | 222 --------------------- 3 files changed, 6 insertions(+), 229 deletions(-) diff --git a/security/py-fido2/Makefile b/security/py-fido2/Makefile index a2176170c194..618df08a6230 100644 --- a/security/py-fido2/Makefile +++ b/security/py-fido2/Makefile @@ -1,6 +1,5 @@ PORTNAME= fido2 -PORTVERSION= 0.9.3 -PORTREVISION= 1 +PORTVERSION= 1.0.0 CATEGORIES= security python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -11,11 +10,11 @@ COMMENT= Provides library functionality for FIDO 2.0 LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/COPYING -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cryptography>=1.5:security/py-cryptography@${PY_FLAVOR} \ +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cryptography>=2.6<40:security/py-cryptography@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}six>=0:devel/py-six@${PY_FLAVOR} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock@${PY_FLAVOR} -USES= python:3.6+ +USES= python:3.7+ USE_PYTHON= autoplist distutils unittest NO_ARCH= yes diff --git a/security/py-fido2/distinfo b/security/py-fido2/distinfo index eae663e9397e..04b2a986ff51 100644 --- a/security/py-fido2/distinfo +++ b/security/py-fido2/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1641046846 -SHA256 (fido2-0.9.3.tar.gz) = b45e89a6109cfcb7f1bb513776aa2d6408e95c4822f83a253918b944083466ec -SIZE (fido2-0.9.3.tar.gz) = 217894 +TIMESTAMP = 1654774136 +SHA256 (fido2-1.0.0.tar.gz) = 2509a4958b666d747fd5754dfa9357da2d81b52edc0ecff75b68cea939154c02 +SIZE (fido2-1.0.0.tar.gz) = 245631 diff --git a/security/py-fido2/files/patch-fido2_hid_freebsd.py b/security/py-fido2/files/patch-fido2_hid_freebsd.py deleted file mode 100644 index 78836b3c4d06..000000000000 --- a/security/py-fido2/files/patch-fido2_hid_freebsd.py +++ /dev/null @@ -1,222 +0,0 @@ -See https://github.com/Yubico/python-fido2/commit/2a202d0e19fdb7be ---- fido2/hid/freebsd.py.orig 2022-05-27 09:25:33 UTC -+++ fido2/hid/freebsd.py -@@ -15,19 +15,39 @@ - # Modified work Copyright 2020 Yubico AB. All Rights Reserved. - # This file, with modifications, is licensed under the above Apache License. - -+# FreeBSD HID driver. -+# -+# There are two options to access UHID on FreeBSD: -+# -+# hidraw(4) - New method, not enabled by default -+# on FreeBSD 13.x and earlier -+# uhid(4) - Classic method, default option on -+# FreeBSD 13.x and earlier -+# -+# uhid is available since FreeBSD 13 and can be activated by adding -+# `hw.usb.usbhid.enable="1"` to `/boot/loader.conf`. The actual kernel -+# module is loaded with `kldload hidraw`. - --from __future__ import absolute_import -+from __future__ import annotations - - from ctypes.util import find_library - import ctypes -+import fcntl - import glob - import re -+import struct - import os -+from array import array - - from .base import HidDescriptor, parse_report_descriptor, FileCtapHidConnection - - import logging -+import sys -+from typing import Dict, Optional, Set, Union - -+# Don't typecheck this file on Windows -+assert sys.platform != "win32" # nosec -+ - logger = logging.getLogger(__name__) - - -@@ -39,9 +59,17 @@ sernum_re = re.compile('sernum="([^"]+)') - - libc = ctypes.CDLL(find_library("c")) - -+# /usr/include/dev/usb/usb_ioctl.h - USB_GET_REPORT_DESC = 0xC0205515 - -+# /usr/include/dev/hid/hidraw.h> -+HIDIOCGRAWINFO = 0x40085520 -+HIDIOCGRDESC = 0x2000551F -+HIDIOCGRDESCSIZE = 0x4004551E -+HIDIOCGRAWNAME_128 = 0x40805521 -+HIDIOCGRAWUNIQ_64 = 0x40405525 - -+ - class usb_gen_descriptor(ctypes.Structure): - _fields_ = [ - ( -@@ -62,8 +90,17 @@ class usb_gen_descriptor(ctypes.Structure): - ] - - -+class HidrawCtapHidConnection(FileCtapHidConnection): -+ def write_packet(self, packet): -+ # Prepend the report ID -+ super(HidrawCtapHidConnection, self).write_packet(b"\0" + packet) -+ -+ - def open_connection(descriptor): -- return FileCtapHidConnection(descriptor) -+ if descriptor.path.find(devdir + "hidraw") == 0: -+ return HidrawCtapHidConnection(descriptor) -+ else: -+ return FileCtapHidConnection(descriptor) - - - def _get_report_data(fd, report_type): -@@ -71,7 +108,7 @@ def _get_report_data(fd, report_type): - desc = usb_gen_descriptor( - ugd_data=ctypes.addressof(data), - ugd_maxlen=ctypes.sizeof(data), -- report_type=report_type, -+ ugd_report_type=report_type, - ) - ret = libc.ioctl(fd, USB_GET_REPORT_DESC, ctypes.byref(desc)) - if ret != 0: -@@ -104,16 +141,16 @@ def _enumerate(): - if retval != 0: - continue - -- dev = {} -+ dev: Dict[str, Optional[Union[str, int]]] = {} - dev["name"] = uhid[len(devdir) :] - dev["path"] = uhid - - value = ovalue.value[: olen.value].decode() - m = vendor_re.search(value) -- dev["vendor_id"] = m.group(1) if m else None -+ dev["vendor_id"] = int(m.group(1), 16) if m else None - - m = product_re.search(value) -- dev["product_id"] = m.group(1) if m else None -+ dev["product_id"] = int(m.group(1), 16) if m else None - - m = sernum_re.search(value) - dev["serial_number"] = m.group(1) if m else None -@@ -126,7 +163,49 @@ def _enumerate(): - yield dev - - -+def get_hidraw_descriptor(path): -+ with open(path, "rb") as f: -+ # Read VID, PID -+ buf = array("B", [0] * (4 + 2 + 2)) -+ fcntl.ioctl(f, HIDIOCGRAWINFO, buf, True) -+ _, vid, pid = struct.unpack(" 1 else None -+ -+ # Read unique ID -+ try: -+ buf = array("B", [0] * 65) -+ fcntl.ioctl(f, HIDIOCGRAWUNIQ_64, buf, True) -+ length = buf.index(0) + 1 # emulate ioctl return value -+ serial = ( -+ bytearray(buf[: (length - 1)]).decode("utf-8") if length > 1 else None -+ ) -+ except OSError: -+ serial = None -+ -+ # Read report descriptor -+ buf = array("B", [0] * 4) -+ fcntl.ioctl(f, HIDIOCGRDESCSIZE, buf, True) -+ size = struct.unpack("