]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: fix root CA extraction on macOS (cgo path)
authorFilippo Valsorda <hi@filippo.io>
Mon, 6 Aug 2018 19:41:34 +0000 (15:41 -0400)
committerFilippo Valsorda <filippo@golang.org>
Wed, 5 Dec 2018 22:52:03 +0000 (22:52 +0000)
commitf6be1cf109a2be59b96d1fa913adfa1fbc628579
tree64487765eca0480949415969a545f96ea3f25e1f
parentfb69478ecd7a6bec18b0e77665bbaadce4b7f2e8
crypto/x509: fix root CA extraction on macOS (cgo path)

The cgo path was not taking policies into account, using the last
security setting in the array whatever it was. Also, it was not aware of
the defaults for empty security settings, and for security settings
without a result type. Finally, certificates restricted to a hostname
were considered roots.

The API docs for this code are partial and not very clear, so this is a
best effort, really.

Updates #24652

Change-Id: I8fa2fe4706f44f3d963b32e0615d149e997b537d
Reviewed-on: https://go-review.googlesource.com/c/128056
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@golang.org>
src/crypto/x509/root_cgo_darwin.go
src/crypto/x509/root_darwin.go