forgejo/modules/keying
Gusted 967603abcc
feat: harden keying implementation
Harden the current checks in place, I doubt these will ever hit (you can
prove easily by reading the current source code this cannot happen) but
just in case a new Go version does something weird or something else
goes catastrophicly wrong, this should add an extra defense-in-depth
layer.

`n != aeadKeySize` will panic a nil error, don't think it's needed to
add more logic to this, a nil error is enough to indicate that that
condition failed (given the other condition is `err != nil`).

Also move constant integers to being `const`, this helps reducing the
amount of instructions being done for the extra check.
2024-12-25 00:10:18 +01:00
..
keying.go feat: harden keying implementation 2024-12-25 00:10:18 +01:00
keying_test.go Update modules/keying/keying_test.go 2024-11-28 10:35:55 +00:00