VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/EMVToken.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/EMVToken.h
parent502ab9112a7624dbd7c1c90c2e12ed45512b8b3c (diff)
downloadVeraCrypt-034b64f4153550cbe5849bcbfc27e187377cc512.tar.gz
VeraCrypt-034b64f4153550cbe5849bcbfc27e187377cc512.zip
EMV keyfile support: Overall code improvements and bug fixes
Diffstat (limited to 'src/Common/EMVToken.h')
-rw-r--r--src/Common/EMVToken.h28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/Common/EMVToken.h b/src/Common/EMVToken.h
index 1d84ec28..a1c0a2e1 100644
--- a/src/Common/EMVToken.h
+++ b/src/Common/EMVToken.h
@@ -6,44 +6,36 @@
#define EMV_CARDS_LABEL L"EMV Certificates"
-#include "Platform/PlatformBase.h"
-#if defined (TC_WINDOWS) && !defined (TC_PROTOTYPE)
-# include "Exception.h"
-#else
-# include "Platform/Exception.h"
-#endif
-
-#include "Token.h"
-#include "IccDataExtractor.h"
-
-namespace VeraCrypt {
+#include "EMVCard.h"
+namespace VeraCrypt
+{
struct EMVTokenInfo: TokenInfo
{
virtual ~EMVTokenInfo();
- virtual BOOL isEditable() const {return false;}
+ virtual BOOL isEditable() const { return false; }
};
struct EMVTokenKeyfile: TokenKeyfile
{
- EMVTokenKeyfile(){Id = EMV_CARDS_LABEL; Token = shared_ptr<EMVTokenInfo>(new EMVTokenInfo());};
+ EMVTokenKeyfile();
EMVTokenKeyfile(const TokenKeyfilePath& path);
+ virtual ~EMVTokenKeyfile() {};
virtual operator TokenKeyfilePath () const;
virtual void GetKeyfileData(vector <byte>& keyfileData) const;
-
};
- class EMVToken {
- private:
- static IccDataExtractor extractor;
+ class EMVToken
+ {
public:
static bool IsKeyfilePathValid(const wstring& emvTokenKeyfilePath);
- static vector<EMVTokenKeyfile> GetAvailableKeyfiles(unsigned long int* slotIdFilter = nullptr, const wstring keyfileIdFilter = wstring());
+ static vector<EMVTokenKeyfile> GetAvailableKeyfiles(unsigned long int* slotIdFilter = nullptr, const wstring& keyfileIdFilter = wstring());
static EMVTokenInfo GetTokenInfo(unsigned long int slotId);
friend void EMVTokenKeyfile::GetKeyfileData(vector <byte>& keyfileData) const;
+ static map <unsigned long int, shared_ptr<EMVCard>> EMVCards;
};
}