ReactOS 0.4.15-dev-8145-ga541a46
crl.c File Reference
#include <stdio.h>
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <winerror.h>
#include <wincrypt.h>
#include "wine/test.h"
Include dependency graph for crl.c:

Go to the source code of this file.

Functions

static BOOL (WINAPI *pCertFindCertificateInCRL)(PCCERT_CONTEXT
 
static void PCRL_ENTRY *static PCCRL_CONTEXT (WINAPI *pCertFindCRLInStore)(HCERTSTORE
 
static void *static void init_function_pointers (void)
 
static void testCreateCRL (void)
 
static void testDupCRL (void)
 
static void testAddCRL (void)
 
static void testFindCRL (void)
 
static void testGetCRLFromStore (void)
 
static void checkCRLHash (const BYTE *data, DWORD dataLen, ALG_ID algID, PCCRL_CONTEXT context, DWORD propID)
 
static void testCRLProperties (void)
 
static void testIsValidCRLForCert (void)
 
static void testFindCertInCRL (void)
 
static void testVerifyCRLRevocation (void)
 
 START_TEST (crl)
 

Variables

static const BYTE bigCert []
 
static const BYTE bigCert2 []
 
static const BYTE bigCertWithDifferentIssuer []
 
static const BYTE CRL []
 
static const BYTE newerCRL []
 
static const BYTE signedCRL []
 
static PCCRL_CONTEXT
 
static DWORD
 
static const BYTE v1CRLWithIssuerAndEntry []
 
static const BYTE v2CRLWithIssuingDistPoint []
 
static const BYTE verisignCRL []
 
static const BYTE verisignCommercialSoftPubCA []
 
static const BYTE rootWithKeySignAndCRLSign []
 
static const BYTE eeCert []
 
static const BYTE rootSignedCRL []
 
static const BYTE bigCertWithCRLDistPoints []
 
static const BYTE crlWithDifferentIssuer []
 

Function Documentation

◆ BOOL()

static BOOL ( WINAPI pCertFindCertificateInCRL)
static

◆ checkCRLHash()

static void checkCRLHash ( const BYTE data,
DWORD  dataLen,
ALG_ID  algID,
PCCRL_CONTEXT  context,
DWORD  propID 
)
static

Definition at line 843 of file crl.c.

845{
846 BYTE hash[20] = { 0 }, hashProperty[20];
847 BOOL ret;
848 DWORD size;
849
850 memset(hash, 0, sizeof(hash));
851 memset(hashProperty, 0, sizeof(hashProperty));
852 size = sizeof(hash);
853 ret = CryptHashCertificate(0, algID, 0, data, dataLen, hash, &size);
854 ok(ret, "CryptHashCertificate failed: %08x\n", GetLastError());
855 ret = CertGetCRLContextProperty(context, propID, hashProperty, &size);
856 ok(ret, "CertGetCRLContextProperty failed: %08x\n", GetLastError());
857 ok(!memcmp(hash, hashProperty, size), "Unexpected hash for property %d\n",
858 propID);
859}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI CryptHashCertificate(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid, DWORD dwFlags, const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash, DWORD *pcbComputedHash)
Definition: cert.c:2187
BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, void *pvData, DWORD *pcbData)
Definition: crl.c:472
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
#define memset(x, y, z)
Definition: compat.h:39
Definition: http.c:7252
Definition: _hash_fun.h:40
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
unsigned char BYTE
Definition: xxhash.c:193

Referenced by testCRLProperties().

◆ init_function_pointers()

static void *static void init_function_pointers ( void  )
static

Definition at line 84 of file crl.c.

85{
86 HMODULE hdll = GetModuleHandleA("crypt32.dll");
87 pCertFindCertificateInCRL = (void*)GetProcAddress(hdll, "CertFindCertificateInCRL");
88 pCertFindCRLInStore = (void*)GetProcAddress(hdll, "CertFindCRLInStore");
89 pCertIsValidCRLForCertificate = (void*)GetProcAddress(hdll, "CertIsValidCRLForCertificate");
90}
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
static PVOID hdll
Definition: shimdbg.c:126

Referenced by START_TEST().

◆ PCCRL_CONTEXT()

static void PCRL_ENTRY *static PCCRL_CONTEXT ( WINAPI pCertFindCRLInStore)
static

◆ START_TEST()

START_TEST ( crl  )

Definition at line 1206 of file crl.c.

1207{
1209
1210 testCreateCRL();
1211 testDupCRL();
1212 testAddCRL();
1213 testFindCRL();
1215
1217
1221}
static void testFindCertInCRL(void)
Definition: crl.c:1099
static void testGetCRLFromStore(void)
Definition: crl.c:781
static void *static void init_function_pointers(void)
Definition: crl.c:84
static void testCreateCRL(void)
Definition: crl.c:92
static void testAddCRL(void)
Definition: crl.c:143
static void testIsValidCRLForCert(void)
Definition: crl.c:981
static void testDupCRL(void)
Definition: crl.c:120
static void testFindCRL(void)
Definition: crl.c:427
static void testCRLProperties(void)
Definition: crl.c:861
static void testVerifyCRLRevocation(void)
Definition: crl.c:1152

◆ testAddCRL()

static void testAddCRL ( void  )
static

Definition at line 143 of file crl.c.

144{
147 PCCRL_CONTEXT context, context2;
148 BOOL ret;
149 DWORD GLE;
150
151 ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
152 if (!store) return;
153
154 /* Bad CRL encoding type */
155 ret = CertAddEncodedCRLToStore(0, 0, NULL, 0, 0, NULL);
157 "Expected E_INVALIDARG, got %08x\n", GetLastError());
158 ret = CertAddEncodedCRLToStore(store, 0, NULL, 0, 0, NULL);
160 "Expected E_INVALIDARG, got %08x\n", GetLastError());
163 "Expected E_INVALIDARG, got %08x\n", GetLastError());
164 ret = CertAddEncodedCRLToStore(store, 0, signedCRL, sizeof(signedCRL), 0,
165 NULL);
167 "Expected E_INVALIDARG, got %08x\n", GetLastError());
171 "Expected E_INVALIDARG, got %08x\n", GetLastError());
172 ret = CertAddEncodedCRLToStore(store, 0, signedCRL, sizeof(signedCRL),
175 "Expected E_INVALIDARG, got %08x\n", GetLastError());
176
177 /* No CRL */
179 GLE = GetLastError();
181 "Expected CRYPT_E_ASN1_EOD or OSS_MORE_INPUT, got %08x\n", GLE);
183 GLE = GetLastError();
185 "Expected CRYPT_E_ASN1_EOD or OSS_MORE_INPUT, got %08x\n", GLE);
186
187 /* Weird--bad add disposition leads to an access violation in Windows.
188 * Both tests crash on some win9x boxes.
189 */
190 if (0)
191 {
193 sizeof(signedCRL), 0, NULL);
195 GetLastError() == E_INVALIDARG /* Vista */),
196 "Expected STATUS_ACCESS_VIOLATION or E_INVALIDARG, got %08x\n", GetLastError());
198 sizeof(signedCRL), 0, NULL);
200 GetLastError() == E_INVALIDARG /* Vista */),
201 "Expected STATUS_ACCESS_VIOLATION or E_INVALIDARG, got %08x\n", GetLastError());
202 }
203
204 /* Weird--can add a CRL to the NULL store (does this have special meaning?)
205 */
206 context = NULL;
209 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
210 if (context)
212
213 /* Normal cases: a "signed" CRL is okay.. */
216 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
217 /* and an unsigned one is too. */
220 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
221
225 "Expected CRYPT_E_EXISTS, got %08x\n", GetLastError());
226
227 /* This should replace (one of) the existing CRL(s). */
230 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
231
232 CertCloseStore(store, 0);
233
235 ok(store != NULL, "CertOpenStore failed\n");
236
238 ok(context != NULL, "CertCreateCRLContext failed\n");
239
241 ok(ret, "CertAddCRLContextToStore failed\n");
242 ok(context2 != NULL && context2 != context, "unexpected context2\n");
243
244 ok(context->pbCrlEncoded != context2->pbCrlEncoded, "Unexpected pbCrlEncoded\n");
245 ok(context->cbCrlEncoded == context2->cbCrlEncoded, "Unexpected cbCrlEncoded\n");
246 ok(context->pCrlInfo != context2->pCrlInfo, "Unexpected pCrlInfo\n");
247
248 CertFreeCRLContext(context2);
250 CertCloseStore(store, 0);
251}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
BOOL WINAPI CertFreeCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:386
BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext)
Definition: crl.c:129
PCCRL_CONTEXT WINAPI CertCreateCRLContext(DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded)
Definition: crl.c:85
BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition, PCCRL_CONTEXT *ppStoreContext)
Definition: store.c:960
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
Definition: store.c:815
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
Definition: store.c:1127
static DWORD GLE
Definition: registry.c:38
static const BYTE signedCRL[]
Definition: crl.c:73
static const BYTE CRL[]
Definition: crl.c:64
static const BYTE newerCRL[]
Definition: crl.c:69
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
DWORD cbCrlEncoded
Definition: wincrypt.h:621
BYTE * pbCrlEncoded
Definition: wincrypt.h:620
PCRL_INFO pCrlInfo
Definition: wincrypt.h:622
#define CERT_STORE_ADD_NEWER
Definition: wincrypt.h:2487
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2464
#define X509_ASN_ENCODING
Definition: wincrypt.h:2297
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2251
#define CERT_STORE_ADD_NEW
Definition: wincrypt.h:2482
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2485
#define CRYPT_E_EXISTS
Definition: winerror.h:3008
#define CRYPT_E_ASN1_EOD
Definition: winerror.h:3086
#define OSS_MORE_INPUT
Definition: winerror.h:3041

