VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/SecurityToken.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-03-23 00:14:07 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-03-24 01:36:03 +0100
commitece26c74815c431b0c489a24292e7834181463a7 (patch)
treec09e4679304489e0c6a2356e26a83de29f0ac438 /src/Common/SecurityToken.h
parent6738cba617cf8cbb8a63db9e01193717a1dee2e4 (diff)
downloadVeraCrypt-ece26c74815c431b0c489a24292e7834181463a7.tar.gz
VeraCrypt-ece26c74815c431b0c489a24292e7834181463a7.zip
Windows: Implement passing smart card PIN as command line argument (/tokenpin switch) when explicitly mounting a volume.
Diffstat (limited to 'src/Common/SecurityToken.h')
-rw-r--r--src/Common/SecurityToken.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Common/SecurityToken.h b/src/Common/SecurityToken.h
index c282365e..9c6c47cf 100644
--- a/src/Common/SecurityToken.h
+++ b/src/Common/SecurityToken.h
@@ -74,7 +74,7 @@ namespace VeraCrypt
struct SecurityTokenKeyfile
{
SecurityTokenKeyfile () : Handle(CK_INVALID_HANDLE), SlotId(CK_UNAVAILABLE_INFORMATION) { Token.SlotId = CK_UNAVAILABLE_INFORMATION; Token.Flags = 0; }
- SecurityTokenKeyfile (const SecurityTokenKeyfilePath &path);
+ SecurityTokenKeyfile (const SecurityTokenKeyfilePath &path, char* pin = nullptr);
operator SecurityTokenKeyfilePath () const;
@@ -185,8 +185,9 @@ namespace VeraCrypt
static void CloseLibrary ();
static void CreateKeyfile (CK_SLOT_ID slotId, vector <byte> &keyfileData, const string &name);
static void DeleteKeyfile (const SecurityTokenKeyfile &keyfile);
- static vector <SecurityTokenKeyfile> GetAvailableKeyfiles (CK_SLOT_ID *slotIdFilter = nullptr, const wstring keyfileIdFilter = wstring());
+ static vector <SecurityTokenKeyfile> GetAvailableKeyfiles (CK_SLOT_ID *slotIdFilter = nullptr, const wstring keyfileIdFilter = wstring(), char* pin = nullptr);
static void GetKeyfileData (const SecurityTokenKeyfile &keyfile, vector <byte> &keyfileData);
+ static void GetKeyfileData (const SecurityTokenKeyfile &keyfile, char* pin, vector <byte> &keyfileData);
static list <SecurityTokenInfo> GetAvailableTokens ();
static SecurityTokenInfo GetTokenInfo (CK_SLOT_ID slotId);
#ifdef TC_WINDOWS
@@ -204,8 +205,8 @@ namespace VeraCrypt
static vector <CK_OBJECT_HANDLE> GetObjects (CK_SLOT_ID slotId, CK_ATTRIBUTE_TYPE objectClass);
static void GetObjectAttribute (CK_SLOT_ID slotId, CK_OBJECT_HANDLE tokenObject, CK_ATTRIBUTE_TYPE attributeType, vector <byte> &attributeValue);
static list <CK_SLOT_ID> GetTokenSlots ();
- static void Login (CK_SLOT_ID slotId, const string &pin);
- static void LoginUserIfRequired (CK_SLOT_ID slotId);
+ static void Login (CK_SLOT_ID slotId, const char* pin);
+ static void LoginUserIfRequired (CK_SLOT_ID slotId, char* cmdPin = nullptr);
static void OpenSession (CK_SLOT_ID slotId);
static void CheckLibraryStatus ();