VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/SecurityTokenKeyfilesDialog.cpp
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/Main/Forms/SecurityTokenKeyfilesDialog.cpp
parent502ab9112a7624dbd7c1c90c2e12ed45512b8b3c (diff)
downloadVeraCrypt-034b64f4153550cbe5849bcbfc27e187377cc512.tar.gz
VeraCrypt-034b64f4153550cbe5849bcbfc27e187377cc512.zip
EMV keyfile support: Overall code improvements and bug fixes
Diffstat (limited to 'src/Main/Forms/SecurityTokenKeyfilesDialog.cpp')
-rw-r--r--src/Main/Forms/SecurityTokenKeyfilesDialog.cpp52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/Main/Forms/SecurityTokenKeyfilesDialog.cpp b/src/Main/Forms/SecurityTokenKeyfilesDialog.cpp
index 2c5896a7..d78e22fd 100644
--- a/src/Main/Forms/SecurityTokenKeyfilesDialog.cpp
+++ b/src/Main/Forms/SecurityTokenKeyfilesDialog.cpp
@@ -53,7 +53,7 @@ namespace VeraCrypt
wxBusyCursor busy;
SecurityTokenKeyfileListCtrl->DeleteAllItems();
- SecurityTokenKeyfileList = Token::GetAvailableKeyfiles(Gui->GetPreferences().ActivateEMVOption);
+ SecurityTokenKeyfileList = Token::GetAvailableKeyfiles(Gui->GetPreferences().EMVSupportEnabled);
size_t i = 0;
foreach (const shared_ptr<TokenKeyfile> key, SecurityTokenKeyfileList)
@@ -177,34 +177,38 @@ namespace VeraCrypt
}
}
- void SecurityTokenKeyfilesDialog::OnListItemSelected(wxListEvent &event) {
- if (event.GetItem().GetData() != (wxUIntPtr) nullptr) {
- BOOL deletable = true;
- foreach(long
- item, Gui->GetListCtrlSelectedItems(SecurityTokenKeyfileListCtrl))
- {
- TokenKeyfile *keyfile = reinterpret_cast <TokenKeyfile *> (SecurityTokenKeyfileListCtrl->GetItemData(
- item));
- if (!keyfile->Token->isEditable()) {
- deletable = false;
- }
- }
- if (deletable) {
- DeleteButton->Enable();
- }
- ExportButton->Enable();
- OKButton->Enable();
- }
- }
+ void SecurityTokenKeyfilesDialog::OnListItemSelected(wxListEvent &event)
+ {
+ if (event.GetItem().GetData() != (wxUIntPtr) nullptr)
+ {
+ BOOL deletable = true;
+ foreach(long
+ item, Gui->GetListCtrlSelectedItems(SecurityTokenKeyfileListCtrl))
+ {
+ TokenKeyfile *keyfile = reinterpret_cast <TokenKeyfile *> (SecurityTokenKeyfileListCtrl->GetItemData(item));
+ if (!keyfile->Token->isEditable())
+ {
+ deletable = false;
+ break;
+ }
+ }
+ if (deletable)
+ {
+ DeleteButton->Enable();
+ }
+ ExportButton->Enable();
+ OKButton->Enable();
+ }
+ }
void SecurityTokenKeyfilesDialog::OnOKButtonClick ()
{
foreach (long item, Gui->GetListCtrlSelectedItems (SecurityTokenKeyfileListCtrl))
- {
- TokenKeyfile *key = reinterpret_cast <TokenKeyfile *> (SecurityTokenKeyfileListCtrl->GetItemData(item));
+ {
+ TokenKeyfile *key = reinterpret_cast <TokenKeyfile *> (SecurityTokenKeyfileListCtrl->GetItemData(item));
- SelectedSecurityTokenKeyfilePaths.push_back(*key);
- }
+ SelectedSecurityTokenKeyfilePaths.push_back(*key);
+ }
EndModal (wxID_OK);
}
}