Referenced by START_TEST().

◆ testCreateCRL()

static void testCreateCRL ( void  )
static

Definition at line 92 of file crl.c.

93{
95 DWORD GLE;
96
99 "Expected E_INVALIDARG, got %08x\n", GetLastError());
101 GLE = GetLastError();
103 "Expected CRYPT_E_ASN1_EOD or OSS_MORE_INPUT, got %08x\n", GLE);
105 ok(!context, "Expected failure\n");
107 sizeof(signedCRL) - 1);
108 ok(!context, "Expected failure\n");
110 sizeof(signedCRL));
111 ok(context != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError());
112 if (context)
115 ok(context != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError());
116 if (context)
118}
static const BYTE bigCert[]
Definition: crl.c:33

Referenced by START_TEST().

◆ testCRLProperties()

static void testCRLProperties ( void  )
static

Definition at line 861 of file crl.c.

862{
864 CRL, sizeof(CRL));
865
866 ok(context != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError());
867 if (context)
868 {
869 DWORD propID, numProps, access, size;
870 BOOL ret;
871 BYTE hash[20] = { 0 }, hashProperty[20];
873
874 /* This crashes
875 propID = CertEnumCRLContextProperties(NULL, 0);
876 */
877
878 propID = 0;
879 numProps = 0;
880 do {
881 propID = CertEnumCRLContextProperties(context, propID);
882 if (propID)
883 numProps++;
884 } while (propID != 0);
885 ok(numProps == 0, "Expected 0 properties, got %d\n", numProps);
886
887 /* Tests with a NULL cert context. Prop ID 0 fails.. */
890 "Expected E_INVALIDARG, got %08x\n", GetLastError());
891 /* while this just crashes.
892 ret = CertSetCRLContextProperty(NULL, CERT_KEY_PROV_HANDLE_PROP_ID, 0,
893 NULL);
894 */
895
898 "Expected E_INVALIDARG, got %08x\n", GetLastError());
899 /* Can't set the cert property directly, this crashes.
900 ret = CertSetCRLContextProperty(context, CERT_CRL_PROP_ID, 0, CRL);
901 */
902
903 /* These all crash.
904 ret = CertGetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, 0,
905 NULL);
906 ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID, NULL, NULL);
907 ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID,
908 hashProperty, NULL);
909 */
910 /* A missing prop */
911 size = 0;
913 NULL, &size);
915 "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError());
916 /* And, an implicit property */
918 NULL, &size);
919 ok(ret, "CertGetCRLContextProperty failed: %08x\n", GetLastError());
921 &access, &size);
922 ok(ret, "CertGetCRLContextProperty failed: %08x\n", GetLastError());
924 "Didn't expect a persisted crl\n");
925 /* Trying to set this "read only" property crashes.
926 access |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG;
927 ret = CertSetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, 0,
928 &access);
929 */
930
931 /* Can I set the hash to an invalid hash? */
932 blob.pbData = hash;
933 blob.cbData = sizeof(hash);
935 ok(ret, "CertSetCRLContextProperty failed: %08x\n",
936 GetLastError());
937 size = sizeof(hashProperty);
939 hashProperty, &size);
940 ok(ret, "CertSetCRLContextProperty failed: %08x\n", GetLastError());
941 ok(!memcmp(hashProperty, hash, sizeof(hash)), "Unexpected hash\n");
942 /* Delete the (bogus) hash, and get the real one */
944 ok(ret, "CertSetCRLContextProperty failed: %08x\n", GetLastError());
946
947 /* Now that the hash property is set, we should get one property when
948 * enumerating.
949 */
950 propID = 0;
951 numProps = 0;
952 do {
953 propID = CertEnumCRLContextProperties(context, propID);
954 if (propID)
955 numProps++;
956 } while (propID != 0);
957 ok(numProps == 1, "Expected 1 properties, got %d\n", numProps);
958
959 /* Check a few other implicit properties */
962
964 }
965}
DWORD WINAPI CertEnumCRLContextProperties(PCCRL_CONTEXT pCRLContext, DWORD dwPropId)
Definition: crl.c:395
BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData)
Definition: crl.c:566
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
static void checkCRLHash(const BYTE *data, DWORD dataLen, ALG_ID algID, PCCRL_CONTEXT context, DWORD propID)
Definition: crl.c:843
Definition: image.c:134
#define CERT_MD5_HASH_PROP_ID
Definition: wincrypt.h:2689
#define CALG_SHA1
Definition: wincrypt.h:1807
#define CERT_KEY_PROV_INFO_PROP_ID
Definition: wincrypt.h:2686
#define CALG_MD5
Definition: wincrypt.h:1805
#define CERT_ACCESS_STATE_PROP_ID
Definition: wincrypt.h:2700
#define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG
Definition: wincrypt.h:2766
#define CERT_HASH_PROP_ID
Definition: wincrypt.h:2688
#define CRYPT_E_NOT_FOUND
Definition: winerror.h:3007

