Ask Your Question
0

Diffie-Hellman/TLS decryption breaks after 'TCP Previous Segment not captured' / 'TCP Out-Of-Order'

asked 2025-01-12 02:36:07 +0000

tasty_sprout gravatar image

Hello!

Diffie-Hellman/TLS decryption works fine until the packets get out of order ('TCP Out-Of-Order', 'TCP Previous Segment not captured').

Is there anything that can be done to recover from the interruption and continue the decryption?

The application uses secure WebSocket with TLSv1.2/3 and Elliptic-curve Diffie-Hellman for key exchange.

Kind regards

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2025-01-12 10:44:40 +0000

grahamb gravatar image

See the Wireshark Users Guide section 7.8.3 TCP Reasembly for more info on the TCP preference setting "Reassemble out-of-order segments" (off by default) that may help.

edit flag offensive delete link more

Comments

Thank you for the pointer to the man page!

Enabling 'Reassemble out-of-order-segments' certainly had an effect. In one case the decryption broke-down even earlier ;) :D.

In another case the decryption went on for longer but broke-down eventually - I think it broke-down again while a fairly large (+20 MB) WebSocket message was transmitted and another "TCP Previous segment not captured" info is shown in the GUI. After that info line the type in the Protocol column went from TLSv1.3 to TCP and stayed that way in that direction.

I'm not sure if this is noteworthy but what I also see is that the decryption doesn't break-down completely. Instead the decryption stays intact in only one direction (IP.A -> IP.B but not the other way around).

Are there maybe other knobs I could try to adjust?

tasty_sprout gravatar imagetasty_sprout ( 2025-01-14 04:32:41 +0000 )edit

If you're dropping packets and they aren't retransmitted then the decryption can't succeed.

Recent versions of Wireshark have TCP "completeness" flags that indicate that state of the connection from the initial SYN to the final FIN, ACK (or RST). Look at tcp.completeness*.

grahamb gravatar imagegrahamb ( 2025-01-14 08:43:05 +0000 )edit

Great, thank you! I'll dig into it.

But what confuses me a little is that the actual application was still maintaining the bidirectional TLS conversation / exchange. So it seems to me that the packets weren't actually missing but Wireshark wasn't able to capture them because of some reason. Is this a posibility? Can anything be done about that? Kind regards

tasty_sprout gravatar imagetasty_sprout ( 2025-01-14 16:36:38 +0000 )edit

If your capture method is dropping packets then you need to build a better capture method!

Some discussion about drops on @Jasperblog

grahamb gravatar imagegrahamb ( 2025-01-14 16:48:54 +0000 )edit

Thank you, I appreciate your feedback!

tasty_sprout gravatar imagetasty_sprout ( 2025-01-14 17:02:32 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2025-01-12 02:36:07 +0000

Seen: 45 times

Last updated: Jan 12