Skip to content

Commit 5e18135

Browse files
committed
crypto/x509: drop the cgo implementation of root_darwin_amd64.go
This code was preserved just to do side-by-side testing while transitioning to the Go implementation. There haven't been mismatch issues, so drop the cgo code, which was making it hard to improve the Go code without diverging. Change-Id: I2a23039c31a46e88b94250aafbc98d4ea8daf22f Reviewed-on: https://go-review.googlesource.com/c/go/+/232397 Run-TryBot: Filippo Valsorda <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Filippo Valsorda <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent d7fff1f commit 5e18135

File tree

10 files changed

+9
-374
lines changed

10 files changed

+9
-374
lines changed

src/cmd/dist/test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,6 @@ func (t *tester) testDirTest(dt *distTest, shard, shards int) error {
14441444

14451445
// cgoPackages is the standard packages that use cgo.
14461446
var cgoPackages = []string{
1447-
"crypto/x509",
14481447
"net",
14491448
"os/user",
14501449
}

src/crypto/x509/internal/macos/corefoundation.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import (
1616
"unsafe"
1717
)
1818

19+
// Core Foundation linker flags for the external linker. See Issue 42459.
20+
//go:cgo_ldflag "-framework"
21+
//go:cgo_ldflag "CoreFoundation"
22+
1923
// CFRef is an opaque reference to a Core Foundation object. It is a pointer,
2024
// but to memory not owned by Go, so not an unsafe.Pointer.
2125
type CFRef uintptr

src/crypto/x509/internal/macos/security.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import (
1212
"unsafe"
1313
)
1414

15+
// Security.framework linker flags for the external linker. See Issue 42459.
16+
//go:cgo_ldflag "-framework"
17+
//go:cgo_ldflag "Security"
18+
1519
// Based on https://opensource.apple.com/source/Security/Security-59306.41.2/base/Security.h
1620

1721
type SecTrustSettingsResult int32

src/crypto/x509/root_cgo_darwin.go

Lines changed: 0 additions & 326 deletions
This file was deleted.

src/crypto/x509/root_darwin.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate
2020
return nil, nil
2121
}
2222

23-
// loadSystemRootsWithCgo is set in root_cgo_darwin_amd64.go when cgo is
24-
// available, and is only used for testing.
25-
var loadSystemRootsWithCgo func() (*CertPool, error)
26-
2723
func loadSystemRoots() (*CertPool, error) {
2824
var trustedRoots []*Certificate
2925
untrustedRoots := make(map[string]bool)

0 commit comments

Comments
 (0)