Referenced by START_TEST().

◆ testDupCRL()

static void testDupCRL ( void  )
static

Definition at line 120 of file crl.c.

121{
122 PCCRL_CONTEXT context, dupContext;
123 BOOL res;
124
126 ok(context == NULL, "expected NULL\n");
128 sizeof(signedCRL));
129 dupContext = CertDuplicateCRLContext(context);
130 ok(dupContext != NULL, "expected a context\n");
131 ok(dupContext == context, "expected identical context addresses\n");
132
133 res = CertFreeCRLContext(dupContext);
134 ok(res, "CertFreeCRLContext failed\n");
135
137 ok(res, "CertFreeCRLContext failed\n");
138
140 ok(res, "CertFreeCRLContext failed\n");
141}
PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext)
Definition: crl.c:378
GLuint res
Definition: glext.h:9613

Referenced by START_TEST().

◆ testFindCertInCRL()

static void testFindCertInCRL ( void  )
static

Definition at line 1099 of file crl.c.

1100{
1101 BOOL ret;
1105
1106 if (!pCertFindCertificateInCRL)
1107 {
1108 win_skip("CertFindCertificateInCRL() is not available\n");
1109 return;
1110 }
1111
1113 sizeof(bigCert));
1114 ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n",
1115 GetLastError());
1116
1117 /* Crash
1118 ret = pCertFindCertificateInCRL(NULL, NULL, 0, NULL, NULL);
1119 ret = pCertFindCertificateInCRL(NULL, crl, 0, NULL, NULL);
1120 ret = pCertFindCertificateInCRL(cert, NULL, 0, NULL, NULL);
1121 ret = pCertFindCertificateInCRL(cert, crl, 0, NULL, NULL);
1122 ret = pCertFindCertificateInCRL(NULL, NULL, 0, NULL, &entry);
1123 ret = pCertFindCertificateInCRL(NULL, crl, 0, NULL, &entry);
1124 ret = pCertFindCertificateInCRL(cert, NULL, 0, NULL, &entry);
1125 */
1126
1128 sizeof(verisignCRL));
1129 ret = pCertFindCertificateInCRL(cert, crl, 0, NULL, &entry);
1130 ok(ret, "CertFindCertificateInCRL failed: %08x\n", GetLastError());
1131 ok(entry == NULL, "Expected not to find an entry in CRL\n");
1133
1135 sizeof(v1CRLWithIssuerAndEntry));
1136 ret = pCertFindCertificateInCRL(cert, crl, 0, NULL, &entry);
1137 ok(ret, "CertFindCertificateInCRL failed: %08x\n", GetLastError());
1138 ok(entry != NULL, "Expected to find an entry in CRL\n");
1140
1141 /* Entry found even though CRL issuer doesn't match cert issuer */
1143 sizeof(crlWithDifferentIssuer));
1144 ret = pCertFindCertificateInCRL(cert, crl, 0, NULL, &entry);
1145 ok(ret, "CertFindCertificateInCRL failed: %08x\n", GetLastError());
1146 ok(entry != NULL, "Expected to find an entry in CRL\n");
1148
1150}
BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext)
Definition: cert.c:371
PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded)
Definition: cert.c:316
uint32_t entry
Definition: isohybrid.c:63
static const BYTE verisignCRL[]
Definition: crl.c:268
static const BYTE crlWithDifferentIssuer[]
Definition: crl.c:1092
static const BYTE v1CRLWithIssuerAndEntry[]
Definition: crl.c:253
static const BYTE crl[]
Definition: message.c:864
static BYTE cert[]
Definition: msg.c:1437
#define win_skip
Definition: test.h:163
Definition: wincrypt.h:487

Referenced by START_TEST().

◆ testFindCRL()

static void testFindCRL ( void  )
static

Definition at line 427 of file crl.c.

