]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509: restore support for ios tag on darwin/amd64
authorFilippo Valsorda <filippo@golang.org>
Wed, 24 Jun 2020 16:59:10 +0000 (12:59 -0400)
committerFilippo Valsorda <filippo@golang.org>
Wed, 24 Jun 2020 20:16:49 +0000 (20:16 +0000)
Fixes #38710

Change-Id: I9b210e95fd997ff53ec704c5f61110045aaa94bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/239559
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
src/cmd/dist/test.go
src/crypto/x509/root.go
src/crypto/x509/root_cgo_darwin_amd64.go
src/crypto/x509/root_darwin_amd64.go
src/crypto/x509/root_darwin_ios.go [moved from src/crypto/x509/root_darwin_arm64.go with 99% similarity]
src/crypto/x509/root_darwin_ios_gen.go [moved from src/crypto/x509/root_darwin_arm64_gen.go with 94% similarity]
src/crypto/x509/root_omit.go
src/crypto/x509/root_omit_test.go

index e1cd4965c343071365711f4c327f9bd166f11da4..2dc945921524abf1d14aa86618085ef30de735d8 100644 (file)
@@ -461,6 +461,18 @@ func (t *tester) registerTests() {
                })
        }
 
+       // Test the ios build tag on darwin/amd64 for the iOS simulator.
+       if goos == "darwin" && !t.iOS() {
+               t.tests = append(t.tests, distTest{
+                       name:    "amd64ios",
+                       heading: "ios tag on darwin/amd64",
+                       fn: func(dt *distTest) error {
+                               t.addCmd(dt, "src", t.goTest(), t.timeout(300), "-tags=ios", "-run=SystemRoots", "crypto/x509")
+                               return nil
+                       },
+               })
+       }
+
        if t.race {
                return
        }
index 8606a0f547c656d9467eec32ef50ee51bede8da8..da5e91b91cc3a602d30532922ce7eceef2dc591d 100644 (file)
@@ -4,7 +4,7 @@
 
 package x509
 
-//go:generate go run root_darwin_arm64_gen.go -version 55161.80.1
+//go:generate go run root_darwin_ios_gen.go -version 55161.80.1
 
 import "sync"
 
index bec57eb8367dc2a4b4bc375f36b3f31bd448ee7a..15c72cc0c837bf9a3a36f0ea757c11d301b0bb39 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build !ios
+
 package x509
 
 // This cgo implementation exists only to support side-by-side testing by
index 8ad5a9607dfae5b41f341764ca20012fdcfff0d5..ccc37b8ec5dae509425b52b78183b16554faac35 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build !ios
+
 package x509
 
 import (
similarity index 99%
rename from src/crypto/x509/root_darwin_arm64.go
rename to src/crypto/x509/root_darwin_ios.go
index 4d9af12c3844e62a7b9172f99b16934ec8633c59..5ecc4911b356ce7cadc4ddb9de1b54da4d8cdd46 100644 (file)
@@ -1,6 +1,7 @@
-// Code generated by root_darwin_arm64_gen.go -version 55161.80.1; DO NOT EDIT.
+// Code generated by root_darwin_ios_gen.go -version 55161.80.1; DO NOT EDIT.
 // Update the version in root.go and regenerate with "go generate".
 
+// +build darwin,arm64 darwin,amd64,ios
 // +build !x509omitbundledroots
 
 package x509
similarity index 94%
rename from src/crypto/x509/root_darwin_arm64_gen.go
rename to src/crypto/x509/root_darwin_ios_gen.go
index baad8a2b0285b81c4b412440e01c7fb14fe525d7..7a42466e5f0a1cd36a64ad6d05842fb0b2396809 100644 (file)
@@ -4,7 +4,7 @@
 
 // +build ignore
 
-// Generates root_darwin_arm64.go.
+// Generates root_darwin_ios.go.
 //
 // As of iOS 13, there is no API for querying the system trusted X.509 root
 // certificates.
@@ -37,7 +37,7 @@ import (
 )
 
 func main() {
-       var output = flag.String("output", "root_darwin_arm64.go", "file name to write")
+       var output = flag.String("output", "root_darwin_ios.go", "file name to write")
        var version = flag.String("version", "", "security_certificates version")
        flag.Parse()
        if *version == "" {
@@ -156,9 +156,10 @@ func main() {
        }
 }
 
-const header = `// Code generated by root_darwin_arm64_gen.go -version %s; DO NOT EDIT.
+const header = `// Code generated by root_darwin_ios_gen.go -version %s; DO NOT EDIT.
 // Update the version in root.go and regenerate with "go generate".
 
+// +build darwin,arm64 darwin,amd64,ios
 // +build !x509omitbundledroots
 
 package x509
index b757ea81c20d5c89d9294b8d4f5d174e9e7b402c..175d71643b2f3494719bdc37ceb1a4691f64bad3 100644 (file)
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin,arm64,x509omitbundledroots
+// +build darwin,arm64 darwin,amd64,ios
+// +build x509omitbundledroots
 
 // This file provides the loadSystemRoots func when the
 // "x509omitbundledroots" build tag has disabled bundling a copy,
index 2a9fb3f0c326a4785b19f99664c49be10fc10793..5ab6c931deb619a7eb4da4b39bea942817cbbc41 100644 (file)
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin,arm64,x509omitbundledroots
+// +build darwin,arm64 darwin,amd64,ios
+// +build x509omitbundledroots
 
 package x509