AfRApay.FTM: Ignore Yubikeys

This commit is contained in:
embr 2023-02-08 16:34:46 +01:00
parent 7485af098b
commit bf670864d7

View file

@ -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);