ReactOS 0.4.16-dev-1946-g52006dd
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 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 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

◆ checkCRLHash()

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

Definition at line 812 of file crl.c.

814{
815 BYTE hash[20] = { 0 }, hashProperty[20];
816 BOOL ret;
817 DWORD size;
818
819 memset(hash, 0, sizeof(hash));
820 memset(hashProperty, 0, sizeof(hashProperty));
821 size = sizeof(hash);
822 ret = CryptHashCertificate(0, algID, 0, data, dataLen, hash, &size);
823 ok(ret, "CryptHashCertificate failed: %08lx\n", GetLastError());
824 ret = CertGetCRLContextProperty(context, propID, hashProperty, &size);
825 ok(ret, "CertGetCRLContextProperty failed: %08lx\n", GetLastError());
826 ok(!memcmp(hash, hashProperty, size), "Unexpected hash for property %ld\n",
827 propID);
828}
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
return ret
Definition: mutex.c:146
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
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
unsigned char BYTE
Definition: xxhash.c:193

Referenced by testCRLProperties().

◆ START_TEST()

START_TEST ( crl  )

Definition at line 1167 of file crl.c.

1168{
1169 testCreateCRL();
1170 testDupCRL();
1171 testAddCRL();
1172 testFindCRL();
1178}
static void testFindCertInCRL(void)
Definition: crl.c:1066
static void testGetCRLFromStore(void)
Definition: crl.c:750
static void testCreateCRL(void)
Definition: crl.c:80
static void testAddCRL(void)
Definition: crl.c:131
static void testIsValidCRLForCert(void)
Definition: crl.c:950
static void testDupCRL(void)
Definition: crl.c:108
static void testFindCRL(void)
Definition: crl.c:409
static void testCRLProperties(void)
Definition: crl.c:830
static void testVerifyCRLRevocation(void)
Definition: crl.c:1113

◆ testAddCRL()

static void testAddCRL ( void  )
static

Definition at line 131 of file crl.c.

132{
135 PCCRL_CONTEXT context, context2;
136 BOOL ret;
137 DWORD GLE;
138
139 ok(store != NULL, "CertOpenStore failed: %08lx\n", GetLastError());
140 if (!store) return;
141
142 /* Bad CRL encoding type */
143 ret = CertAddEncodedCRLToStore(0, 0, NULL, 0, 0, NULL);
145 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
146 ret = CertAddEncodedCRLToStore(store, 0, NULL, 0, 0, NULL);
148 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
151 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
152 ret = CertAddEncodedCRLToStore(store, 0, signedCRL, sizeof(signedCRL), 0,
153 NULL);
155 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
159 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
160 ret = CertAddEncodedCRLToStore(store, 0, signedCRL, sizeof(signedCRL),
163 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
164
165 /* No CRL */
167 GLE = GetLastError();
168 ok(!ret && GLE == CRYPT_E_ASN1_EOD,
169 "Expected CRYPT_E_ASN1_EOD, got %08lx\n", GLE);
171 GLE = GetLastError();
172 ok(!ret && GLE == CRYPT_E_ASN1_EOD,
173 "Expected CRYPT_E_ASN1_EOD, got %08lx\n", GLE);
174
176 sizeof(signedCRL), 0, NULL);
178 GetLastError() == E_INVALIDARG /* Vista */),
179 "Expected STATUS_ACCESS_VIOLATION or E_INVALIDARG, got %08lx\n", GetLastError());
181 sizeof(signedCRL), 0, NULL);
183 GetLastError() == E_INVALIDARG /* Vista */),
184 "Expected STATUS_ACCESS_VIOLATION or E_INVALIDARG, got %08lx\n", GetLastError());
185
186 /* Weird--can add a CRL to the NULL store (does this have special meaning?)
187 */
188 context = NULL;
191 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
192 if (context)
194
195 /* Normal cases: a "signed" CRL is okay.. */
198 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
199 /* and an unsigned one is too. */
202 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
203
207 "Expected CRYPT_E_EXISTS, got %08lx\n", GetLastError());
208
209 /* This should replace (one of) the existing CRL(s). */
212 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
213
214 CertCloseStore(store, 0);
215
217 ok(store != NULL, "CertOpenStore failed\n");
218
220 ok(context != NULL, "CertCreateCRLContext failed\n");
221
223 ok(ret, "CertAddCRLContextToStore failed\n");
224 ok(context2 != NULL && context2 != context, "unexpected context2\n");
225
226 ok(context->pbCrlEncoded != context2->pbCrlEncoded, "Unexpected pbCrlEncoded\n");
227 ok(context->cbCrlEncoded == context2->cbCrlEncoded, "Unexpected cbCrlEncoded\n");
228 ok(context->pCrlInfo != context2->pCrlInfo, "Unexpected pCrlInfo\n");
229
230 CertFreeCRLContext(context2);
232 CertCloseStore(store, 0);
233}
#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
#define STATUS_ACCESS_VIOLATION
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
DWORD cbCrlEncoded
Definition: wincrypt.h:733
BYTE * pbCrlEncoded
Definition: wincrypt.h:732
PCRL_INFO pCrlInfo
Definition: wincrypt.h:734
#define CERT_STORE_ADD_NEWER
Definition: wincrypt.h:2656
#define CERT_STORE_CREATE_NEW_FLAG
Definition: wincrypt.h:2633
#define X509_ASN_ENCODING
Definition: wincrypt.h:2501
#define CERT_STORE_PROV_MEMORY
Definition: wincrypt.h:2455
#define CERT_STORE_ADD_NEW
Definition: wincrypt.h:2651
#define CERT_STORE_ADD_ALWAYS
Definition: wincrypt.h:2654
#define CRYPT_E_EXISTS
Definition: winerror.h:4422
#define CRYPT_E_ASN1_EOD
Definition: winerror.h:4501