428{
429 HCERTSTORE store;
431 PCCERT_CONTEXT cert, endCert, rootCert;
432 CRL_FIND_ISSUED_FOR_PARA issuedForPara = { NULL, NULL };
433 DWORD count, revoked_count;
434 BOOL ret;
435
436 if (!pCertFindCRLInStore || !pCertFindCertificateInCRL)
437 {
438 win_skip("CertFindCRLInStore or CertFindCertificateInCRL not available\n");
439 return;
440 }
441
444 ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
445 if (!store) return;
446
449 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
450
451 /* Crashes
452 context = pCertFindCRLInStore(NULL, 0, 0, 0, NULL, NULL);
453 */
454
455 /* Find any context */
456 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ANY, NULL, NULL);
457 ok(context != NULL, "Expected a context\n");
458 if (context)
460 /* Bogus flags are ignored */
461 context = pCertFindCRLInStore(store, 0, 1234, CRL_FIND_ANY, NULL, NULL);
462 ok(context != NULL, "Expected a context\n");
463 if (context)
465 /* CRL encoding type is ignored too */
466 context = pCertFindCRLInStore(store, 1234, 0, CRL_FIND_ANY, NULL, NULL);
467 ok(context != NULL, "Expected a context\n");
468 if (context)
470
471 /* This appears to match any cert */
472 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, NULL, NULL);
473 ok(context != NULL, "Expected a context\n");
474 if (context)
476
477 /* Try to match an issuer that isn't in the store */
479 sizeof(bigCert2));
480 ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n",
481 GetLastError());
482 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, cert, NULL);
483 ok(context == NULL, "Expected no matching context\n");
485
486 /* Match an issuer that is in the store */
488 sizeof(bigCert));
489 ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n",
490 GetLastError());
491 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY, cert, NULL);
492 ok(context != NULL, "Expected a context\n");
493 if (context)
495
496 /* Try various find flags */
497 context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_SIGNATURE_FLAG,
499 ok(!context || broken(context != NULL /* Win9x */), "unexpected context\n");
500 /* The CRL doesn't have an AKI extension, so it matches any cert */
501 context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_AKI_FLAG,
503 ok(context != NULL, "Expected a context\n");
504 if (context)
506
507 if (0)
508 {
509 /* Crash or return NULL/STATUS_ACCESS_VIOLATION */
510 pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR, NULL,
511 NULL);
512 pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR,
513 &issuedForPara, NULL);
514 }
515 /* Test whether the cert matches the CRL in the store */
516 issuedForPara.pSubjectCert = cert;
517 issuedForPara.pIssuerCert = cert;
518 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR,
519 &issuedForPara, NULL);
520 ok(context != NULL || broken(!context /* Win9x, NT4 */),
521 "Expected a context\n");
522 if (context)
523 {
524 ok(context->cbCrlEncoded == sizeof(signedCRL),
525 "unexpected CRL size %d\n", context->cbCrlEncoded);
526 ok(!memcmp(context->pbCrlEncoded, signedCRL, context->cbCrlEncoded),
527 "unexpected CRL data\n");
529 }
530
534 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
538 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
541 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
542 issuedForPara.pSubjectCert = cert;
543 issuedForPara.pIssuerCert = cert;
544 context = NULL;
545 count = revoked_count = 0;
546 do {
547 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR,
548 &issuedForPara, context);
549 if (context)
550 {
552
553 count++;
554 if (pCertFindCertificateInCRL(cert, context, 0, NULL, &entry) &&
555 entry)
556 revoked_count++;
557 }
558 } while (context);
559 /* signedCRL, v1CRLWithIssuerAndEntry, and v2CRLWithIssuingDistPoint all
560 * match cert's issuer, but verisignCRL does not, so the expected count
561 * is 0.
562 */
563 ok(count == 3 || broken(count == 0 /* NT4, Win9x */),
564 "expected 3 matching CRLs, got %d\n", count);
565 /* Only v1CRLWithIssuerAndEntry and v2CRLWithIssuingDistPoint contain
566 * entries, so the count of CRL entries that match cert is 2.
567 */
568 ok(revoked_count == 2 || broken(revoked_count == 0 /* NT4, Win9x */),
569 "expected 2 matching CRL entries, got %d\n", revoked_count);
570
572
573 /* Try again with a cert that doesn't match any CRLs in the store */
576 ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n",
577 GetLastError());
578 issuedForPara.pSubjectCert = cert;
579 issuedForPara.pIssuerCert = cert;
580 context = NULL;
581 count = revoked_count = 0;
582 do {
583 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR,
584 &issuedForPara, context);
585 if (context)
586 {
588
589 count++;
590 if (pCertFindCertificateInCRL(cert, context, 0, NULL, &entry) &&
591 entry)
592 revoked_count++;
593 }
594 } while (context);
595 ok(count == 0, "expected 0 matching CRLs, got %d\n", count);
596 ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n",
597 revoked_count);
599
600 /* Test again with a real certificate and CRL. The certificate wasn't
601 * revoked, but its issuer does have a CRL.
602 */
605 ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n",
606 GetLastError());
607 issuedForPara.pIssuerCert = cert;
608 issuedForPara.pSubjectCert = cert;
609 context = NULL;
610 count = revoked_count = 0;
611 do {
612 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR,
613 &issuedForPara, context);
614 if (context)
615 {
617
618 count++;
619 if (pCertFindCertificateInCRL(cert, context, 0, NULL, &entry) &&
620 entry)
621 revoked_count++;
622 }
623 } while (context);
624 ok(count == 1 || broken(count == 0 /* Win9x, NT4 */),
625 "expected 1 matching CRLs, got %d\n", count);
626 ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n",
627 revoked_count);
629
630 CertCloseStore(store, 0);
631
632 /* This test uses a synthesized chain (rootWithKeySignAndCRLSign ->
633 * eeCert) whose end certificate is in the CRL.
634 */
637 /* Add a CRL for the end certificate */
640 /* Add another CRL unrelated to the tested chain */
644 eeCert, sizeof(eeCert));
647 issuedForPara.pSubjectCert = endCert;
648 issuedForPara.pIssuerCert = rootCert;
649 context = NULL;
650 count = revoked_count = 0;
651 do {
652 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_FOR,
653 &issuedForPara, context);
654 if (context)
655 {
657
658 count++;
659 if (pCertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
660 entry)
661 revoked_count++;
662 }
663 } while (context);
664 ok(count == 1 || broken(count == 0 /* Win9x, NT4 */),
665 "expected 1 matching CRLs, got %d\n", count);
666 ok(revoked_count == 1 || broken(revoked_count == 0 /* Win9x, NT4 */),
667 "expected 1 matching CRL entries, got %d\n", revoked_count);
668
669 /* Test CRL_FIND_ISSUED_BY flags */
670 count = revoked_count = 0;
671 do {
672 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY,
673 endCert, context);
674 if (context)
675 {
677
678 count++;
679 if (pCertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
680 entry)
681 revoked_count++;
682 }
683 } while (context);
684 ok(count == 0, "expected 0 matching CRLs, got %d\n", count);
685 ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n",
686 revoked_count);
687 count = revoked_count = 0;
688 do {
689 context = pCertFindCRLInStore(store, 0, 0, CRL_FIND_ISSUED_BY,
690 rootCert, context);
691 if (context)
692 {
694
695 count++;
696 if (pCertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
697 entry)
698 revoked_count++;
699 }
700 } while (context);
701 ok(count == 1, "expected 1 matching CRLs, got %d\n", count);
702 ok(revoked_count == 1, "expected 1 matching CRL entries, got %d\n",
703 revoked_count);
704 count = revoked_count = 0;
705 do {
706 context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_AKI_FLAG,
707 CRL_FIND_ISSUED_BY, endCert, context);
708 if (context)
709 {
711
712 count++;
713 if (pCertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
714 entry)
715 revoked_count++;
716 }
717 } while (context);
718 ok(count == 0, "expected 0 matching CRLs, got %d\n", count);
719 ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n",
720 revoked_count);
721 count = revoked_count = 0;
722 do {
723 context = pCertFindCRLInStore(store, 0, CRL_FIND_ISSUED_BY_AKI_FLAG,
724 CRL_FIND_ISSUED_BY, rootCert, context);
725 if (context)
726 {
728
729 count++;
730 if (pCertFindCertificateInCRL(rootCert, context, 0, NULL, &entry) &&
731 entry)
732 revoked_count++;
733 }
734 } while (context);
735 ok(count == 0 || broken(count == 1 /* Win9x */),
736 "expected 0 matching CRLs, got %d\n", count);
737 ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n",
738 revoked_count);
739 count = revoked_count = 0;
740 do {
741 context = pCertFindCRLInStore(store, 0,
743 context);
744 if (context)
745 {
747
748 count++;
749 if (pCertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
750 entry)
751 revoked_count++;
752 }
753 } while (context);
754 ok(count == 0, "expected 0 matching CRLs, got %d\n", count);
755 ok(revoked_count == 0, "expected 0 matching CRL entries, got %d\n",
756 revoked_count);
757 count = revoked_count = 0;
758 do {
759 context = pCertFindCRLInStore(store, 0,
761 context);
762 if (context)
763 {
765
766 count++;
767 if (pCertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
768 entry)
769 revoked_count++;
770 }
771 } while (context);
772 ok(count == 1, "expected 1 matching CRLs, got %d\n", count);
773 ok(revoked_count == 1, "expected 1 matching CRL entries, got %d\n",
774 revoked_count);
777
778 CertCloseStore(store, 0);
779}
#define broken(x)
Definition: _sntprintf.h:21
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const BYTE verisignCommercialSoftPubCA[]
Definition: crl.c:303
static const BYTE v2CRLWithIssuingDistPoint[]
Definition: crl.c:259
static const BYTE rootSignedCRL[]
Definition: crl.c:405
static const BYTE rootWithKeySignAndCRLSign[]
Definition: crl.c:342
static const BYTE bigCertWithDifferentIssuer[]
Definition: crl.c:53
static const BYTE eeCert[]
Definition: crl.c:376
static const BYTE bigCert2[]
Definition: crl.c:43
PCCERT_CONTEXT pIssuerCert
Definition: wincrypt.h:2940
PCCERT_CONTEXT pSubjectCert
Definition: wincrypt.h:2939
#define CRL_FIND_ISSUED_BY_AKI_FLAG
Definition: wincrypt.h:2932
#define CRL_FIND_ISSUED_BY_SIGNATURE_FLAG
Definition: wincrypt.h:2933
#define CRL_FIND_ANY
Definition: wincrypt.h:2927
#define CRL_FIND_ISSUED_FOR
Definition: wincrypt.h:2930
#define CRL_FIND_ISSUED_BY
Definition: wincrypt.h:2928

Referenced by START_TEST().

◆ testGetCRLFromStore()

static void testGetCRLFromStore ( void  )
static

Definition at line 781 of file crl.c.

782{
787 DWORD flags;
788 BOOL ret;
789
790 ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
791 if (!store) return;
792
793 /* Crash
794 context = CertGetCRLFromStore(NULL, NULL, NULL, NULL);
795 context = CertGetCRLFromStore(store, NULL, NULL, NULL);
796 */
797
798 /* Bogus flags */
799 flags = 0xffffffff;
802 "Expected E_INVALIDARG, got %08x\n", GetLastError());
803
804 /* Test an empty store */
805 flags = 0;
808 "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError());
809
812 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
813
814 /* NULL matches any CRL */
815 flags = 0;
817 ok(context != NULL, "Expected a context\n");
819
820 /* This cert's issuer isn't in */
822 sizeof(bigCert2));
823 ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n",
824 GetLastError());
827 "Expected CRYPT_E_NOT_FOUND, got %08x\n", GetLastError());
829
830 /* But this one is */
832 sizeof(bigCert));
833 ok(cert != NULL, "CertCreateCertificateContext failed: %08x\n",
834 GetLastError());
836 ok(context != NULL, "Expected a context\n");
839
840 CertCloseStore(store, 0);
841}
PCCRL_CONTEXT WINAPI CertGetCRLFromStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pIssuerContext, PCCRL_CONTEXT pPrevCrlContext, DWORD *pdwFlags)
Definition: crl.c:337
GLbitfield flags
Definition: glext.h:7161

Referenced by START_TEST().

◆ testIsValidCRLForCert()

static void testIsValidCRLForCert ( void  )
static

Definition at line 981 of file crl.c.

