Repository metrics
- Stars
- (30,157 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
Consider the application of a network monitoring system.
The NMS intercepts TLS traffic and it is critical that it reacts immediately to the presence of certain application data on the wire. The NMS does not want to wait for full records to be available as it might be too late, so the problem to solve is decryption of partial records. I cannot rely on RFC6066 max_fragment_length or DTLS to improve granularity of reads because that requires the other peer to collaborate.
I understand that partial record decryption should be possible for all ciphers, as long as I attempt decryption at a multiple of the block size. Integrity is not important for this use case.
My intent is to:
- Read into the underlying buffer before a full record is available with
rl->funcs->read_n, whererlis theOSSL_RECORD_LAYERobject, as done bytls_get_more_recordsviatls_default_read_n. - Make a copy of the cipher context with
EVP_CIPHER_CTX_copyand decrypt as usual with the EVP apis (although I can see that not every cipher registers dupctx at the moment #20978). - If I see anything other than
SSL3_RT_APPLICATION_DATAin the header type field, give up the partial read and let it be handled as usual.
Is this reasonable?