From 7cab4d8cadccc24f0a7c8b39fac895cfda6eff1f Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Tue, 4 Dec 2012 20:11:32 +0100 Subject: [PATCH] only accept sequence 0 as success if no config is valid --- ykcore/ykcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ykcore/ykcore.c b/ykcore/ykcore.c index 2ad4a72..e65296b 100644 --- a/ykcore/ykcore.c +++ b/ykcore/ykcore.c @@ -209,7 +209,7 @@ static int _yk_write(YK_KEY *yk, uint8_t yk_cmd, unsigned char *buf, size_t len) /* when both configurations from a YubiKey is erased it will return * pgmSeq 0, if one is still configured after an erase pgmSeq is * counted up as usual. */ - if(stat.pgmSeq == 0) { + if((stat.touchLevel & (CONFIG1_VALID | CONFIG2_VALID)) == 0 && stat.pgmSeq == 0) { return 1; } return stat.pgmSeq != seq; -- 2.39.5