e9ab7a9d
by Benoît Legat at 2026-06-30T12:07:02+02:00
crypt32: Avoid conflict between unnamed containers.
1. PFXImport #1: CryptAcquireContextW(NULL container, CRYPT_NEWKEYSET) -> CSP creates container "blegat" (the default user name) and
imports key K1 into it. set_key_prov_info then writes pwszContainerName="blegat" onto cert1.
2. PFXImport #2: same call fails with NTE_EXISTS (the default container already exists), the existing retry opens it without
CRYPT_NEWKEYSET, then CryptImportKey writes K2 into that container, overwriting K1. set_key_prov_info writes pwszContainerName="blegat"
onto cert2.
3. State: container "blegat" holds K2. Cert1's CRYPT_KEY_PROV_INFO.pwszContainerName still says "blegat". Anyone asking "what's cert1's
private key?" reads its container name, opens "blegat", and gets K2, the second cert's key.
Create GUID using UuidCreate, UuidToStringW and RpcStringFreeW from rpcrt4