FreeBSD Bugzilla – Attachment 207347 Details for
Bug 240476
security/py-fido2: Add FreeBSD support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to support fido/u2f on FreeBSD
patch-py-fido2-freebsd.txt (text/plain), 3.72 KB, created by
Michael Gmelin
on 2019-09-10 15:40:41 UTC
(
hide
)
Description:
Patch to support fido/u2f on FreeBSD
Filename:
MIME Type:
Creator:
Michael Gmelin
Created:
2019-09-10 15:40:41 UTC
Size:
3.72 KB
patch
obsolete
>Index: security/py-fido2/Makefile >=================================================================== >--- security/py-fido2/Makefile (revision 511759) >+++ security/py-fido2/Makefile (working copy) >@@ -2,6 +2,7 @@ > > PORTNAME= fido2 > PORTVERSION= 0.7.0 >+PORTREVISION= 1 > CATEGORIES= security python > MASTER_SITES= CHEESESHOP > PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} >@@ -14,7 +15,8 @@ > > RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cryptography>=1.5:security/py-cryptography@${PY_FLAVOR} \ > ${PY_ENUM34} \ >- ${PYTHON_PKGNAMEPREFIX}six>=0:devel/py-six@${PY_FLAVOR} >+ ${PYTHON_PKGNAMEPREFIX}six>=0:devel/py-six@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}uhid-freebsd>=0:devel/py-uhid-freebsd@${PY_FLAVOR} > > USES= python > USE_PYTHON= autoplist distutils >Index: security/py-fido2/files/patch-fido2___pyu2f_____init____.py >=================================================================== >--- security/py-fido2/files/patch-fido2___pyu2f_____init____.py (nonexistent) >+++ security/py-fido2/files/patch-fido2___pyu2f_____init____.py (working copy) >@@ -0,0 +1,12 @@ >+--- fido2/_pyu2f/__init__.py.orig 2019-09-10 15:15:37 UTC >++++ fido2/_pyu2f/__init__.py >+@@ -47,6 +47,9 @@ def InternalPlatformSwitch(funcname, *args, **kwargs): >+ elif sys.platform.startswith('darwin'): >+ from . import macos >+ clz = macos.MacOsHidDevice >++ elif sys.platform.startswith('freebsd'): >++ from . import freebsd >++ clz = freebsd.FreeBSDHidDevice >+ >+ if not clz: >+ raise Exception('Unsupported platform: ' + sys.platform) > >Property changes on: security/py-fido2/files/patch-fido2___pyu2f_____init____.py >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: security/py-fido2/files/patch-fido2___pyu2f_freebsd.py >=================================================================== >--- security/py-fido2/files/patch-fido2___pyu2f_freebsd.py (nonexistent) >+++ security/py-fido2/files/patch-fido2___pyu2f_freebsd.py (working copy) >@@ -0,0 +1,38 @@ >+--- fido2/_pyu2f/freebsd.py.orig 2019-09-10 15:17:18 UTC >++++ fido2/_pyu2f/freebsd.py >+@@ -0,0 +1,35 @@ >++from __future__ import absolute_import >++ >++import os >++import uhid_freebsd >++ >++from . import linux >++ >++class FreeBSDHidDevice(linux.LinuxHidDevice): >++ """Implementation of HID device for FreeBSD. >++ """ >++ >++ @staticmethod >++ def Enumerate(): >++ for dev in uhid_freebsd.enumerate(): >++ desc = linux.base.DeviceDescriptor() >++ desc.path = dev["path"] >++ desc.vendor_id = dev["vendor_id"] >++ desc.product_id = dev["product_id"] >++ desc.product_string = dev["product_desc"] >++ fd = os.open(desc.path, os.O_RDONLY) >++ linux.ParseReportDescriptor(uhid_freebsd.get_report_data(fd, 3), desc) >++ os.close(fd) >++ yield desc.ToPublicDict() >++ >++ def __init__(self, path): >++ linux.base.HidDevice.__init__(self, path) >++ self.dev = os.open(path, os.O_RDWR) >++ self.desc = linux.base.DeviceDescriptor() >++ self.desc.path = path >++ linux.ParseReportDescriptor(uhid_freebsd.get_report_data(self.dev, 3), self.desc) >++ >++ def Write(self, packet): >++ """See base class.""" >++ out = bytes(bytearray([0]*64 + packet)) # Prepend the zero-byte (report ID) >++ os.write(self.dev, out) > >Property changes on: security/py-fido2/files/patch-fido2___pyu2f_freebsd.py >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 240476
:
207347
|
207433
|
207434
|
207435
|
207436
|
207437
|
207438
|
207439
|
207441
|
207444
|
207445
|
207468
|
207486