Windows: fix error caused by requesting large number of random bytes when writing randomly generated data to unused/reserved header areas.

This commit is contained in:
Mounir IDRASSI 2016-08-15 14:17:59 +02:00
parent 1506916487
commit 5d5a645083
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC

View File

@ -1302,7 +1302,7 @@ int WriteRandomDataToReservedHeaderAreas (HWND hwndDlg, HANDLE dev, CRYPTO_INFO
{ {
// encrypt random data instead of existing data for better entropy, except in case of primary // encrypt random data instead of existing data for better entropy, except in case of primary
// header of an in-place encrypted disk // header of an in-place encrypted disk
RandgetBytes (hwndDlg, buf + TC_VOLUME_HEADER_EFFECTIVE_SIZE, sizeof (buf) - TC_VOLUME_HEADER_EFFECTIVE_SIZE, FALSE); RandgetBytesFull (hwndDlg, buf + TC_VOLUME_HEADER_EFFECTIVE_SIZE, sizeof (buf) - TC_VOLUME_HEADER_EFFECTIVE_SIZE, FALSE, TRUE);
} }
EncryptBuffer (buf + TC_VOLUME_HEADER_EFFECTIVE_SIZE, sizeof (buf) - TC_VOLUME_HEADER_EFFECTIVE_SIZE, cryptoInfo); EncryptBuffer (buf + TC_VOLUME_HEADER_EFFECTIVE_SIZE, sizeof (buf) - TC_VOLUME_HEADER_EFFECTIVE_SIZE, cryptoInfo);