New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openssl: Remove unneeded cast #7025
Conversation
@@ -2888,8 +2888,7 @@ static CURLcode ossl_connect_step1(struct Curl_easy *data, | |||
if((SSL_CONN_CONFIG(verifypeer) || SSL_CONN_CONFIG(verifyhost)) && | |||
(SSL_SET_OPTION(native_ca_store))) { | |||
X509_STORE *store = SSL_CTX_get_cert_store(backend->ctx); | |||
HCERTSTORE hStore = CertOpenSystemStore((HCRYPTPROV_LEGACY)NULL, | |||
TEXT("ROOT")); | |||
HCERTSTORE hStore = CertOpenSystemStore(0, TEXT("ROOT")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is curious I think as the docs says:
This parameter is not used and should be set to NULL
So, the removed typecast is one thing but is this a pointer or not a pointer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HCRYPTPROV_LEGACY
is a typedef for ULONG_PTR
, which is an integer type that's the size of a pointer, so it seems to make more sense to use 0 instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, ULONG_PTR
is not a pointer? I just have to double-check this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is an integer with the size of a pointer, that's 64 bit on modern systems, while 0
will be a 32 bit integer, then shouldn't it be casted to 64 bit sized integer?
Update: nah, that shouldn't be necessary.
Thanks! |
This is needed when building with older Windows toolchains.