From af1e72475cc3f1cfc7cadece162e2231610c8cd0 Mon Sep 17 00:00:00 2001 From: Elie Tournier Date: Tue, 18 Apr 2017 13:38:34 +0100 Subject: Rename devices: s/Stick10/Device_NKPro and s/Stick20/Device_NKStorage Signed-off-by: Elie Tournier --- NitrokeyManager.cc | 6 +++--- device.cc | 4 ++-- include/NKPro_commands.h | 2 +- include/NKPro_commands_0.8.h | 2 +- include/device.h | 8 ++++---- unittest/test.cc | 4 ++-- unittest/test2.cc | 12 ++++++------ unittest/test3.cc | 2 +- unittest/test_HOTP.cc | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 3ff34f2..2aa31e8 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -75,7 +75,7 @@ using nitrokey::misc::strcpyT; bool NitrokeyManager::connect() { std::lock_guard lock(mex_dev_com_manager); - vector< shared_ptr > devices = { make_shared(), make_shared() }; + vector< shared_ptr > devices = { make_shared(), make_shared() }; for( auto & d : devices ){ if (d->connect()){ device = std::shared_ptr(d); @@ -104,10 +104,10 @@ using nitrokey::misc::strcpyT; LOG(__FUNCTION__, nitrokey::log::Loglevel::DEBUG_L2); switch (device_model[0]){ case 'P': - device = make_shared(); + device = make_shared(); break; case 'S': - device = make_shared(); + device = make_shared(); break; default: throw std::runtime_error("Unknown model"); diff --git a/device.cc b/device.cc index 5f1c9a0..0dd7b1f 100644 --- a/device.cc +++ b/device.cc @@ -192,14 +192,14 @@ void Device::set_retry_delay(const std::chrono::milliseconds delay){ m_retry_timeout = delay; } -Stick10::Stick10(): +Device_NKPro::Device_NKPro(): Device(0x20a0, 0x4108, DeviceModel::PRO, 100ms, 5, 100ms) { setDefaultDelay(); } -Stick20::Stick20(): +Device_NKStorage::Device_NKStorage(): Device(0x20a0, 0x4109, DeviceModel::STORAGE, 20ms, 20, 20ms) { setDefaultDelay(); diff --git a/include/NKPro_commands.h b/include/NKPro_commands.h index 1ed3d4f..60ab1b7 100644 --- a/include/NKPro_commands.h +++ b/include/NKPro_commands.h @@ -17,7 +17,7 @@ namespace proto { /* - * Stick10 protocol definition + * Device_NKPro protocol definition */ namespace NKPro { class GetSlotName : public Command { diff --git a/include/NKPro_commands_0.8.h b/include/NKPro_commands_0.8.h index 2482dec..5fffdfe 100644 --- a/include/NKPro_commands_0.8.h +++ b/include/NKPro_commands_0.8.h @@ -21,7 +21,7 @@ namespace nitrokey { namespace proto { /* - * Stick10 protocol definition + * Device_NKPro protocol definition */ namespace NKPro_08 { using NKPro::FirstAuthenticate; diff --git a/include/device.h b/include/device.h index 8bc661a..b928dc2 100644 --- a/include/device.h +++ b/include/device.h @@ -127,15 +127,15 @@ protected: static std::chrono::milliseconds default_delay ; }; -class Stick10 : public Device { +class Device_NKPro : public Device { public: - Stick10(); + Device_NKPro(); }; -class Stick20 : public Device { +class Device_NKStorage : public Device { public: - Stick20(); + Device_NKStorage(); }; } } diff --git a/unittest/test.cc b/unittest/test.cc index 41cf545..c877d33 100644 --- a/unittest/test.cc +++ b/unittest/test.cc @@ -12,7 +12,7 @@ using namespace nitrokey::proto::NKPro; using namespace nitrokey::log; using namespace nitrokey::misc; -using Dev10 = std::shared_ptr; +using Dev10 = std::shared_ptr; std::string getSlotName(Dev10 stick, int slotNo) { auto slot_req = get_payload(); @@ -23,7 +23,7 @@ std::string getSlotName(Dev10 stick, int slotNo) { } TEST_CASE("Slot names are correct", "[slotNames]") { - auto stick = make_shared(); + auto stick = make_shared(); bool connected = stick->connect(); REQUIRE(connected == true); diff --git a/unittest/test2.cc b/unittest/test2.cc index 37d5983..cd012c5 100644 --- a/unittest/test2.cc +++ b/unittest/test2.cc @@ -47,7 +47,7 @@ void SKIP_TEST() { TEST_CASE("long operation test", "[test_long]") { SKIP_TEST(); - auto stick = make_shared(); + auto stick = make_shared(); bool connected = stick->connect(); REQUIRE(connected == true); Log::instance().set_loglevel(Loglevel::DEBUG); @@ -123,7 +123,7 @@ TEST_CASE("test device commands ids", "[fast]") { } TEST_CASE("test device internal status with various commands", "[fast]") { - auto stick = make_shared(); + auto stick = make_shared(); bool connected = stick->connect(); REQUIRE(connected == true); @@ -147,7 +147,7 @@ TEST_CASE("test device internal status with various commands", "[fast]") { } TEST_CASE("setup hidden volume test", "[hidden]") { - auto stick = make_shared(); + auto stick = make_shared(); bool connected = stick->connect(); REQUIRE(connected == true); Log::instance().set_loglevel(Loglevel::DEBUG); @@ -170,7 +170,7 @@ TEST_CASE("setup hidden volume test", "[hidden]") { } TEST_CASE("setup multiple hidden volumes", "[hidden]") { - auto stick = make_shared(); + auto stick = make_shared(); bool connected = stick->connect(); REQUIRE(connected == true); Log::instance().set_loglevel(Loglevel::DEBUG); @@ -207,7 +207,7 @@ TEST_CASE("setup multiple hidden volumes", "[hidden]") { TEST_CASE("update password change", "[dangerous]") { SKIP_TEST(); - auto stick = make_shared(); + auto stick = make_shared(); bool connected = stick->connect(); REQUIRE(connected == true); Log::instance().set_loglevel(Loglevel::DEBUG); @@ -228,7 +228,7 @@ TEST_CASE("update password change", "[dangerous]") { } TEST_CASE("general test", "[test]") { - auto stick = make_shared(); + auto stick = make_shared(); bool connected = stick->connect(); REQUIRE(connected == true); diff --git a/unittest/test3.cc b/unittest/test3.cc index 65680ad..cfb63a0 100644 --- a/unittest/test3.cc +++ b/unittest/test3.cc @@ -21,7 +21,7 @@ using namespace nitrokey::proto::NKPro_08; using namespace nitrokey::log; using namespace nitrokey::misc; -using Dev = Stick10; +using Dev = Device_NKPro; using Dev10 = std::shared_ptr; void connect_and_setup(Dev10 stick) { diff --git a/unittest/test_HOTP.cc b/unittest/test_HOTP.cc index 7c905dc..e1d682b 100644 --- a/unittest/test_HOTP.cc +++ b/unittest/test_HOTP.cc @@ -33,7 +33,7 @@ TEST_CASE("test secret", "[functions]") { } TEST_CASE("Test HOTP codes according to RFC", "[HOTP]") { - std::shared_ptr stick = make_shared(); + std::shared_ptr stick = make_shared(); bool connected = stick->connect(); REQUIRE(connected == true); -- cgit v1.2.3