From: Mikkel Krautz Date: Wed, 23 Jan 2013 17:20:17 +0000 (+0800) Subject: crypto/x509: skip SystemRootsError test on Windows X-Git-Tag: go1.1rc2~1301 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=249af5c85eb0ba05592ea3ffac71c4a2f824a216;p=gostls13.git crypto/x509: skip SystemRootsError test on Windows On Windows, crypto/x509 passes through to Windows's CryptoAPI to verify certificate chains. This method can't produce a SystemRootsError, so make sure we always skip the test on Windows. This is needed because testVerify is called in both TestGoVerify and TestSystemVerify on Windows - one is for testing the Go verifier, the other one is for testing the CryptoAPI verifier. The orignal CL tried to sidestep this issue by setting systemSkip to true, but that only affected TestSystemVerify. R=golang-dev, agl, snaury, minux.ma CC=golang-dev https://golang.org/cl/7185043 --- diff --git a/src/pkg/crypto/x509/verify_test.go b/src/pkg/crypto/x509/verify_test.go index 1ed95fe628..0381752e8d 100644 --- a/src/pkg/crypto/x509/verify_test.go +++ b/src/pkg/crypto/x509/verify_test.go @@ -35,7 +35,6 @@ var verifyTests = []verifyTest{ currentTime: 1302726541, dnsName: "www.google.com", testSystemRootsError: true, - systemSkip: true, // Without any roots specified we should get a system roots // error. @@ -214,6 +213,9 @@ func testVerify(t *testing.T, useSystemRoots bool) { if useSystemRoots && test.systemSkip { continue } + if runtime.GOOS == "windows" && test.testSystemRootsError { + continue + } opts := VerifyOptions{ Intermediates: NewCertPool(),