Open armfazh opened 7 months ago
Why should we accept a buffer that is too large? Wouldn't we miss certain bugs if we do?
Agree, I have changed the code, so now, it enforces passing a slice of the exact size when unmarshaling keys. Otherwise, it returns an error instead of panic, which is the actual bug reported in #488 .
hpke: Allows passing a larger buffer to
UnmarshalBinary
for KEM keys. It checks data passed is in the right boundaries. Also adds a test showing the issue.Fixes #488