982{
983 BOOL ret;
984 PCCERT_CONTEXT cert1, cert2, cert3;
986 HCERTSTORE store;
987
988 if(!pCertIsValidCRLForCertificate) return;
989
992 ok(crl != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError());
994 sizeof(bigCert));
995 ok(cert1 != NULL, "CertCreateCertificateContext failed: %08x\n",
996 GetLastError());
997
998 /* Crash
999 ret = CertIsValidCRLForCertificate(NULL, NULL, 0, NULL);
1000 ret = CertIsValidCRLForCertificate(cert1, NULL, 0, NULL);
1001 */
1002
1003 /* Curiously, any CRL is valid for the NULL certificate */
1004 ret = pCertIsValidCRLForCertificate(NULL, crl, 0, NULL);
1005 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1006
1007 /* Same issuer for both cert and CRL, this CRL is valid for that cert */
1008 ret = pCertIsValidCRLForCertificate(cert1, crl, 0, NULL);
1009 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1010
1013 ok(cert2 != NULL, "CertCreateCertificateContext failed: %08x\n",
1014 GetLastError());
1015
1016 /* Yet more curious: different issuers for these, yet the CRL is valid for
1017 * that cert. According to MSDN, the relevant bit to check is whether the
1018 * CRL has a CRL_ISSUING_DIST_POINT extension.
1019 */
1020 ret = pCertIsValidCRLForCertificate(cert2, crl, 0, NULL);
1021 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1022
1024
1025 /* With a CRL_ISSUING_DIST_POINT in the CRL, it returns FALSE, since the
1026 * cert doesn't have the same extension in it.
1027 */
1030 ok(crl != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError());
1031
1032 ret = pCertIsValidCRLForCertificate(cert1, crl, 0, NULL);
1034 "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError());
1035 ret = pCertIsValidCRLForCertificate(cert2, crl, 0, NULL);
1037 "expected CRYPT_E_NO_MATCH, got %08x\n", GetLastError());
1038
1039 /* With a CRL_ISSUING_DIST_POINT in the CRL, it matches the cert containing
1040 * a CRL_DIST_POINTS_INFO extension.
1041 */
1044 ok(cert3 != NULL, "CertCreateCertificateContext failed: %08x\n",
1045 GetLastError());
1046 ret = pCertIsValidCRLForCertificate(cert3, crl, 0, NULL);
1047 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1048
1050
1051 /* And again, with a real CRL, the CRL is valid for all three certs. */
1053 sizeof(verisignCRL));
1054 ok(crl != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError());
1055
1056 ret = pCertIsValidCRLForCertificate(cert1, crl, 0, NULL);
1057 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1058 ret = pCertIsValidCRLForCertificate(cert2, crl, 0, NULL);
1059 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1060 ret = pCertIsValidCRLForCertificate(cert3, crl, 0, NULL);
1061 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1062
1064
1065 /* One last test: a CRL in a different store than the cert is also valid
1066 * for the cert.
1067 */
1070 ok(store != NULL, "CertOpenStore failed: %08x\n", GetLastError());
1071
1074 ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError());
1075
1076 ret = pCertIsValidCRLForCertificate(cert1, crl, 0, NULL);
1077 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1078 ret = pCertIsValidCRLForCertificate(cert2, crl, 0, NULL);
1079 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1080 ret = pCertIsValidCRLForCertificate(cert3, crl, 0, NULL);
1081 ok(ret, "CertIsValidCRLForCertificate failed: %08x\n", GetLastError());
1082
1084
1085 CertCloseStore(store, 0);
1086
1090}
static const BYTE bigCertWithCRLDistPoints[]
Definition: crl.c:967
static const BYTE cert2[]
Definition: message.c:844
static const BYTE cert1[]
Definition: message.c:828
#define CRYPT_E_NO_MATCH
Definition: winerror.h:3012

Referenced by START_TEST().

◆ testVerifyCRLRevocation()

static void testVerifyCRLRevocation ( void  )
static

Definition at line 1152 of file crl.c.

1153{
1154 BOOL ret;
1157
1159 ok(ret, "CertVerifyCRLRevocation failed: %08x\n", GetLastError());
1161 ok(ret, "CertVerifyCRLRevocation failed: %08x\n", GetLastError());
1162
1164 sizeof(bigCert));
1165
1166 /* Check against no CRL */
1167 ret = CertVerifyCRLRevocation(0, cert->pCertInfo, 0, NULL);
1168 ok(ret, "CertVerifyCRLRevocation failed: %08x\n", GetLastError());
1170 ok(ret, "CertVerifyCRLRevocation failed: %08x\n", GetLastError());
1171
1172 /* Check against CRL with entry for the cert */
1174 sizeof(v1CRLWithIssuerAndEntry));
1175 ret = CertVerifyCRLRevocation(0, cert->pCertInfo, 1,
1176 (PCRL_INFO *)&crl->pCrlInfo);
1177 ok(!ret, "CertVerifyCRLRevocation should have been revoked\n");
1179 (PCRL_INFO *)&crl->pCrlInfo);
1180 ok(!ret, "CertVerifyCRLRevocation should have been revoked\n");
1182
1183 /* Check against CRL with different issuer and entry for the cert */
1185 sizeof(crlWithDifferentIssuer));
1186 ok(crl != NULL, "CertCreateCRLContext failed: %08x\n", GetLastError());
1188 (PCRL_INFO *)&crl->pCrlInfo);
1189 ok(!ret, "CertVerifyCRLRevocation should have been revoked\n");
1191
1192 /* Check against CRL without entry for the cert */
1194 sizeof(verisignCRL));
1195 ret = CertVerifyCRLRevocation(0, cert->pCertInfo, 1,
1196 (PCRL_INFO *)&crl->pCrlInfo);
1197 ok(ret, "CertVerifyCRLRevocation failed: %08x\n", GetLastError());
1199 (PCRL_INFO *)&crl->pCrlInfo);
1200 ok(ret, "CertVerifyCRLRevocation failed: %08x\n", GetLastError());
1202
1204}
BOOL WINAPI CertVerifyCRLRevocation(DWORD dwCertEncodingType, PCERT_INFO pCertId, DWORD cCrlInfo, PCRL_INFO rgpCrlInfo[])
Definition: crl.c:762

Referenced by START_TEST().

Variable Documentation

◆ bigCert

const BYTE bigCert[]
static
Initial value:
= { 0x30, 0x7a, 0x02, 0x01, 0x01, 0x30, 0x02, 0x06,
0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x30, 0x22,
0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30,
0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x15, 0x31, 0x13, 0x30,
0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20,
0x4c, 0x61, 0x6e, 0x67, 0x00, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01,
0x00, 0xa3, 0x16, 0x30, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01,
0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 }

Definition at line 33 of file crl.c.

Referenced by testCreateCRL(), testFindCertInCRL(), testFindCRL(), testGetCRLFromStore(), testIsValidCRLForCert(), and testVerifyCRLRevocation().

◆ bigCert2

const BYTE bigCert2[]
static
Initial value:
= { 0x30, 0x7a, 0x02, 0x01, 0x01, 0x30, 0x02, 0x06,
0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
0x0a, 0x41, 0x6c, 0x65, 0x78, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x30, 0x22,
0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30,
0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30, 0x15, 0x31, 0x13, 0x30,
0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0a, 0x41, 0x6c, 0x65, 0x78, 0x20,
0x4c, 0x61, 0x6e, 0x67, 0x00, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01,
0x00, 0xa3, 0x16, 0x30, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01,
0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 }

Definition at line 43 of file crl.c.

Referenced by testFindCRL(), and testGetCRLFromStore().

◆ bigCertWithCRLDistPoints

const BYTE bigCertWithCRLDistPoints[]
static
Initial value:
= {
0x30,0x81,0xa5,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30,
0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,
0x6e,0x67,0x00,0x30,0x22,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31,
0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,
0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x30,0x15,0x31,0x13,0x30,0x11,
0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,
0x67,0x00,0x30,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,
0x01,0x01,0x05,0x00,0x03,0x11,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0xa3,0x26,0x30,0x24,0x30,0x22,0x06,
0x03,0x55,0x1d,0x1f,0x04,0x1b,0x30,0x19,0x30,0x17,0xa0,0x15,0xa0,0x13,0x86,
0x11,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x69,0x6e,0x65,0x68,0x71,0x2e,
0x6f,0x72,0x67 }

Definition at line 967 of file crl.c.

Referenced by testIsValidCRLForCert().

◆ bigCertWithDifferentIssuer

const BYTE bigCertWithDifferentIssuer[]
static
Initial value:
= { 0x30, 0x7a, 0x02, 0x01,
0x01, 0x30, 0x02, 0x06, 0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03,
0x55, 0x04, 0x03, 0x13, 0x0a, 0x41, 0x6c, 0x65, 0x78, 0x20, 0x4c, 0x61, 0x6e,
0x67, 0x00, 0x30, 0x22, 0x18, 0x0f, 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30,
0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x31, 0x36, 0x30,
0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x30,
0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0a, 0x4a,
0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x30, 0x07, 0x30, 0x02,
0x06, 0x00, 0x03, 0x01, 0x00, 0xa3, 0x16, 0x30, 0x14, 0x30, 0x12, 0x06, 0x03,
0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff,
0x02, 0x01, 0x01 }

Definition at line 53 of file crl.c.

Referenced by testFindCRL(), and testIsValidCRLForCert().

◆ CRL

const BYTE CRL[]
static
Initial value:
= { 0x30, 0x2c, 0x30, 0x02, 0x06, 0x00,
0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0a,
0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x18, 0x0f, 0x31,
0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x5a }

Definition at line 64 of file crl.c.

Referenced by testAddCRL(), testCreateCRL(), and testCRLProperties().

◆ crlWithDifferentIssuer

const BYTE crlWithDifferentIssuer[]
static
Initial value:
= {
0x30,0x47,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30,0x11,
0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x41,0x6c,0x65,0x78,0x20,0x4c,0x61,0x6e,
0x67,0x00,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,
0x30,0x30,0x30,0x5a,0x30,0x16,0x30,0x14,0x02,0x01,0x01,0x18,0x0f,0x31,0x36,
0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a }

Definition at line 1092 of file crl.c.

Referenced by testFindCertInCRL(), and testVerifyCRLRevocation().

◆ DWORD

Definition at line 80 of file crl.c.

◆ eeCert

const BYTE eeCert[]
static
Initial value:
= {
0x30,0x82,0x01,0x93,0x30,0x81,0xfd,0xa0,0x03,0x02,0x01,0x02,0x02,0x01,0x01,
0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,
0x30,0x10,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x43,0x65,
0x72,0x74,0x31,0x30,0x1e,0x17,0x0d,0x30,0x37,0x30,0x35,0x30,0x31,0x30,0x30,
0x30,0x30,0x30,0x30,0x5a,0x17,0x0d,0x30,0x37,0x31,0x30,0x30,0x31,0x30,0x30,
0x30,0x30,0x30,0x30,0x5a,0x30,0x10,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,
0x03,0x13,0x05,0x43,0x65,0x72,0x74,0x32,0x30,0x81,0x9f,0x30,0x0d,0x06,0x09,
0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8d,0x00,
0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xb8,0x52,0xda,0xc5,0x4b,0x3f,0xe5,0x33,
0x0e,0x67,0x5f,0x48,0x21,0xdc,0x7e,0xef,0x37,0x33,0xba,0xff,0xb4,0xc6,0xdc,
0xb6,0x17,0x8e,0x20,0x55,0x07,0x12,0xd2,0x7b,0x3c,0xce,0x30,0xc5,0xa7,0x48,
0x9f,0x6e,0xfe,0xb8,0xbe,0xdb,0x9f,0x9b,0x17,0x60,0x16,0xde,0xc6,0x8b,0x47,
0xd1,0x57,0x71,0x3c,0x93,0xfc,0xbd,0xec,0x44,0x32,0x3b,0xb9,0xcf,0x6b,0x05,
0x72,0xa7,0x87,0x8e,0x7e,0xd4,0x9a,0x87,0x1c,0x2f,0xb7,0x82,0x40,0xfc,0x6a,
0x80,0x83,0x68,0x28,0xce,0x84,0xf4,0x0b,0x2e,0x44,0xcb,0x53,0xac,0x85,0x85,
0xb5,0x46,0x36,0x98,0x3c,0x10,0x02,0xaa,0x02,0xbc,0x8b,0xa2,0x23,0xb2,0xd3,
0x51,0x9a,0x22,0x4a,0xe3,0xaa,0x4e,0x7c,0xda,0x38,0xcf,0x49,0x98,0x72,0xa3,
0x02,0x03,0x01,0x00,0x01,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,
0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00,0x22,0xf1,0x66,0x00,0x79,0xd2,
0xe6,0xb2,0xb2,0xf7,0x2f,0x98,0x92,0x7d,0x73,0xc3,0x6c,0x5c,0x77,0x20,0xe3,
0xbf,0x3e,0xe0,0xb3,0x5c,0x68,0xb4,0x9b,0x3a,0x41,0xae,0x94,0xa0,0x80,0x3a,
0xfe,0x5d,0x7a,0x56,0x87,0x85,0x44,0x45,0xcf,0xa6,0xd3,0x10,0xe7,0x73,0x41,
0xf2,0x7f,0x88,0x85,0x91,0x8e,0xe6,0xec,0xe2,0xce,0x08,0xbc,0xa5,0x76,0xe5,
0x4d,0x1d,0xb7,0x70,0x31,0xdd,0xc9,0x9a,0x15,0x32,0x11,0x5a,0x4e,0x62,0xc8,
0xd1,0xf8,0xec,0x46,0x39,0x5b,0xe7,0x67,0x1f,0x58,0xe8,0xa1,0xa0,0x5b,0xf7,
0x8a,0x6d,0x5f,0x91,0x18,0xd4,0x90,0x85,0xff,0x30,0xc7,0xca,0x9c,0xc6,0x92,
0xb0,0xca,0x16,0xc4,0xa4,0xc0,0xd6,0xe8,0xff,0x15,0x19,0xd1,0x30,0x61,0xf3,
0xef,0x9f }

