crypt32: Fail earlier if CryptExportPublicKeyInfo fails.
This commit is contained in:
parent
6ccdbab6c8
commit
da53cfc8bb
|
@ -3202,8 +3202,10 @@ PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HAN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CryptExportPublicKeyInfo(hProv, dwKeySpec, X509_ASN_ENCODING, NULL,
|
ret = CryptExportPublicKeyInfo(hProv, dwKeySpec, X509_ASN_ENCODING, NULL,
|
||||||
&pubKeySize);
|
&pubKeySize);
|
||||||
|
if (!ret)
|
||||||
|
goto end;
|
||||||
pubKey = CryptMemAlloc(pubKeySize);
|
pubKey = CryptMemAlloc(pubKeySize);
|
||||||
if (pubKey)
|
if (pubKey)
|
||||||
{
|
{
|
||||||
|
@ -3237,6 +3239,7 @@ PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HAN
|
||||||
}
|
}
|
||||||
CryptMemFree(pubKey);
|
CryptMemFree(pubKey);
|
||||||
}
|
}
|
||||||
|
end:
|
||||||
if (releaseContext)
|
if (releaseContext)
|
||||||
CryptReleaseContext(hProv, 0);
|
CryptReleaseContext(hProv, 0);
|
||||||
return context;
|
return context;
|
||||||
|
|
Loading…
Reference in New Issue