Referenced by START_TEST().

◆ testCreateCRL()

static void testCreateCRL ( void  )
static

Definition at line 80 of file crl.c.

81{
83 DWORD GLE;
84
87 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
89 GLE = GetLastError();
91 "Expected CRYPT_E_ASN1_EOD, got %08lx\n", GLE);
93 ok(!context, "Expected failure\n");
95 sizeof(signedCRL) - 1);
96 ok(!context, "Expected failure\n");
98 sizeof(signedCRL));
99 ok(context != NULL, "CertCreateCRLContext failed: %08lx\n", GetLastError());
100 if (context)
103 ok(context != NULL, "CertCreateCRLContext failed: %08lx\n", GetLastError());
104 if (context)
106}
static const BYTE bigCert[]
Definition: crl.c:33

Referenced by START_TEST().

◆ testCRLProperties()

static void testCRLProperties ( void  )
static

Definition at line 830 of file crl.c.

831{
833 CRL, sizeof(CRL));
834
835 ok(context != NULL, "CertCreateCRLContext failed: %08lx\n", GetLastError());
836 if (context)
837 {
838 DWORD propID, numProps, access, size;
839 BOOL ret;
840 BYTE hash[20] = { 0 }, hashProperty[20];
842
843 /* This crashes
844 propID = CertEnumCRLContextProperties(NULL, 0);
845 */
846
847 propID = 0;
848 numProps = 0;
849 do {
850 propID = CertEnumCRLContextProperties(context, propID);
851 if (propID)
852 numProps++;
853 } while (propID != 0);
854 ok(numProps == 0, "Expected 0 properties, got %ld\n", numProps);
855
856 /* Tests with a NULL cert context. Prop ID 0 fails.. */
859 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
860 /* while this just crashes.
861 ret = CertSetCRLContextProperty(NULL, CERT_KEY_PROV_HANDLE_PROP_ID, 0,
862 NULL);
863 */
864
867 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
868 /* Can't set the cert property directly, this crashes.
869 ret = CertSetCRLContextProperty(context, CERT_CRL_PROP_ID, 0, CRL);
870 */
871
872 /* These all crash.
873 ret = CertGetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, 0,
874 NULL);
875 ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID, NULL, NULL);
876 ret = CertGetCRLContextProperty(context, CERT_HASH_PROP_ID,
877 hashProperty, NULL);
878 */
879 /* A missing prop */
880 size = 0;
882 NULL, &size);
884 "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
885 /* And, an implicit property */
887 NULL, &size);
888 ok(ret, "CertGetCRLContextProperty failed: %08lx\n", GetLastError());
890 &access, &size);
891 ok(ret, "CertGetCRLContextProperty failed: %08lx\n", GetLastError());
893 "Didn't expect a persisted crl\n");
894 /* Trying to set this "read only" property crashes.
895 access |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG;
896 ret = CertSetCRLContextProperty(context, CERT_ACCESS_STATE_PROP_ID, 0,
897 &access);
898 */
899
900 /* Can I set the hash to an invalid hash? */
901 blob.pbData = hash;
902 blob.cbData = sizeof(hash);
904 ok(ret, "CertSetCRLContextProperty failed: %08lx\n",
905 GetLastError());
906 size = sizeof(hashProperty);
908 hashProperty, &size);
909 ok(ret, "CertSetCRLContextProperty failed: %08lx\n", GetLastError());
910 ok(!memcmp(hashProperty, hash, sizeof(hash)), "Unexpected hash\n");
911 /* Delete the (bogus) hash, and get the real one */
913 ok(ret, "CertSetCRLContextProperty failed: %08lx\n", GetLastError());
915
916 /* Now that the hash property is set, we should get one property when
917 * enumerating.
918 */
919 propID = 0;
920 numProps = 0;
921 do {
922 propID = CertEnumCRLContextProperties(context, propID);
923 if (propID)
924 numProps++;
925 } while (propID != 0);
926 ok(numProps == 1, "Expected 1 properties, got %ld\n", numProps);
927
928 /* Check a few other implicit properties */
931
933 }
934}
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:812
Definition: image.c:134
#define CERT_MD5_HASH_PROP_ID
Definition: wincrypt.h:2836
#define CALG_SHA1
Definition: wincrypt.h:2060
#define CERT_KEY_PROV_INFO_PROP_ID
Definition: wincrypt.h:2833
#define CALG_MD5
Definition: wincrypt.h:2058
#define CERT_ACCESS_STATE_PROP_ID
Definition: wincrypt.h:2847
#define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG
Definition: wincrypt.h:2913
#define CERT_HASH_PROP_ID
Definition: wincrypt.h:2835
#define CRYPT_E_NOT_FOUND
Definition: winerror.h:4421

