From 1a3957b828389fb38df0f60d43f08da15bc125c1 Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Wed, 27 Jun 2018 21:40:22 -0500 Subject: [PATCH] crypto/x509: better debug output for verify-cert calls Now that pkix.Name offers String() we should use that as some CN's are blank. Updates #24084 Change-Id: I268196f04b98c2bd4d5d0cf1fecd2c9bafeec0f1 Reviewed-on: https://go-review.googlesource.com/121357 Reviewed-by: Brad Fitzpatrick --- src/crypto/x509/root_darwin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go index bc35a1cf21..9d7b3a6ffb 100644 --- a/src/crypto/x509/root_darwin.go +++ b/src/crypto/x509/root_darwin.go @@ -181,12 +181,12 @@ func verifyCertWithSystem(block *pem.Block, cert *Certificate) bool { } if err := cmd.Run(); err != nil { if debugExecDarwinRoots { - println(fmt.Sprintf("crypto/x509: verify-cert rejected %s: %q", cert.Subject.CommonName, bytes.TrimSpace(stderr.Bytes()))) + println(fmt.Sprintf("crypto/x509: verify-cert rejected %s: %q", cert.Subject, bytes.TrimSpace(stderr.Bytes()))) } return false } if debugExecDarwinRoots { - println(fmt.Sprintf("crypto/x509: verify-cert approved %s", cert.Subject.CommonName)) + println(fmt.Sprintf("crypto/x509: verify-cert approved %s", cert.Subject)) } return true } -- 2.50.0