VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Keyfiles.c
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/Keyfiles.c
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/Keyfiles.c')
-rw-r--r--src/Common/Keyfiles.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Common/Keyfiles.c b/src/Common/Keyfiles.c
index 366d65ee..8b3825d5 100644
--- a/src/Common/Keyfiles.c
+++ b/src/Common/Keyfiles.c
@@ -238,6 +238,11 @@ close:
BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, const wchar_t* volumeFileName)
{
+ return KeyFilesApplyWithPin (hwndDlg, password, nullptr, firstKeyFile, volumeFileName);
+}
+
+BOOL KeyFilesApplyWithPin (HWND hwndDlg, Password *password, char* pin, KeyFile *firstKeyFile, const wchar_t* volumeFileName)
+{
BOOL status = TRUE;
KeyFile kfSubStruct;
KeyFile *kf;
@@ -266,7 +271,7 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con
// Apply security token keyfile
vector <byte> keyfileData;
SecurityTokenKeyfilePath secPath (kf->FileName);
- SecurityToken::GetKeyfileData (SecurityTokenKeyfile (secPath), keyfileData);
+ SecurityToken::GetKeyfileData (SecurityTokenKeyfile (secPath, pin), pin, keyfileData);
if (keyfileData.empty())
{