Skip to content

Commit 57ce894

Browse files
committed
CRL refactor
- CheckCertCRLList: check all entries in case a single issuer has multiple CRL's loaded - test_multiple_crls_same_issuer: testing two different certificates forcing the client to check both CRL's from the same issuer - CRL_Entry - use a lock instead of a mutex to allow multiple threads to access the same list simultaneously - add a verifyMutex when doing verification so that we don't have to release the crlLock - Add allocation and free functions for CRL_Entry - DupCRL_Entry: simplify copying by copying all static fields in one memcpy
1 parent abfcda8 commit 57ce894

6 files changed

Lines changed: 219 additions & 206 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-----BEGIN X509 CRL-----
2+
MIICBDCB7QIBATANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMCVVMxEDAOBgNV
3+
BAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNhd3Rvb3Ro
4+
MRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20x
5+
HzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20XDTIzMDgyMjE3NDgzNloX
6+
DTI2MDUxODE3NDgzNlowFDASAgEBFw0yMzA4MjIxNzQ4MjlaoA4wDDAKBgNVHRQE
7+
AwIBAzANBgkqhkiG9w0BAQsFAAOCAQEArb/WuyC0mGBJXNdWFACKd8t3xHP1ypbH
8+
IkRyTBXGgsb7zjCiwraMxNBwaypaDURv3uVBIjSF+toJYnEB2cCj8K6VBeMOeqz7
9+
9l7gsP9xy6LP2YosqiN1MuGZP8SxUxBX9RlHPXO4i85s2DKwdBftg0rXdXLbhafx
10+
m6F3+CIIG+J6BO6D9KOrfaNcLZOgY3LTF2Rc1Y9qH2CUNBgfGMalFt1c13MsP2Oa
11+
Z22HWuJbiLPdeyEsFNy/4ROshgB85kMwZWZQA0LnD5gedwRuaAmlFwSuayl3epwE
12+
v0SQy1Kcp6UbZFTELiIoCNC8y9hL56okbux/TtiukU6mQkvIQBidtQ==
13+
-----END X509 CRL-----

certs/crl/gencrls.sh

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ mv tmp crl.revoked
9292
#cp crl.revoked ~/wolfssl/certs/crl/crl.revoked
9393

9494

95+
# remove revoked so next time through the normal CA won't have server revoked
96+
cp blank.index.txt demoCA/index.txt
97+
98+
# revoke the general server cert
99+
echo "Step 10"
100+
openssl ca -config ../renewcerts/wolfssl.cnf -revoke ../server-cert.pem -keyfile ../ca-key.pem -cert ../ca-cert.pem
101+
check_result $?
102+
103+
echo "Step 11"
104+
openssl ca -config ../renewcerts/wolfssl.cnf -gencrl -crldays 1000 -out extra-crls/general-server-crl.pem -keyfile ../ca-key.pem -cert ../ca-cert.pem
105+
check_result $?
106+
95107
# remove revoked so next time through the normal CA won't have server revoked
96108
cp blank.index.txt demoCA/index.txt
97109

@@ -105,7 +117,7 @@ openssl ca -config ../renewcerts/wolfssl.cnf -gencrl -crldays 1000 -out caEccCrl
105117
check_result $?
106118

107119
# metadata
108-
echo "Step 12"
120+
echo "Step 13"
109121
openssl crl -in caEccCrl.pem -text > tmp
110122
check_result $?
111123
mv tmp caEccCrl.pem
@@ -116,69 +128,69 @@ mv tmp caEccCrl.pem
116128
# server-revoked-cert.pem is already revoked in Step 10
117129
#openssl ca -config ../renewcerts/wolfssl.cnf -revoke ../server-revoked-cert.pem -keyfile ../ca-ecc384-key.pem -cert ../ca-ecc384-cert.pem
118130

119-
echo "Step 13"
131+
echo "Step 14"
120132
openssl ca -config ../renewcerts/wolfssl.cnf -gencrl -crldays 1000 -out caEcc384Crl.pem -keyfile ../ca-ecc384-key.pem -cert ../ca-ecc384-cert.pem
121133
check_result $?
122134

123135
# metadata
124-
echo "Step 14"
136+
echo "Step 15"
125137
openssl crl -in caEcc384Crl.pem -text > tmp
126138
check_result $?
127139
mv tmp caEcc384Crl.pem
128140
# install (only needed if working outside wolfssl)
129141
#cp caEcc384Crl.pem ~/wolfssl/certs/crl/caEcc384Crl.pem
130142

131143
# cliCrl
132-
echo "Step 15"
144+
echo "Step 16"
133145
openssl ca -config ../renewcerts/wolfssl.cnf -gencrl -crldays 1000 -out cliCrl.pem -keyfile ../client-key.pem -cert ../client-cert.pem
134146
check_result $?
135147

136148
# metadata
137-
echo "Step 16"
149+
echo "Step 17"
138150
openssl crl -in cliCrl.pem -text > tmp
139151
check_result $?
140152
mv tmp cliCrl.pem
141153
# install (only needed if working outside wolfssl)
142154
#cp cliCrl.pem ~/wolfssl/certs/crl/cliCrl.pem
143155

144156
# eccCliCRL
145-
echo "Step 17"
157+
echo "Step 18"
146158
openssl ca -config ../renewcerts/wolfssl.cnf -gencrl -crldays 1000 -out eccCliCRL.pem -keyfile ../ecc-client-key.pem -cert ../client-ecc-cert.pem
147159
check_result $?
148160

149161
# metadata
150-
echo "Step 18"
162+
echo "Step 19"
151163
openssl crl -in eccCliCRL.pem -text > tmp
152164
check_result $?
153165
mv tmp eccCliCRL.pem
154166
# install (only needed if working outside wolfssl)
155167
#cp eccCliCRL.pem ~/wolfssl/certs/crl/eccCliCRL.pem
156168

157169
# eccSrvCRL
158-
echo "Step 19"
170+
echo "Step 20"
159171
openssl ca -config ../renewcerts/wolfssl.cnf -gencrl -crldays 1000 -out eccSrvCRL.pem -keyfile ../ecc-key.pem -cert ../server-ecc.pem
160172
check_result $?
161173

162174
# metadata
163-
echo "Step 20"
175+
echo "Step 21"
164176
openssl crl -in eccSrvCRL.pem -text > tmp
165177
check_result $?
166178
mv tmp eccSrvCRL.pem
167179
# install (only needed if working outside wolfssl)
168180
#cp eccSrvCRL.pem ~/wolfssl/certs/crl/eccSrvCRL.pem
169181

170182
# caEccCrl
171-
echo "Step 21"
183+
echo "Step 22"
172184
openssl ca -config ./wolfssl.cnf -gencrl -crldays 1000 -out caEccCrl.pem -keyfile ../ca-ecc-key.pem -cert ../ca-ecc-cert.pem
173185
check_result $?
174186

175187
# ca-ecc384-cert
176-
echo "Step 22"
188+
echo "Step 23"
177189
openssl ca -config ./wolfssl.cnf -gencrl -crldays 1000 -out caEcc384Crl.pem -keyfile ../ca-ecc384-key.pem -cert ../ca-ecc384-cert.pem
178190
check_result $?
179191

180192
# create crl and crl2 der files for unit test
181-
echo "Step 23"
193+
echo "Step 24"
182194
openssl crl -in crl.pem -inform PEM -out crl.der -outform DER
183195
openssl crl -in crl2.pem -inform PEM -out crl2.der -outform DER
184196

0 commit comments

Comments
 (0)