Skip to content

Commit bb8f9a6

Browse files
crypto/x509: fix system root tests + darwin intermediate handling
On Windows, replace tests which rely on a root that expired last year. On Darwin fix an test which wasn't testing the expected behavior, and fix the behavior which was broken. Fixes #58791 Change-Id: I771175b9e123b8bb0e4efdf58cc2bb93aa94fbae Reviewed-on: https://go-review.googlesource.com/c/go/+/472295 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Run-TryBot: Roland Shoemaker <[email protected]>
1 parent 0384235 commit bb8f9a6

File tree

3 files changed

+238
-259
lines changed

3 files changed

+238
-259
lines changed

src/crypto/x509/root_darwin.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate
2525
return nil, err
2626
}
2727
sc, err := macOS.SecCertificateCreateWithData(c.Raw)
28-
if err == nil {
29-
macOS.CFArrayAppendValue(certs, sc)
28+
if err != nil {
29+
return nil, err
3030
}
31+
macOS.CFArrayAppendValue(certs, sc)
3132
}
3233
}
3334

src/crypto/x509/root_unix_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func TestLoadSystemCertsLoadColonSeparatedDirs(t *testing.T) {
149149
tmpDir := t.TempDir()
150150

151151
rootPEMs := []string{
152-
geoTrustRoot,
152+
gtsRoot,
153153
googleLeaf,
154154
startComRoot,
155155
}

0 commit comments

Comments
 (0)