Referenced by START_TEST().

◆ testDupCRL()

static void testDupCRL ( void  )
static

Definition at line 108 of file crl.c.

109{
110 PCCRL_CONTEXT context, dupContext;
111 BOOL res;
112
114 ok(context == NULL, "expected NULL\n");
116 sizeof(signedCRL));
117 dupContext = CertDuplicateCRLContext(context);
118 ok(dupContext != NULL, "expected a context\n");
119 ok(dupContext == context, "expected identical context addresses\n");
120
121 res = CertFreeCRLContext(dupContext);
122 ok(res, "CertFreeCRLContext failed\n");
123
125 ok(res, "CertFreeCRLContext failed\n");
126
128 ok(res, "CertFreeCRLContext failed\n");
129}
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 1066 of file crl.c.

1067{
1068 BOOL ret;
1072
1074 sizeof(bigCert));
1075 ok(cert != NULL, "CertCreateCertificateContext failed: %08lx\n",
1076 GetLastError());
1077
1078 /* Crash
1079 ret = CertFindCertificateInCRL(NULL, NULL, 0, NULL, NULL);
1080 ret = CertFindCertificateInCRL(NULL, crl, 0, NULL, NULL);
1081 ret = CertFindCertificateInCRL(cert, NULL, 0, NULL, NULL);
1082 ret = CertFindCertificateInCRL(cert, crl, 0, NULL, NULL);
1083 ret = CertFindCertificateInCRL(NULL, NULL, 0, NULL, &entry);
1084 ret = CertFindCertificateInCRL(NULL, crl, 0, NULL, &entry);
1085 ret = CertFindCertificateInCRL(cert, NULL, 0, NULL, &entry);
1086 */
1087
1089 sizeof(verisignCRL));
1091 ok(ret, "CertFindCertificateInCRL failed: %08lx\n", GetLastError());
1092 ok(entry == NULL, "Expected not to find an entry in CRL\n");
1094
1096 sizeof(v1CRLWithIssuerAndEntry));
1098 ok(ret, "CertFindCertificateInCRL failed: %08lx\n", GetLastError());
1099 ok(entry != NULL, "Expected to find an entry in CRL\n");
1101
1102 /* Entry found even though CRL issuer doesn't match cert issuer */
1104 sizeof(crlWithDifferentIssuer));
1106 ok(ret, "CertFindCertificateInCRL failed: %08lx\n", GetLastError());
1107 ok(entry != NULL, "Expected to find an entry in CRL\n");
1109
1111}
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
BOOL WINAPI CertFindCertificateInCRL(PCCERT_CONTEXT pCert, PCCRL_CONTEXT pCrlContext, DWORD dwFlags, void *pvReserved, PCRL_ENTRY *ppCrlEntry)
Definition: crl.c:750
uint32_t entry
Definition: isohybrid.c:63
static const BYTE verisignCRL[]
Definition: crl.c:250
static const BYTE crlWithDifferentIssuer[]
Definition: crl.c:1059
static const BYTE v1CRLWithIssuerAndEntry[]
Definition: crl.c:235
static const BYTE crl[]
Definition: message.c:817
static BYTE cert[]
Definition: msg.c:1374
Definition: wincrypt.h:496

