From ab2658a648acc90d63f453cfbaca2970525e7e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20K=C3=B6lbel?= Date: Tue, 19 Apr 2016 14:10:06 +0200 Subject: Reset the HOTP counter If the token was initialized earlier the HOTP counter could be unequal zero resulting in faliing tests. This resets the counter of this slot to 0. --- unittest/test_HOTP.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'unittest') diff --git a/unittest/test_HOTP.cc b/unittest/test_HOTP.cc index b263693..1f54376 100644 --- a/unittest/test_HOTP.cc +++ b/unittest/test_HOTP.cc @@ -59,6 +59,8 @@ TEST_CASE("Test HOTP codes according to RFC", "[HOTP]") { //strcpy(reinterpret_cast(hwrite.slot_secret), ""); const char* secretHex = "3132333435363738393031323334353637383930"; hexStringToByte(hwrite.slot_secret, secretHex); + // reset the HOTP counter + memset(hwrite.slot_counter, 0, 8); //hwrite.slot_config; //TODO check various configs in separate test cases //strcpy(reinterpret_cast(hwrite.slot_token_id), ""); //strcpy(reinterpret_cast(hwrite.slot_counter), ""); -- cgit v1.2.1