From 94306ba71b2ad8117639c53bc18ffc0d40d9822b Mon Sep 17 00:00:00 2001 From: embr Date: Wed, 8 Feb 2023 16:34:46 +0100 Subject: [PATCH] AfRApay.FTM: Ignore Yubikeys --- AfRApay.FTM/Program.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AfRApay.FTM/Program.cs b/AfRApay.FTM/Program.cs index c0e52a7..d213576 100644 --- a/AfRApay.FTM/Program.cs +++ b/AfRApay.FTM/Program.cs @@ -16,8 +16,12 @@ rootCommand.Add(webAddrOption); rootCommand.SetHandler((listReaders, webAddr) => { using (var context = ContextFactory.Instance.Establish(SCardScope.System)) { + // Ignore Yubikeys. + var readerNames = context.GetReaders() + .Where((readerName) => !readerName.Contains("Yubico")) + .ToArray(); + // We need at least one card reader or this won't work! - var readerNames = context.GetReaders(); if (readerNames.Length == 0) { Console.Error.WriteLine("Error: no card reader detected"); Environment.Exit(1);