mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
crypto: Don't assert for empty output buffers.
It is always valid for crp_payload_output_start to be 0. However, if an output buffer is empty (e.g. a decryption request with a tag but an empty payload), the existing assertion failed since 0 is not less than 0. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33193
This commit is contained in:
parent
357ba2cf17
commit
ec498562b7
1 changed files with 2 additions and 1 deletions
|
|
@ -1352,7 +1352,8 @@ crp_sanity(struct cryptop *crp)
|
|||
KASSERT(crp->crp_payload_output_start == 0,
|
||||
("payload output start non-zero without output buffer"));
|
||||
} else {
|
||||
KASSERT(crp->crp_payload_output_start < olen,
|
||||
KASSERT(crp->crp_payload_output_start == 0 ||
|
||||
crp->crp_payload_output_start < olen,
|
||||
("invalid payload output start"));
|
||||
KASSERT(crp->crp_payload_output_start +
|
||||
crp->crp_payload_length <= olen,
|
||||
|
|
|
|||
Loading…
Reference in a new issue