Referenced by START_TEST().

◆ testFindCRL()

static void testFindCRL ( void  )
static

Definition at line 409 of file crl.c.

410{
411 HCERTSTORE store;
413 PCCERT_CONTEXT cert, endCert, rootCert;
414 CRL_FIND_ISSUED_FOR_PARA issuedForPara = { NULL, NULL };
415 DWORD count, revoked_count;
416 BOOL ret;
417
420 ok(store != NULL, "CertOpenStore failed: %08lx\n", GetLastError());
421 if (!store) return;
422
425 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
426
427 /* Crashes
428 context = CertFindCRLInStore(NULL, 0, 0, 0, NULL, NULL);
429 */
430
431 /* Find any context */
433 ok(context != NULL, "Expected a context\n");
434 if (context)
436 /* Bogus flags are ignored */
437 context = CertFindCRLInStore(store, 0, 1234, CRL_FIND_ANY, NULL, NULL);
438 ok(context != NULL, "Expected a context\n");
439 if (context)
441 /* CRL encoding type is ignored too */
442 context = CertFindCRLInStore(store, 1234, 0, CRL_FIND_ANY, NULL, NULL);
443 ok(context != NULL, "Expected a context\n");
444 if (context)
446
447 /* This appears to match any cert */
449 ok(context != NULL, "Expected a context\n");
450 if (context)
452
453 /* Try to match an issuer that isn't in the store */
455 sizeof(bigCert2));
456 ok(cert != NULL, "CertCreateCertificateContext failed: %08lx\n",
457 GetLastError());
459 ok(context == NULL, "Expected no matching context\n");
461
462 /* Match an issuer that is in the store */
464 sizeof(bigCert));
465 ok(cert != NULL, "CertCreateCertificateContext failed: %08lx\n",
466 GetLastError());
468 ok(context != NULL, "Expected a context\n");
469 if (context)
471
472 /* Try various find flags */
475 ok(!context, "unexpected context\n");
476 /* The CRL doesn't have an AKI extension, so it matches any cert */
479 ok(context != NULL, "Expected a context\n");
480 if (context)
482
483 if (0)
484 {
485 /* Crash or return NULL/STATUS_ACCESS_VIOLATION */
487 NULL);
489 &issuedForPara, NULL);
490 }
491 /* Test whether the cert matches the CRL in the store */
492 issuedForPara.pSubjectCert = cert;
493 issuedForPara.pIssuerCert = cert;
495 &issuedForPara, NULL);
496 ok(context != NULL, "Expected a context\n");
497 if (context)
498 {
499 ok(context->cbCrlEncoded == sizeof(signedCRL),
500 "unexpected CRL size %ld\n", context->cbCrlEncoded);
501 ok(!memcmp(context->pbCrlEncoded, signedCRL, context->cbCrlEncoded),
502 "unexpected CRL data\n");
504 }
505
509 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
513 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
516 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
517 issuedForPara.pSubjectCert = cert;
518 issuedForPara.pIssuerCert = cert;
519 context = NULL;
520 count = revoked_count = 0;
521 do {
523 &issuedForPara, context);
524 if (context)
525 {
527
528 count++;
530 entry)
531 revoked_count++;
532 }
533 } while (context);
534 /* signedCRL, v1CRLWithIssuerAndEntry, and v2CRLWithIssuingDistPoint all
535 * match cert's issuer, but verisignCRL does not, so the expected count
536 * is 0.
537 */
538 ok(count == 3, "expected 3 matching CRLs, got %ld\n", count);
539 /* Only v1CRLWithIssuerAndEntry and v2CRLWithIssuingDistPoint contain
540 * entries, so the count of CRL entries that match cert is 2.
541 */
542 ok(revoked_count == 2, "expected 2 matching CRL entries, got %ld\n", revoked_count);
543
545
546 /* Try again with a cert that doesn't match any CRLs in the store */
549 ok(cert != NULL, "CertCreateCertificateContext failed: %08lx\n",
550 GetLastError());
551 issuedForPara.pSubjectCert = cert;
552 issuedForPara.pIssuerCert = cert;
553 context = NULL;
554 count = revoked_count = 0;
555 do {
557 &issuedForPara, context);
558 if (context)
559 {
561
562 count++;
564 entry)
565 revoked_count++;
566 }
567 } while (context);
568 ok(count == 0, "expected 0 matching CRLs, got %ld\n", count);
569 ok(revoked_count == 0, "expected 0 matching CRL entries, got %ld\n",
570 revoked_count);
572
573 /* Test again with a real certificate and CRL. The certificate wasn't
574 * revoked, but its issuer does have a CRL.
575 */
578 ok(cert != NULL, "CertCreateCertificateContext failed: %08lx\n",
579 GetLastError());
580 issuedForPara.pIssuerCert = cert;
581 issuedForPara.pSubjectCert = cert;
582 context = NULL;
583 count = revoked_count = 0;
584 do {
586 &issuedForPara, context);
587 if (context)
588 {
590
591 count++;
593 entry)
594 revoked_count++;
595 }
596 } while (context);
597 ok(count == 1, "expected 1 matching CRLs, got %ld\n", count);
598 ok(revoked_count == 0, "expected 0 matching CRL entries, got %ld\n",
599 revoked_count);
601
602 CertCloseStore(store, 0);
603
604 /* This test uses a synthesized chain (rootWithKeySignAndCRLSign ->
605 * eeCert) whose end certificate is in the CRL.
606 */
609 /* Add a CRL for the end certificate */
612 /* Add another CRL unrelated to the tested chain */
616 eeCert, sizeof(eeCert));
619 issuedForPara.pSubjectCert = endCert;
620 issuedForPara.pIssuerCert = rootCert;
621 context = NULL;
622 count = revoked_count = 0;
623 do {
625 &issuedForPara, context);
626 if (context)
627 {
629
630 count++;
631 if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
632 entry)
633 revoked_count++;
634 }
635 } while (context);
636 ok(count == 1, "expected 1 matching CRLs, got %ld\n", count);
637 ok(revoked_count == 1, "expected 1 matching CRL entries, got %ld\n", revoked_count);
638
639 /* Test CRL_FIND_ISSUED_BY flags */
640 count = revoked_count = 0;
641 do {
643 endCert, context);
644 if (context)
645 {
647
648 count++;
649 if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
650 entry)
651 revoked_count++;
652 }
653 } while (context);
654 ok(count == 0, "expected 0 matching CRLs, got %ld\n", count);
655 ok(revoked_count == 0, "expected 0 matching CRL entries, got %ld\n",
656 revoked_count);
657 count = revoked_count = 0;
658 do {
660 rootCert, context);
661 if (context)
662 {
664
665 count++;
666 if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
667 entry)
668 revoked_count++;
669 }
670 } while (context);
671 ok(count == 1, "expected 1 matching CRLs, got %ld\n", count);
672 ok(revoked_count == 1, "expected 1 matching CRL entries, got %ld\n",
673 revoked_count);
674 count = revoked_count = 0;
675 do {
677 CRL_FIND_ISSUED_BY, endCert, context);
678 if (context)
679 {
681
682 count++;
683 if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
684 entry)
685 revoked_count++;
686 }
687 } while (context);
688 ok(count == 0, "expected 0 matching CRLs, got %ld\n", count);
689 ok(revoked_count == 0, "expected 0 matching CRL entries, got %ld\n",
690 revoked_count);
691 count = revoked_count = 0;
692 do {
694 CRL_FIND_ISSUED_BY, rootCert, context);
695 if (context)
696 {
698
699 count++;
700 if (CertFindCertificateInCRL(rootCert, context, 0, NULL, &entry) &&
701 entry)
702 revoked_count++;
703 }
704 } while (context);
705 ok(count == 0, "expected 0 matching CRLs, got %ld\n", count);
706 ok(revoked_count == 0, "expected 0 matching CRL entries, got %ld\n",
707 revoked_count);
708 count = revoked_count = 0;
709 do {
710 context = CertFindCRLInStore(store, 0,
712 context);
713 if (context)
714 {
716
717 count++;
718 if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
719 entry)
720 revoked_count++;
721 }
722 } while (context);
723 ok(count == 0, "expected 0 matching CRLs, got %ld\n", count);
724 ok(revoked_count == 0, "expected 0 matching CRL entries, got %ld\n",
725 revoked_count);
726 count = revoked_count = 0;
727 do {
728 context = CertFindCRLInStore(store, 0,
730 context);
731 if (context)
732 {
734
735 count++;
736 if (CertFindCertificateInCRL(endCert, context, 0, NULL, &entry) &&
737 entry)
738 revoked_count++;
739 }
740 } while (context);
741 ok(count == 1, "expected 1 matching CRLs, got %ld\n", count);
742 ok(revoked_count == 1, "expected 1 matching CRL entries, got %ld\n",
743 revoked_count);
746
747 CertCloseStore(store, 0);
748}
PCCRL_CONTEXT WINAPI CertFindCRLInStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType, const void *pvFindPara, PCCRL_CONTEXT pPrevCrlContext)
Definition: crl.c:287
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const BYTE verisignCommercialSoftPubCA[]
Definition: crl.c:285
static const BYTE v2CRLWithIssuingDistPoint[]
Definition: crl.c:241
static const BYTE rootSignedCRL[]
Definition: crl.c:387
static const BYTE rootWithKeySignAndCRLSign[]
Definition: crl.c:324
static const BYTE bigCertWithDifferentIssuer[]
Definition: crl.c:53
static const BYTE eeCert[]
Definition: crl.c:358
static const BYTE bigCert2[]
Definition: crl.c:43
PCCERT_CONTEXT pIssuerCert
Definition: wincrypt.h:3087
PCCERT_CONTEXT pSubjectCert
Definition: wincrypt.h:3086
#define CRL_FIND_ISSUED_BY_AKI_FLAG
Definition: wincrypt.h:3079
#define CRL_FIND_ISSUED_BY_SIGNATURE_FLAG
Definition: wincrypt.h:3080
#define CRL_FIND_ANY
Definition: wincrypt.h:3074
#define CRL_FIND_ISSUED_FOR
Definition: wincrypt.h:3077
#define CRL_FIND_ISSUED_BY
Definition: wincrypt.h:3075

