mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 19:38:26 -06:00
Windows: Implement passing smart card PIN as command line argument (/tokenpin switch) when explicitly mounting a volume.
This commit is contained in:
@@ -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 <byte> keyfileData;
|
||||
SecurityTokenKeyfilePath secPath (kf->FileName);
|
||||
SecurityToken::GetKeyfileData (SecurityTokenKeyfile (secPath), keyfileData);
|
||||
SecurityToken::GetKeyfileData (SecurityTokenKeyfile (secPath, pin), pin, keyfileData);
|
||||
|
||||
if (keyfileData.empty())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user