summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrees <rees@openbsd.org>2001-07-17 16:57:41 +0000
committerrees <rees@openbsd.org>2001-07-17 16:57:41 +0000
commitd203e23ddd1076925b6be00dcd762e8f665f6adc (patch)
treebbd1a8f332c2b3b09918a5b6b778453acba4ee09
parentoops, missed a return (diff)
downloadwireguard-openbsd-d203e23ddd1076925b6be00dcd762e8f665f6adc.tar.xz
wireguard-openbsd-d203e23ddd1076925b6be00dcd762e8f665f6adc.zip
ignore atr from card if using dummy atr
-rw-r--r--lib/libsectok/todos_atr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libsectok/todos_atr.c b/lib/libsectok/todos_atr.c
index 850f5d091c6..b012388e7f6 100644
--- a/lib/libsectok/todos_atr.c
+++ b/lib/libsectok/todos_atr.c
@@ -1,4 +1,4 @@
-/* $Id: todos_atr.c,v 1.6 2001/07/02 20:07:09 rees Exp $ */
+/* $Id: todos_atr.c,v 1.7 2001/07/17 16:57:41 rees Exp $ */
/*
copyright 1997, 1999, 2000
@@ -171,6 +171,9 @@ todos_get_atr(int ttyn, int flags, unsigned char *atr, struct scparam *param)
int hiproto = 0;
if (flags & SCRFORCE) {
+ /* drain and ignore any atr bytes returned by the card */
+ while (scgetc(ttyn, atr, BYTETIME) == SCEOK)
+ ;
len = sizeof dummyatr;
memcpy(atr, dummyatr, len);
param->t = 0;