Referenced by START_TEST().

◆ testGetCRLFromStore()

static void testGetCRLFromStore ( void  )
static

Definition at line 750 of file crl.c.

751{
756 DWORD flags;
757 BOOL ret;
758
759 ok(store != NULL, "CertOpenStore failed: %08lx\n", GetLastError());
760 if (!store) return;
761
762 /* Crash
763 context = CertGetCRLFromStore(NULL, NULL, NULL, NULL);
764 context = CertGetCRLFromStore(store, NULL, NULL, NULL);
765 */
766
767 /* Bogus flags */
768 flags = 0xffffffff;
771 "Expected E_INVALIDARG, got %08lx\n", GetLastError());
772
773 /* Test an empty store */
774 flags = 0;
777 "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
778
781 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
782
783 /* NULL matches any CRL */
784 flags = 0;
786 ok(context != NULL, "Expected a context\n");
788
789 /* This cert's issuer isn't in */
791 sizeof(bigCert2));
792 ok(cert != NULL, "CertCreateCertificateContext failed: %08lx\n",
793 GetLastError());
796 "Expected CRYPT_E_NOT_FOUND, got %08lx\n", GetLastError());
798
799 /* But this one is */
801 sizeof(bigCert));
802 ok(cert != NULL, "CertCreateCertificateContext failed: %08lx\n",
803 GetLastError());
805 ok(context != NULL, "Expected a context\n");
808
809 CertCloseStore(store, 0);
810}
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 950 of file crl.c.

