Page MenuHomeFreeBSD

ktls: Add tests for receiving corrupted or invalid records.
ClosedPublic

Authored by jhb on Nov 12 2022, 12:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 11:47 AM
Unknown Object (File)
Sat, Oct 26, 8:07 PM
Unknown Object (File)
Oct 4 2024, 4:16 PM
Unknown Object (File)
Oct 4 2024, 1:22 PM
Unknown Object (File)
Sep 22 2024, 7:19 AM
Unknown Object (File)
Sep 22 2024, 2:23 AM
Unknown Object (File)
Sep 21 2024, 5:07 PM
Unknown Object (File)
Sep 18 2024, 6:44 PM
Subscribers

Details

Summary

These should all trigger errors when reading from the socket.

Tests include truncated records (socket closed early on the other
side), corrupted records (bits flipped in explicit IVs, ciphertext, or
MAC), invalid header fields, and various invalid record lengths.

Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Nov 12 2022, 12:03 AM
tests/sys/kern/ktls_test.c
1510

I think I ended up with this always being true (no callers pass 0).

1630

TOE TLS at least reports EBADMSG for these errors rather than EMSGSIZE.

markj added inline comments.
tests/sys/kern/ktls_test.c
696

Extra newline.

1549

Missing close_sockets() calls after each of the tests.

This revision is now accepted and ready to land.Nov 15 2022, 2:25 PM
jhb marked 2 inline comments as done.Nov 15 2022, 7:47 PM