• Nathaniel Caza's avatar
    crypto/x509: load all trusted certs on darwin (cgo) · e7f95b3c
    Nathaniel Caza authored
    The current implementation ignores certs wherein the
    Subject does not match the Issuer. An example of where
    this causes issue is an enterprise environment with
    intermediate CAs. In this case, the issuer is separate
    (and may be loaded) but the intermediate is ignored.
    A TLS handshake that does not include the intermediate
    cert would then fail with an untrusted error in Go.
    
    On other platforms (darwin-nocgo included), all trusted
    certs are loaded and accepted reguardless of
    Subject/Issuer names.
    
    This change removes the Subject/Issuer name-matching
    restriction of certificates when trustAsRoot is set,
    allowing all trusted certs to be loaded on darwin (cgo).
    
    Refs #16532
    
    Change-Id: I451e929588f8911892be6bdc2143d0799363c5f8
    Reviewed-on: https://go-review.googlesource.com/36942
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    e7f95b3c
Name
Last commit
Last update
..
pkix Loading commit data...
testdata Loading commit data...
cert_pool.go Loading commit data...
example_test.go Loading commit data...
name_constraints_test.go Loading commit data...
pem_decrypt.go Loading commit data...
pem_decrypt_test.go Loading commit data...
pkcs1.go Loading commit data...
pkcs8.go Loading commit data...
pkcs8_test.go Loading commit data...
root.go Loading commit data...
root_bsd.go Loading commit data...
root_cgo_darwin.go Loading commit data...
root_darwin.go Loading commit data...
root_darwin_arm_gen.go Loading commit data...
root_darwin_armx.go Loading commit data...
root_darwin_test.go Loading commit data...
root_linux.go Loading commit data...
root_nacl.go Loading commit data...
root_nocgo_darwin.go Loading commit data...
root_plan9.go Loading commit data...
root_solaris.go Loading commit data...
root_unix.go Loading commit data...
root_unix_test.go Loading commit data...
root_windows.go Loading commit data...
sec1.go Loading commit data...
sec1_test.go Loading commit data...
sha2_windows_test.go Loading commit data...
test-file.crt Loading commit data...
verify.go Loading commit data...
verify_test.go Loading commit data...
x509.go Loading commit data...
x509_test.go Loading commit data...
x509_test_import.go Loading commit data...