VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Token.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2023-06-29 00:06:20 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2023-06-29 00:06:20 +0200
commit034b64f4153550cbe5849bcbfc27e187377cc512 (patch)
treed831496163c3891031765010bf1934406b0c4a3c /src/Common/Token.h
parent502ab9112a7624dbd7c1c90c2e12ed45512b8b3c (diff)
downloadVeraCrypt-034b64f4153550cbe5849bcbfc27e187377cc512.tar.gz
VeraCrypt-034b64f4153550cbe5849bcbfc27e187377cc512.zip
EMV keyfile support: Overall code improvements and bug fixes
Diffstat (limited to 'src/Common/Token.h')
-rw-r--r--src/Common/Token.h38
1 files changed, 21 insertions, 17 deletions
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 <byte>& keyfileData) const = 0;
- string IdUtf8; // Was used in SecurityToken to compare with the file name from a PKCS11 card, remove from token ?
shared_ptr<TokenInfo> Token;
wstring Id;
};
- class Token {
+ class Token
+ {
public:
- static vector<shared_ptr<TokenKeyfile>> GetAvailableKeyfiles(bool EMVOption);
- static bool IsKeyfilePathValid(const wstring& tokenKeyfilePath, bool EMVOption);
- static list <shared_ptr<TokenInfo>> GetAvailableTokens(); // List available token to write
- static shared_ptr<TokenKeyfile> getTokenKeyfile(const TokenKeyfilePath path);
+ static vector<shared_ptr<TokenKeyfile>> GetAvailableKeyfiles(bool isEMVSupportEnabled);
+ static bool IsKeyfilePathValid(const wstring& tokenKeyfilePath, bool isEMVSupportEnabled);
+ static list <shared_ptr<TokenInfo>> GetAvailableTokens();
+ static shared_ptr<TokenKeyfile> getTokenKeyfile(const TokenKeyfilePath& path);
};
-
};