File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed
Sources/PackageCollectionsSigning/Certificate Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -372,22 +372,11 @@ private struct BoringSSLOCSPClient {
372
372
}
373
373
374
374
group. notify ( queue: callbackQueue) {
375
- // If there's no result then something must have gone wrong
376
- guard !results. isEmpty else {
377
- return wrappedCallback ( . failure( CertificatePolicyError . ocspFailure) )
378
- }
379
-
380
- let statuses = results. compactMap { $0. success }
381
- // We got results but they are all failures
382
- guard !statuses. isEmpty else {
383
- diagnosticsEngine. emit ( error: " OCSP failed. All results: \( results) " )
384
- return wrappedCallback ( . failure( CertificatePolicyError . ocspFailure) )
385
- }
386
- // If at least one response is "bad status" then the chain is invalid
375
+ // Fail open: As long as no one says the cert is revoked we assume it's ok. If we receive no responses or
376
+ // all of them are failures we'd still assume the cert is not revoked.
387
377
guard results. compactMap ( { $0. success } ) . first ( where: { !$0 } ) == nil else {
388
378
return wrappedCallback ( . failure( CertificatePolicyError . invalidCertChain) )
389
379
}
390
- // Good status
391
380
wrappedCallback ( . success( ( ) ) )
392
381
}
393
382
}
@@ -542,7 +531,6 @@ enum CertificatePolicyError: Error, Equatable {
542
531
case unhandledCriticalException
543
532
case noTrustedRootCertsConfigured
544
533
case ocspSetupFailure
545
- case ocspFailure
546
534
}
547
535
548
536
private enum OCSPError : Error {
You can’t perform that action at this time.
0 commit comments