From ee0a2659da24b4b7543f52647fb2d8cbbd12408c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 21 Jan 2019 00:42:53 +0100 Subject: Windows driver: remove volumes master keys from CRYPTO_INFO since they are not needed after their key schedule is created --- src/Common/Crypto.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Common/Crypto.c') diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index f63062a3..299595bd 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c @@ -532,13 +532,13 @@ int EAInit (int ea, unsigned char *key, unsigned __int8 *ks) #ifndef TC_WINDOWS_BOOT -BOOL EAInitMode (PCRYPTO_INFO ci) +BOOL EAInitMode (PCRYPTO_INFO ci, unsigned char* key2) { switch (ci->mode) { case XTS: // Secondary key schedule - if (EAInit (ci->ea, ci->k2, ci->ks2) != ERR_SUCCESS) + if (EAInit (ci->ea, key2, ci->ks2) != ERR_SUCCESS) return FALSE; /* Note: XTS mode could potentially be initialized with a weak key causing all blocks in one data unit @@ -889,8 +889,12 @@ void crypto_eraseKeys (PCRYPTO_INFO cryptoInfo) { burn (cryptoInfo->ks, sizeof (cryptoInfo->ks)); burn (cryptoInfo->ks2, sizeof (cryptoInfo->ks2)); +#ifdef TC_WINDOWS_DRIVER + burn (cryptoInfo->master_keydata_hash, sizeof (cryptoInfo->master_keydata_hash)); +#else burn (cryptoInfo->master_keydata, sizeof (cryptoInfo->master_keydata)); burn (cryptoInfo->k2, sizeof (cryptoInfo->k2)); +#endif burn (&cryptoInfo->noIterations, sizeof (cryptoInfo->noIterations)); burn (&cryptoInfo->volumePim, sizeof (cryptoInfo->volumePim)); } -- cgit v1.2.3