PDA

View Full Version : latest changes in cCryptographer.pkg AcquireContext (18.1a3)



Patrick Seiler
29-Apr-2015, 07:10 AM
Hi there,

talking about latest changes in AcquireContext (CRYPT_VERIFYCONTEXT). I just would like to know, if the following change is explicit wanted or if it's a bug:

VDF17.1:


Move (CryptAcquireContext(AddressOf(hProv),0,AddressOf( sProvider),iProvider,0)) to bOk
If (not(bOk)) Begin
Move (CryptAcquireContext(AddressOf(hProv),0,AddressOf( sProvider),iProvider,CRYPT_NEWKEYSET)) to bOk
End

changed to

DF18.1 alpha 3:


// Fallback to original
Move (CryptAcquireContext(AddressOf(hProv),0,AddressOf( sProvider),iProvider,0)) to bOk
If (bOk) Begin
Move (CryptAcquireContext(AddressOf(hProv),0,AddressOf( sProvider),iProvider,CRYPT_NEWKEYSET)) to bOk
End

Just wondering, if it just fixed a bug or introduced a new one :confused:


And, if I'm already here and talking about that function - I have a feature request. Please consider supporting the default provider:

if(CryptAcquireContext(
&hCryptProv, // handle to the CSP
UserName, // container name
NULL, // use the default provider
PROV_RSA_FULL, // provider type
0)) // flag values


According to Microsoft we have to provide NULL if psProvider(self) is empty and not the AddressOf an empty string ;)

Greetings,
Patrick.

Harm Wibier
29-Apr-2015, 10:00 AM
Changes have been made to this package (apparently after Alpha 3). The version you have wasn't intended to be released and the next build will have the finished changes..

The empty string does work :) but we'll consider passing NULL...

Patrick Seiler
29-Apr-2015, 10:18 AM
thx :)