diff --git a/U2FMessage.hpp b/U2FMessage.hpp index 1283df2..488ddad 100644 --- a/U2FMessage.hpp +++ b/U2FMessage.hpp @@ -22,7 +22,6 @@ along with this program. If not, see . #include struct U2FMessage { -public: uint32_t cid; uint8_t cmd; std::vector data; diff --git a/U2F_Authenticate_APDU.hpp b/U2F_Authenticate_APDU.hpp index e540682..a388255 100644 --- a/U2F_Authenticate_APDU.hpp +++ b/U2F_Authenticate_APDU.hpp @@ -20,7 +20,8 @@ along with this program. If not, see . #include "Storage.hpp" #include "U2F_Msg_CMD.hpp" -struct U2F_Authenticate_APDU : U2F_Msg_CMD { +class U2F_Authenticate_APDU : public U2F_Msg_CMD { +protected: uint8_t controlByte; std::array challengeP; Storage::AppParam appParam; @@ -31,6 +32,7 @@ public: virtual void respond(const uint32_t channelID) const override; +protected: enum ControlCode { CheckOnly = 0x07, EnforcePresenceSign = 0x03, diff --git a/U2F_CMD.hpp b/U2F_CMD.hpp index d255a52..929d932 100644 --- a/U2F_CMD.hpp +++ b/U2F_CMD.hpp @@ -20,7 +20,7 @@ along with this program. If not, see . #include "U2FMessage.hpp" #include -struct U2F_CMD { +class U2F_CMD { protected: U2F_CMD() = default; diff --git a/U2F_Init_CMD.hpp b/U2F_Init_CMD.hpp index 5d600d9..4f1fc5d 100644 --- a/U2F_Init_CMD.hpp +++ b/U2F_Init_CMD.hpp @@ -22,7 +22,8 @@ along with this program. If not, see . #include #include -struct U2F_Init_CMD : U2F_CMD { +class U2F_Init_CMD : public U2F_CMD { +protected: uint64_t nonce; public: diff --git a/U2F_Msg_CMD.hpp b/U2F_Msg_CMD.hpp index f0daae0..d8e60fd 100644 --- a/U2F_Msg_CMD.hpp +++ b/U2F_Msg_CMD.hpp @@ -23,7 +23,7 @@ along with this program. If not, see . #include #include -struct U2F_Msg_CMD : U2F_CMD { +struct U2F_Msg_CMD : public U2F_CMD { uint8_t cla; uint8_t ins; uint8_t p1; diff --git a/U2F_Ping_CMD.hpp b/U2F_Ping_CMD.hpp index 204d3a3..4f2d99b 100644 --- a/U2F_Ping_CMD.hpp +++ b/U2F_Ping_CMD.hpp @@ -22,7 +22,8 @@ along with this program. If not, see . #include #include -struct U2F_Ping_CMD : U2F_CMD { +class U2F_Ping_CMD : public U2F_CMD { +protected: std::vector nonce; public: diff --git a/U2F_Register_APDU.hpp b/U2F_Register_APDU.hpp index db6ca39..19aaa83 100644 --- a/U2F_Register_APDU.hpp +++ b/U2F_Register_APDU.hpp @@ -20,7 +20,8 @@ along with this program. If not, see . #include "Storage.hpp" #include "U2F_Msg_CMD.hpp" -struct U2F_Register_APDU : U2F_Msg_CMD { +class U2F_Register_APDU : public U2F_Msg_CMD { +protected: std::array challengeP; Storage::AppParam appP; Storage::KeyHandle keyH; diff --git a/U2F_Version_APDU.hpp b/U2F_Version_APDU.hpp index eb907d5..02da04e 100644 --- a/U2F_Version_APDU.hpp +++ b/U2F_Version_APDU.hpp @@ -19,7 +19,7 @@ along with this program. If not, see . #pragma once #include "U2F_Msg_CMD.hpp" -struct U2F_Version_APDU : U2F_Msg_CMD { +class U2F_Version_APDU : public U2F_Msg_CMD { public: U2F_Version_APDU(const U2F_Msg_CMD& msg, const std::vector& data); void respond(const uint32_t channelID) const override;