From ece26c74815c431b0c489a24292e7834181463a7 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 23 Mar 2016 00:14:07 +0100 Subject: Windows: Implement passing smart card PIN as command line argument (/tokenpin switch) when explicitly mounting a volume. --- src/Common/Keyfiles.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Common/Keyfiles.c') 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 @@ -237,6 +237,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; @@ -266,7 +271,7 @@ BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, con // Apply security token keyfile vector keyfileData; SecurityTokenKeyfilePath secPath (kf->FileName); - SecurityToken::GetKeyfileData (SecurityTokenKeyfile (secPath), keyfileData); + SecurityToken::GetKeyfileData (SecurityTokenKeyfile (secPath, pin), pin, keyfileData); if (keyfileData.empty()) { -- cgit v1.2.3