Commit fce67d1e authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

wintrust: Use SecureZeroMemory() to clear magic fields.

parent c20a0dc6
...@@ -424,7 +424,8 @@ BOOL WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN hCatAdmin, ...@@ -424,7 +424,8 @@ BOOL WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN hCatAdmin,
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
return FALSE; return FALSE;
} }
ci->magic = 0; /* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory(&ci->magic, sizeof(ci->magic));
free(ci); free(ci);
return TRUE; return TRUE;
} }
...@@ -455,7 +456,8 @@ BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags ) ...@@ -455,7 +456,8 @@ BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags )
return FALSE; return FALSE;
} }
if (ca->find != INVALID_HANDLE_VALUE) FindClose(ca->find); if (ca->find != INVALID_HANDLE_VALUE) FindClose(ca->find);
ca->magic = 0; /* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory(&ca->magic, sizeof(ca->magic));
free(ca); free(ca);
return TRUE; return TRUE;
} }
...@@ -555,7 +557,8 @@ BOOL WINAPI CryptCATClose(HANDLE hCatalog) ...@@ -555,7 +557,8 @@ BOOL WINAPI CryptCATClose(HANDLE hCatalog)
free(cc->inner); free(cc->inner);
CryptMsgClose(cc->msg); CryptMsgClose(cc->msg);
cc->magic = 0; /* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory(&cc->magic, sizeof(cc->magic));
free(cc); free(cc);
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment