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)
Sun, Mar 17, 3:17 AM
Unknown Object (File)
Sun, Mar 17, 3:17 AM
Unknown Object (File)
Sun, Mar 17, 3:17 AM
Unknown Object (File)
Thu, Mar 14, 10:41 AM
Unknown Object (File)
Mon, Mar 4, 1:06 PM
Unknown Object (File)
Jan 12 2024, 8:26 AM
Unknown Object (File)
Dec 20 2023, 4:55 AM
Unknown Object (File)
Nov 29 2023, 2:12 AM
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