From 034b64f4153550cbe5849bcbfc27e187377cc512 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Thu, 29 Jun 2023 00:06:20 +0200 Subject: EMV keyfile support: Overall code improvements and bug fixes --- src/Common/Token.h | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'src/Common/Token.h') diff --git a/src/Common/Token.h b/src/Common/Token.h index 28c6a489..c1dd8ac4 100644 --- a/src/Common/Token.h +++ b/src/Common/Token.h @@ -15,42 +15,46 @@ #define UNAVAILABLE_SLOT ~0UL -namespace VeraCrypt { - - struct TokenKeyfilePath { +namespace VeraCrypt +{ + struct TokenKeyfilePath + { + virtual ~TokenKeyfilePath() {}; TokenKeyfilePath(const wstring& path): Path(path) { } operator wstring () const { return Path; } - wstring Path; //Complete path - + wstring Path; // Complete path }; - struct TokenInfo { - TokenInfo() {} + + struct TokenInfo + { + TokenInfo(): SlotId(0), Label(L"") {} virtual ~TokenInfo() {} - virtual BOOL isEditable() const=0; + virtual BOOL isEditable() const = 0; unsigned long int SlotId; - wstring Label; //Card name + wstring Label; // Card name }; - struct TokenKeyfile { + struct TokenKeyfile + { + virtual ~TokenKeyfile() {} virtual operator TokenKeyfilePath () const = 0; virtual void GetKeyfileData(vector & keyfileData) const = 0; - string IdUtf8; // Was used in SecurityToken to compare with the file name from a PKCS11 card, remove from token ? shared_ptr Token; wstring Id; }; - class Token { + class Token + { public: - static vector> GetAvailableKeyfiles(bool EMVOption); - static bool IsKeyfilePathValid(const wstring& tokenKeyfilePath, bool EMVOption); - static list > GetAvailableTokens(); // List available token to write - static shared_ptr getTokenKeyfile(const TokenKeyfilePath path); + static vector> GetAvailableKeyfiles(bool isEMVSupportEnabled); + static bool IsKeyfilePathValid(const wstring& tokenKeyfilePath, bool isEMVSupportEnabled); + static list > GetAvailableTokens(); + static shared_ptr getTokenKeyfile(const TokenKeyfilePath& path); }; - }; -- cgit v1.2.3