Commit c17e1f5
authored
chore: prevent panic by enforcing nonce length (#2459)
## 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.1 parent c7b58be commit c17e1f5
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
0 commit comments