Skip to content

Commit 62c9f17

Browse files
x509roots/nss: manually exclude a confusingly constrained root
Fixes golang/go#61963 Change-Id: I16920d160af74772ef5aa650d1274e07c3ca9adc Reviewed-on: https://go-review.googlesource.com/c/crypto/+/562475 Reviewed-by: Filippo Valsorda <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 405cb3b commit 62c9f17

File tree

2 files changed

+17
-28
lines changed

2 files changed

+17
-28
lines changed

x509roots/fallback/bundle.go

-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x509roots/nss/parser.go

+17
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ func parseTrustClass(s *bufio.Scanner) ([sha1.Size]byte, *trustObj, error) {
147147
return h, to, nil
148148
}
149149

150+
// manualExclusions contains a map of SHA1 fingerprints of roots that we manually exclude
151+
// from the bundle for various reasons.
152+
var manualExclusions = map[string]bool{
153+
// TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1
154+
// We exclude this root because mozilla manually constrains this root to
155+
// issue names under .tr, but this information is only encoded in the CCADB
156+
// IncludedCACertificateReport, in a field the format of which is
157+
// undocumented, and is only used for this particular certificate. Rather
158+
// than adding special parsing for this, we skip it. When code constraint
159+
// support is available, we may also want to simply add a manual constraint,
160+
// rather than a manual exclusion.
161+
"3143649becce27eced3a3f0b8f0de4e891ddeeca": true,
162+
}
163+
150164
// Parse parses a NSS certdata.txt formatted file, returning only
151165
// trusted serverAuth roots, as well as any additional constraints. This parser
152166
// is very opinionated, only returning roots that are currently trusted for
@@ -248,6 +262,9 @@ func Parse(r io.Reader) ([]*Certificate, error) {
248262
if !e.trust.trusted {
249263
continue
250264
}
265+
if manualExclusions[fmt.Sprintf("%x", h)] {
266+
continue
267+
}
251268
nssCert := &Certificate{X509: e.cert.c}
252269
if e.cert.DistrustAfter != nil {
253270
nssCert.Constraints = append(nssCert.Constraints, DistrustAfter(*e.cert.DistrustAfter))

0 commit comments

Comments
 (0)