It's sufficienct for Crypt[Un]ProtectData to acquire the crypto
context with the CRYPT_VERIFY_CONTEXT flag set.
This commit is contained in:
parent
5d16ab67f9
commit
2d18c3aad3
|
@ -861,8 +861,7 @@ BOOL WINAPI CryptProtectData(DATA_BLOB* pDataIn,
|
|||
szDataDescr=(WCHAR[]){'\0'};
|
||||
|
||||
/* get crypt context */
|
||||
if (!CryptAcquireContextW(&hProv,NULL,NULL,CRYPT32_PROTECTDATA_PROV,0) &&
|
||||
!CryptAcquireContextW(&hProv,NULL,NULL,CRYPT32_PROTECTDATA_PROV,CRYPT_NEWKEYSET))
|
||||
if (!CryptAcquireContextW(&hProv,NULL,NULL,CRYPT32_PROTECTDATA_PROV,CRYPT_VERIFYCONTEXT))
|
||||
{
|
||||
ERR("CryptAcquireContextW failed\n");
|
||||
goto finished;
|
||||
|
@ -1043,8 +1042,7 @@ BOOL WINAPI CryptUnprotectData(DATA_BLOB* pDataIn,
|
|||
}
|
||||
|
||||
/* get a crypt context */
|
||||
if (!CryptAcquireContextW(&hProv,NULL,NULL,CRYPT32_PROTECTDATA_PROV,0) &&
|
||||
!CryptAcquireContextW(&hProv,NULL,NULL,CRYPT32_PROTECTDATA_PROV,CRYPT_NEWKEYSET))
|
||||
if (!CryptAcquireContextW(&hProv,NULL,NULL,CRYPT32_PROTECTDATA_PROV,CRYPT_VERIFYCONTEXT))
|
||||
{
|
||||
ERR("CryptAcquireContextW failed\n");
|
||||
goto free_protect_data;
|
||||
|
|
Loading…
Reference in New Issue