951{
952 BOOL ret;
953 PCCERT_CONTEXT cert1, cert2, cert3;
955 HCERTSTORE store;
956
959 ok(crl != NULL, "CertCreateCRLContext failed: %08lx\n", GetLastError());
961 sizeof(bigCert));
962 ok(cert1 != NULL, "CertCreateCertificateContext failed: %08lx\n",
963 GetLastError());
964
965 /* Crash
966 ret = CertIsValidCRLForCertificate(NULL, NULL, 0, NULL);
967 ret = CertIsValidCRLForCertificate(cert1, NULL, 0, NULL);
968 */
969
970 /* Curiously, any CRL is valid for the NULL certificate */
972 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
973
974 /* Same issuer for both cert and CRL, this CRL is valid for that cert */
976 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
977
980 ok(cert2 != NULL, "CertCreateCertificateContext failed: %08lx\n",
981 GetLastError());
982
983 /* Yet more curious: different issuers for these, yet the CRL is valid for
984 * that cert. According to MSDN, the relevant bit to check is whether the
985 * CRL has a CRL_ISSUING_DIST_POINT extension.
986 */
988 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
989
991
992 /* With a CRL_ISSUING_DIST_POINT in the CRL, it returns FALSE, since the
993 * cert doesn't have the same extension in it.
994 */
997 ok(crl != NULL, "CertCreateCRLContext failed: %08lx\n", GetLastError());
998
1001 "expected CRYPT_E_NO_MATCH, got %08lx\n", GetLastError());
1004 "expected CRYPT_E_NO_MATCH, got %08lx\n", GetLastError());
1005
1006 /* With a CRL_ISSUING_DIST_POINT in the CRL, it matches the cert containing
1007 * a CRL_DIST_POINTS_INFO extension.
1008 */
1011 ok(cert3 != NULL, "CertCreateCertificateContext failed: %08lx\n",
1012 GetLastError());
1014 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
1015
1017
1018 /* And again, with a real CRL, the CRL is valid for all three certs. */
1020 sizeof(verisignCRL));
1021 ok(crl != NULL, "CertCreateCRLContext failed: %08lx\n", GetLastError());
1022
1024 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
1026 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
1028 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
1029
1031
1032 /* One last test: a CRL in a different store than the cert is also valid
1033 * for the cert.
1034 */
1037 ok(store != NULL, "CertOpenStore failed: %08lx\n", GetLastError());
1038
1041 ok(ret, "CertAddEncodedCRLToStore failed: %08lx\n", GetLastError());
1042
1044 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
1046 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
1048 ok(ret, "CertIsValidCRLForCertificate failed: %08lx\n", GetLastError());
1049
1051
1052 CertCloseStore(store, 0);
1053
1057}
BOOL WINAPI CertIsValidCRLForCertificate(PCCERT_CONTEXT pCert, PCCRL_CONTEXT pCrl, DWORD dwFlags, void *pvReserved)
Definition: crl.c:681
static const BYTE bigCertWithCRLDistPoints[]
Definition: crl.c:936
static const BYTE cert2[]
Definition: message.c:797
static const BYTE cert1[]
Definition: message.c:781
#define CRYPT_E_NO_MATCH
Definition: winerror.h:4426

Referenced by START_TEST().

◆ testVerifyCRLRevocation()

static void testVerifyCRLRevocation ( void  )
static

Definition at line 1113 of file crl.c.

1114{
1115 BOOL ret;
1118
1120 ok(ret, "CertVerifyCRLRevocation failed: %08lx\n", GetLastError());
1122 ok(ret, "CertVerifyCRLRevocation failed: %08lx\n", GetLastError());
1123
1125 sizeof(bigCert));
1126
1127 /* Check against no CRL */
1128 ret = CertVerifyCRLRevocation(0, cert->pCertInfo, 0, NULL);
1129 ok(ret, "CertVerifyCRLRevocation failed: %08lx\n", GetLastError());
1131 ok(ret, "CertVerifyCRLRevocation failed: %08lx\n", GetLastError());
1132
1133 /* Check against CRL with entry for the cert */
1135 sizeof(v1CRLWithIssuerAndEntry));
1136 ret = CertVerifyCRLRevocation(0, cert->pCertInfo, 1,
1137 (PCRL_INFO *)&crl->pCrlInfo);
1138 ok(!ret, "CertVerifyCRLRevocation should have been revoked\n");
1140 (PCRL_INFO *)&crl->pCrlInfo);
1141 ok(!ret, "CertVerifyCRLRevocation should have been revoked\n");
1143
1144 /* Check against CRL with different issuer and entry for the cert */
1146 sizeof(crlWithDifferentIssuer));
1147 ok(crl != NULL, "CertCreateCRLContext failed: %08lx\n", GetLastError());
1149 (PCRL_INFO *)&crl->pCrlInfo);
1150 ok(!ret, "CertVerifyCRLRevocation should have been revoked\n");
1152
1153 /* Check against CRL without entry for the cert */
1155 sizeof(verisignCRL));
1156 ret = CertVerifyCRLRevocation(0, cert->pCertInfo, 1,
1157 (PCRL_INFO *)&crl->pCrlInfo);
1158 ok(ret, "CertVerifyCRLRevocation failed: %08lx\n", GetLastError());
1160 (PCRL_INFO *)&crl->pCrlInfo);
1161 ok(ret, "CertVerifyCRLRevocation failed: %08lx\n", GetLastError());
1163
1165}
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 936 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 1059 of file crl.c.

Referenced by testFindCertInCRL(), and testVerifyCRLRevocation().

◆ 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 358 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().

◆ 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 387 of file crl.c.

Referenced by testFindCRL().

◆ rootWithKeySignAndCRLSign

const BYTE rootWithKeySignAndCRLSign[]
static

Definition at line 324 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 235 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 241 of file crl.c.

Referenced by testFindCRL(), and testIsValidCRLForCert().

◆ verisignCommercialSoftPubCA

const BYTE verisignCommercialSoftPubCA[]
static

Definition at line 285 of file crl.c.

Referenced by testFindCRL().

◆ verisignCRL

const BYTE verisignCRL[]
static