ktls / af_ktls

Linux Kernel TLS/DTLS Module
GNU General Public License v2.0
157 stars 25 forks source link

peek tcp data using tcp_read_sock #74

Closed lancerchao closed 8 years ago

lancerchao commented 8 years ago

We need a way to "peek" data from tcp socket using tcp_read_sock (which is stated in the comments that it is currently not supported). If for whatever reason we decide the packet is bad during the decryption stage, we can't let userspace SSL handle the packet since at that point it has already been pulled from TCP's receive queue.

http://lxr.free-electrons.com/source/net/ipv4/tcp.c#L1490 Related #37

fridex commented 8 years ago

https://github.com/ktls/af_ktls/issues/21 relates as well.

We could just introduce MSG_PEEK support for tcp_read_sock, if possible. There are already comments in sources.

djwatson commented 8 years ago

I'm going to close this, this is being worked on upstream