From 4f020a52c5830a490d7e0f76b221ac51d32f1305 Mon Sep 17 00:00:00 2001 From: Alexander Rakoczy Date: Tue, 26 Nov 2019 13:45:15 -0500 Subject: [PATCH] crypto/x509: correct error message for trailing issuer data The error message for trailing data after the X.509 issuer should correctly state "issuer" instead of "subject", which appears just above this code. Fixes #35841 Change-Id: Iea2605ce97f2b084eb78e88f2c27d7d43749d022 Reviewed-on: https://go-review.googlesource.com/c/go/+/208978 Run-TryBot: Alexander Rakoczy TryBot-Result: Gobot Gobot Reviewed-by: Katie Hockman --- src/crypto/x509/x509.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go index 013f1c996d..aaf2e684fa 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go @@ -1374,7 +1374,7 @@ func parseCertificate(in *certificate) (*Certificate, error) { if rest, err := asn1.Unmarshal(in.TBSCertificate.Issuer.FullBytes, &issuer); err != nil { return nil, err } else if len(rest) != 0 { - return nil, errors.New("x509: trailing data after X.509 subject") + return nil, errors.New("x509: trailing data after X.509 issuer") } out.Issuer.FillFromRDNSequence(&issuer)