Definition at line 376 of file crl.c.

Referenced by testFindCRL().

◆ newerCRL

const BYTE newerCRL[]
static
Initial value:
= { 0x30, 0x2a, 0x30, 0x02, 0x06, 0x00, 0x30,
0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0a, 0x4a,
0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x17, 0x0d, 0x30, 0x36,
0x30, 0x35, 0x31, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a }

Definition at line 69 of file crl.c.

Referenced by testAddCRL().

◆ PCCRL_CONTEXT

Definition at line 80 of file crl.c.

◆ rootSignedCRL

const BYTE rootSignedCRL[]
static
Initial value:
= {
0x30,0x82,0x01,0x1d,0x30,0x81,0x87,0x02,0x01,0x01,0x30,0x0d,0x06,0x09,0x2a,
0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x30,0x10,0x31,0x0e,0x30,
0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x43,0x65,0x72,0x74,0x31,0x17,0x0d,
0x30,0x37,0x30,0x39,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0x17,0x0d,
0x30,0x37,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5a,0x30,0x14,
0x30,0x12,0x02,0x01,0x01,0x17,0x0d,0x30,0x37,0x30,0x39,0x30,0x31,0x30,0x30,
0x30,0x30,0x30,0x30,0x5a,0xa0,0x2d,0x30,0x2b,0x30,0x0a,0x06,0x03,0x55,0x1d,
0x14,0x04,0x03,0x02,0x01,0x01,0x30,0x1d,0x06,0x03,0x55,0x1d,0x23,0x04,0x16,
0x04,0x14,0x14,0x8c,0x16,0xbb,0xbe,0x70,0xa2,0x28,0x89,0xa0,0x58,0xff,0x98,
0xbd,0xa8,0x24,0x2b,0x8a,0xe9,0x9a,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,
0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00,0x9b,0x2b,0x99,0x0d,
0x16,0x83,0x93,0x54,0x29,0x3a,0xa6,0x53,0x5d,0xf8,0xa6,0x73,0x9f,0x2a,0x45,
0x39,0x91,0xff,0x91,0x1c,0x27,0x06,0xe8,0xdb,0x72,0x3f,0x66,0x89,0x15,0x68,
0x55,0xd5,0x49,0x63,0xa6,0x00,0xe9,0x66,0x9c,0x97,0xf9,0xb3,0xb3,0x2b,0x1b,
0xc7,0x79,0x46,0xa8,0xd8,0x2b,0x78,0x27,0xa0,0x70,0x02,0x81,0xc6,0x40,0xb3,
0x76,0x32,0x65,0x4c,0xf8,0xff,0x1d,0x41,0x6e,0x16,0x09,0xa2,0x8a,0x7b,0x0c,
0xd0,0xa6,0x9b,0x61,0xa3,0x7c,0x02,0x91,0x79,0xdf,0x6a,0x5e,0x88,0x95,0x66,
0x33,0x17,0xcb,0x5a,0xd2,0xdc,0x89,0x05,0x62,0x97,0x60,0x73,0x7b,0x2c,0x1a,
0x90,0x20,0x73,0x24,0x9f,0x45,0x22,0x4b,0xc1,0x33,0xd1,0xda,0xd8,0x7e,0x1b,
0x3d,0x74,0xd6,0x3b }

Definition at line 405 of file crl.c.

Referenced by testFindCRL().

◆ rootWithKeySignAndCRLSign

const BYTE rootWithKeySignAndCRLSign[]
static

Definition at line 342 of file crl.c.

Referenced by testFindCRL().

◆ signedCRL

const BYTE signedCRL[]
static
Initial value:
= { 0x30, 0x45, 0x30, 0x2c, 0x30, 0x02, 0x06,
0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x18, 0x0f,
0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x5a, 0x30, 0x02, 0x06, 0x00, 0x03, 0x11, 0x00, 0x0f, 0x0e, 0x0d, 0x0c,
0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }

Definition at line 73 of file crl.c.

Referenced by testAddCRL(), testCreateCRL(), testDupCRL(), testFindCRL(), and testGetCRLFromStore().

◆ v1CRLWithIssuerAndEntry

const BYTE v1CRLWithIssuerAndEntry[]
static
Initial value:
= { 0x30, 0x44, 0x30, 0x02, 0x06,
0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x18, 0x0f,
0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x5a, 0x30, 0x16, 0x30, 0x14, 0x02, 0x01, 0x01, 0x18, 0x0f, 0x31, 0x36,
0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a }

Definition at line 253 of file crl.c.

Referenced by testFindCertInCRL(), testFindCRL(), testIsValidCRLForCert(), and testVerifyCRLRevocation().

◆ v2CRLWithIssuingDistPoint

const BYTE v2CRLWithIssuingDistPoint[]
static
Initial value:
= {
0x30,0x70,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30,0x11,
0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,
0x67,0x00,0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,
0x30,0x30,0x30,0x5a,0x30,0x16,0x30,0x14,0x02,0x01,0x01,0x18,0x0f,0x31,0x36,
0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5a,0xa0,0x27,
0x30,0x25,0x30,0x23,0x06,0x03,0x55,0x1d,0x1c,0x01,0x01,0xff,0x04,0x19,0x30,
0x17,0xa0,0x15,0xa0,0x13,0x86,0x11,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,
0x69,0x6e,0x65,0x68,0x71,0x2e,0x6f,0x72,0x67 }

Definition at line 259 of file crl.c.

Referenced by testFindCRL(), and testIsValidCRLForCert().

◆ verisignCommercialSoftPubCA

const BYTE verisignCommercialSoftPubCA[]
static

Definition at line 303 of file crl.c.

Referenced by testFindCRL().

◆ verisignCRL

const BYTE verisignCRL[]
static