Skip to content

chore: prevent panic by enforcing nonce length#2459

Merged
cstockton merged 1 commit into
masterfrom
etienne/prodsec-97-auth-sup-02-012
Mar 31, 2026
Merged

chore: prevent panic by enforcing nonce length#2459
cstockton merged 1 commit into
masterfrom
etienne/prodsec-97-auth-sup-02-012

Conversation

@staaldraad

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Bug fix / chore

What is the current behavior?

Current IsValid in crypto.go only validates that the nonce length is > 0. cipher.NewGCM() from the Go standard library panics if the nonce is not exactly 12 bytes.

What is the new behavior?

Matches the IsValid check with the behaviour of cipher.NewGCM() and prevents a panic.

@staaldraad staaldraad requested a review from a team as a code owner March 31, 2026 09:00

@cstockton cstockton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@cstockton cstockton merged commit c17e1f5 into master Mar 31, 2026
6 checks passed
@cstockton cstockton deleted the etienne/prodsec-97-auth-sup-02-012 branch March 31, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants