8000 Fix race condition in revoke · cloudflare/cfssl@1b44b48 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b44b48

Browse files
author
Ali Sayyah
committed
Fix race condition in revoke
1 parent 8090bce commit 1b44b48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

revoke/revoke.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ func getIssuer(cert *x509.Certificate) *x509.Certificate {
133133
// check a cert against a specific CRL. Returns the same bool pair
134134
// as revCheck, plus an error if one occurred.
135135
func certIsRevokedCRL(cert *x509.Certificate, url string) (revoked, ok bool, err error) {
136+
crlLock.Lock()
136137
crl, ok := CRLSet[url]
137138
if ok && crl == nil {
138139
ok = false
139-
crlLock.Lock()
140140
delete(CRLSet, url)
141-
crlLock.Unlock()
142141
}
142+
crlLock.Unlock()
143143

144144
var shouldFetchCRL = true
145145
if ok {

0 commit comments

Comments
 (0)
0