QUIC/decrypt_crypto: Actually check if decryption was successful

...and bail if it wasn't.

PCAP was produced using OSS-Fuzz input from issue 383379789.
This commit is contained in:
Arne Welzel 2024-12-11 13:04:45 +01:00 committed by Tim Wojtulewicz
parent d745d746bc
commit c2f2388f18
5 changed files with 19 additions and 2 deletions

View file

@ -0,0 +1,3 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
ts uid cause analyzer_kind analyzer_name failure_reason
1733909795.417573 C4J4Th3PJpwUYZZ6gc violation protocol QUIC decryption failed (<...>/QUIC.spicy:<location>)

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
ts uid proto history service
XXXXXXXXXX.XXXXXX ClEkJM2Vm5giqnMf4h udp D -
XXXXXXXXXX.XXXXXX C4J4Th3PJpwUYZZ6gc udp D -
XXXXXXXXXX.XXXXXX CHhAvVGS1DHFjwGM9 tcp F ftp

Binary file not shown.

View file

@ -0,0 +1,8 @@
# @TEST-DOC: Trace produced by OSS-Fuzz triggered a crash due to using a too small local buffer for decryption.
# @TEST-REQUIRES: ${SCRIPTS}/have-spicy
# @TEST-EXEC: zeek -Cr $TRACES/quic/383379789-decrypt-crash.pcap base/protocols/quic %INPUT
# @TEST-EXEC: zeek-cut -m ts uid proto history service < conn.log > conn.log.cut
# @TEST-EXEC: zeek-cut -m ts uid cause analyzer_kind analyzer_name failure_reason < analyzer.log > analyzer.log.cut
# @TEST-EXEC: btest-diff conn.log.cut
# @TEST-EXEC: TEST_DIFF_CANONIFIER='sed -E "s/\((.+)\.spicy:[0-9]+:[0-9]+(-[0-9]+:[0-9]+)?\)/(\1.spicy:<location>)/g" | $SCRIPTS/diff-remove-abspath' btest-diff analyzer.log.cut