diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-07-03 02:02:17 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-07-03 02:12:28 +0200 |
commit | b4b51bd909de630ca5715a4eedce2a71d43db268 (patch) | |
tree | 83e8b85826ae3c0159d22d205e8e47590b3b8666 /src/Common | |
parent | bef713de1a4d87b0505dd19d4da0bbbe52a650f6 (diff) | |
download | VeraCrypt-b4b51bd909de630ca5715a4eedce2a71d43db268.tar.gz VeraCrypt-b4b51bd909de630ca5715a4eedce2a71d43db268.zip |
Windows: Solve privacy issue inherited from TrueCrypt and linked to the update of configuration and history XML files everytime VeraCrypt main window is opened, even if there was no modifications. This could give information about the usage of VeraCrypt. Now, configuration and history XML files are updated only when there are modifications.
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/Combo.c | 49 | ||||
-rw-r--r-- | src/Common/Combo.h | 2 |
2 files changed, 46 insertions, 5 deletions
diff --git a/src/Common/Combo.c b/src/Common/Combo.c index cc1d5bbf..6aa7ff2d 100644 --- a/src/Common/Combo.c +++ b/src/Common/Combo.c @@ -133,23 +133,64 @@ LPARAM UpdateComboOrder (HWND hComboBox) return nIndex;
}
-void LoadCombo (HWND hComboBox)
+void LoadCombo (HWND hComboBox, BOOL bEnabled, BOOL bOnlyCheckModified, BOOL *pbModified)
{
DWORD size;
char *history = LoadFile (GetConfigPath (TC_APPD_FILENAME_HISTORY), &size);
char *xml = history;
char volume[MAX_PATH];
+ int i, nComboIdx[SIZEOF_MRU_LIST] = {0};
+ int count = SendMessage (hComboBox, CB_GETCOUNT, 0, 0);
- if (xml == NULL) return;
+ if (xml == NULL)
+ {
+ // No history XML file but history is enabled
+ if (bEnabled && pbModified)
+ *pbModified = TRUE;
+ return;
+ }
+ if (!bEnabled && bOnlyCheckModified)
+ {
+ // History is disable but there is a history XML file
+ if (pbModified)
+ *pbModified = TRUE;
+ free (history);
+ return;
+ }
+
+
+ /* combo list part:- get mru items */
+ for (i = 0; i < SIZEOF_MRU_LIST; i++)
+ nComboIdx[i] = GetOrderComboIdx (hComboBox, &nComboIdx[0], i);
+
+ i = 0;
while (xml = XmlFindElement (xml, "volume"))
{
+ char szTmp[MAX_PATH] = { 0 };
+
+ if (i < count)
+ {
+ if (SendMessage (hComboBox, CB_GETLBTEXTLEN, nComboIdx[i], 0) < sizeof (szTmp))
+ SendMessage (hComboBox, CB_GETLBTEXT, nComboIdx[i], (LPARAM) & szTmp[0]);
+ }
+
XmlGetNodeText (xml, volume, sizeof (volume));
- AddComboItem (hComboBox, volume, TRUE);
+ if (!bOnlyCheckModified)
+ AddComboItem (hComboBox, volume, TRUE);
+
+ if (pbModified && strcmp (volume, szTmp))
+ *pbModified = TRUE;
+
xml++;
+ i++;
}
- SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
+ if (pbModified && (i != count))
+ *pbModified = TRUE;
+
+ if (!bOnlyCheckModified)
+ SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
free (history);
}
diff --git a/src/Common/Combo.h b/src/Common/Combo.h index f79a8df7..6677439a 100644 --- a/src/Common/Combo.h +++ b/src/Common/Combo.h @@ -17,7 +17,7 @@ void AddComboItem (HWND hComboBox, char *lpszFileName, BOOL saveHistory); LPARAM MoveEditToCombo (HWND hComboBox, BOOL saveHistory);
int GetOrderComboIdx ( HWND hComboBox , int *nIdxList , int nElems );
LPARAM UpdateComboOrder ( HWND hComboBox );
-void LoadCombo ( HWND hComboBox );
+void LoadCombo (HWND hComboBox, BOOL bEnabled, BOOL bOnlyCheckModified, BOOL *pbModified);
void DumpCombo ( HWND hComboBox , int bClear );
void ClearCombo (HWND hComboBox);
int IsComboEmpty (HWND hComboBox);
|