Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto/x509: error for "trailing data after X.509 subject" should say "issuer" instead #35841

Closed
egonk opened this issue Nov 26, 2019 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@egonk
Copy link

egonk commented Nov 26, 2019

See the following error in parseCertificate:

return nil, errors.New("x509: trailing data after X.509 subject")

It should probably say issuer, not subject.

Edit:

	var issuer, subject pkix.RDNSequence
	if rest, err := asn1.Unmarshal(in.TBSCertificate.Subject.FullBytes, &subject); err != nil {
		return nil, err
	} else if len(rest) != 0 {
		return nil, errors.New("x509: trailing data after X.509 subject")
	}
	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")
	}
@toothrot toothrot self-assigned this Nov 26, 2019
@toothrot toothrot added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 26, 2019
@toothrot toothrot added this to the Go1.14 milestone Nov 26, 2019
@toothrot
Copy link
Contributor

This looks pretty clearly incorrect. I'll take a look at this.

@gopherbot
Copy link

Change https://golang.org/cl/208978 mentions this issue: crypto/x509: correct error message for trailing issuer data

@toothrot toothrot modified the milestones: Go1.14, Go1.15 Nov 26, 2019
@odeke-em odeke-em changed the title x509: trailing data after X.509 subject / issuer crypto/x509: error for "trailing data after X.509 subject" should say "issuer" instead Nov 26, 2019
@golang golang locked and limited conversation to collaborators Feb 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants