Commit acc9d81f authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Fix duplicating a NULL CRL context.

parent 47ec8ab0
......@@ -228,6 +228,7 @@ PCCRL_CONTEXT WINAPI CertGetCRLFromStore(HCERTSTORE hCertStore,
PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext)
{
TRACE("(%p)\n", pCrlContext);
if (pCrlContext)
Context_AddRef((void *)pCrlContext, sizeof(CRL_CONTEXT));
return pCrlContext;
}
......
......@@ -118,6 +118,21 @@ static void testCreateCRL(void)
CertFreeCRLContext(context);
}
static void testDupCRL(void)
{
PCCRL_CONTEXT context, dupContext;
context = CertDuplicateCRLContext(NULL);
ok(context == NULL, "expected NULL\n");
context = CertCreateCRLContext(X509_ASN_ENCODING, signedCRL,
sizeof(signedCRL));
dupContext = CertDuplicateCRLContext(context);
ok(dupContext != NULL, "expected a context\n");
ok(dupContext == context, "expected identical context addresses\n");
CertFreeCRLContext(dupContext);
CertFreeCRLContext(context);
}
static void testAddCRL(void)
{
HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
......@@ -722,6 +737,7 @@ START_TEST(crl)
init_function_pointers();
testCreateCRL();
testDupCRL();
testAddCRL();
testFindCRL();
testGetCRLFromStore();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment