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

self-signed leaf cert validation issue #126

Open
JeyJeyGao opened this issue Feb 28, 2023 · 3 comments
Open

self-signed leaf cert validation issue #126

JeyJeyGao opened this issue Feb 28, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@JeyJeyGao
Copy link
Contributor

We didn’t check the issuer of the self-signed leaf certificate. The self-signed leaf certificate should also be self-issued.

if len(certChain) == 1 {
cert := certChain[0]
if signingTime != nil && (signingTime.Before(cert.NotBefore) || signingTime.After(cert.NotAfter)) {
return fmt.Errorf("certificate with subject %q was not valid at signing time of %s", cert.Subject, signingTime.UTC())
}
if err := cert.CheckSignature(cert.SignatureAlgorithm, cert.RawTBSCertificate, cert.Signature); err != nil {
return fmt.Errorf("invalid self-signed certificate. subject: %q. Error: %w", cert.Subject, err)
}
if err := validateLeafCertificate(cert, expectedLeafEku); err != nil {
return fmt.Errorf("invalid self-signed certificate. Error: %w", err)
}
return nil
}

@JeyJeyGao JeyJeyGao added the enhancement New feature or request label Feb 28, 2023
Copy link

This issue is stale because it has been opened for 60 days with no activity. Remove stale label or comment. Otherwise, it will be closed in 30 days.

@github-actions github-actions bot added the Stale label Mar 22, 2024
@yizha1
Copy link
Contributor

yizha1 commented Apr 11, 2024

@JeyJeyGao is this still a valid issue?

@yizha1 yizha1 removed the Stale label Apr 11, 2024
@JeyJeyGao
Copy link
Contributor Author

We can close it now.

@JeyJeyGao JeyJeyGao reopened this Apr 12, 2024
@yizha1 yizha1 added this to the 1.3.0 milestone Apr 23, 2024
@yizha1 yizha1 modified the milestones: 1.3.0, 1.2.0 Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants