Skip to content

Load the most recent certificate#952

Merged
maraino merged 3 commits into
masterfrom
mariano/sort-certificates
Feb 18, 2026
Merged

Load the most recent certificate#952
maraino merged 3 commits into
masterfrom
mariano/sort-certificates

Conversation

@maraino

@maraino maraino commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

This commit changes the logic of MacKMS LoadCertificate and LoadCertificateChain to return the certificate with the newer NotBefore as long as it is before the current time.

This commit also fixes the linter errors that appear with the new version of golangci-lint.

This commit changes the logic of MacKMS LoadCertificate and
LoadCertificateChain to return the certificate with the newer NotBefore
as long as it is before the current time.
@maraino maraino force-pushed the mariano/sort-certificates branch from 3251024 to 9a16877 Compare February 18, 2026 04:11
Comment thread kms/mackms/mackms.go Outdated
dopey
dopey previously approved these changes Feb 18, 2026
@maraino maraino merged commit 4085a46 into master Feb 18, 2026
11 checks passed
@maraino maraino deleted the mariano/sort-certificates branch February 18, 2026 18:32
Comment thread kms/azurekms/utils.go
Comment on lines +164 to +167
// NewPublicKey validates that the point is on the curve
if _, err := ecdhCurve.NewPublicKey(uncompressed); err != nil {
return nil, errors.New("invalid EC key: point (x, y) does not lie on the curve")
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There can be other conditions returning an error. Technically, I guess it's correct to state that they're not on the curve for these cases, but we're losing some details by not wrapping the error returned from NewPublicKey. It's a pity there don't seem to be sentinel errors for these.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a linter error, so I've changed the implementation but I kept the message.

if !curve.IsOnCurve(key.X, key.Y) {
		return nil, errors.New("invalid EC key: point (x, y) does not lie on the curve")
}

Comment thread kms/mackms/mackms.go
Comment thread kms/mackms/mackms.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants