public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-fido2] epel10.2: Add patch for pyscard 2.2.2 support
@ 2026-08-21 13:51 Orion Poplawski
  0 siblings, 0 replies; only message in thread
From: Orion Poplawski @ 2026-08-21 13:51 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-fido2
Branch : epel10.2
Commit : 3b21f6d9923a0ab7fadc621929b423dd055c2bfe
Author : Orion Poplawski <orion@nwra.com>
Date   : 2026-08-20T22:06:37-06:00
Stats  : +44/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-fido2/c/3b21f6d9923a0ab7fadc621929b423dd055c2bfe?branch=epel10.2

Log:
Add patch for pyscard 2.2.2 support

---
diff --git a/0002-pyscard-2.2.2-support.patch b/0002-pyscard-2.2.2-support.patch
new file mode 100644
index 0000000..419d048
--- /dev/null
+++ b/0002-pyscard-2.2.2-support.patch
@@ -0,0 +1,43 @@
+From 2462fdfa5a01ea05b5d492a2e401ab174ec2b42d Mon Sep 17 00:00:00 2001
+From: rpm-build <rpm-build>
+Date: Thu, 20 Aug 2026 21:57:37 -0600
+Subject: [PATCH 2/2] pyscard 2.2.2 support
+
+---
+ fido2/pcsc.py | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/fido2/pcsc.py b/fido2/pcsc.py
+index a151449..8b62a45 100644
+--- a/fido2/pcsc.py
++++ b/fido2/pcsc.py
+@@ -34,7 +34,6 @@ from .utils import LOG_LEVEL_TRAFFIC
+ from smartcard import System
+ from smartcard.CardConnection import CardConnection
+ from smartcard.pcsc.PCSCExceptions import ListReadersException
+-from smartcard.pcsc.PCSCContext import PCSCContext
+ 
+ from threading import Event
+ from typing import Tuple, Optional, Callable, Iterator
+@@ -243,9 +242,15 @@ class CtapPcscDevice(CtapDevice):
+ def _list_readers():
+     try:
+         return System.readers()
+-    except ListReadersException:
++    except ListReadersException as e:
+         # If the PCSC system has restarted the context might be stale, try
+         # forcing a new context (This happens on Windows if the last reader is
+         # removed):
+-        PCSCContext.instance = None
+-        return System.readers()
++        try:
++            from smartcard.pcsc.PCSCContext import PCSCContext
++
++            PCSCContext.instance = None
++            return System.readers()
++        except ImportError:
++            # As of pyscard 2.2.2 the PCSCContext singleton has been removed
++            raise e
+-- 
+2.55.0
+

diff --git a/python-fido2.spec b/python-fido2.spec
index f279bdc..f83f9da 100644
--- a/python-fido2.spec
+++ b/python-fido2.spec
@@ -14,6 +14,7 @@ URL:            https://github.com/Yubico/python-fido2
 Source0:        https://github.com/Yubico/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
 # Fix build with cryptography 45+
 Patch0:         0001-cryptography-dep.patch
+Patch1:         0002-pyscard-2.2.2-support.patch
 
 BuildArch:      noarch
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-21 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-21 13:51 [rpms/python-fido2] epel10.2: Add patch for pyscard 2.2.2 support Orion Poplawski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox