RFR: 8313367: SunMSCAPI cannot read Local Computer certs w/o Windows elevation [v4]

Weijun Wang weijun at openjdk.org
Wed Apr 10 21:16:15 UTC 2024


On Wed, 10 Apr 2024 20:46:20 GMT, rebarbora-mckvak <duke at openjdk.org> wrote:

>> src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp line 807:
>> 
>>> 805:             // Acquire an alternative CSP handle
>>> 806:             if (::CryptAcquireContext(&hCryptProvAlt, LPCSTR(pbData), NULL, //deprecated
>>> 807:                 PROV_RSA_AES, 0 | keysetType) == FALSE)
>> 
>> There is no need for `0 |`.
>
> The parameter is a bitmask, the code tries to say `set flags returned by CryptGetProvParam(..., PP_CONTAINER, ...)`. I can remove `0 |` if you prefer such code.

I don't normally add `0 |` since this is not javascript.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16687#discussion_r1560061045



More information about the security-dev mailing list