Closed adamlau closed 2 years ago
Hi!
Thanks for the detailed bug report!
If you can send me a sample pcap and key (kaian at irontec dot com), it would help a lot for debugging this one. I can compare each step output with wireshark to check when the output differs.
Thanks!!
Thanks for the sample data!
Looks like GCM decrypting is not properly implemented in sngrep openssl capture code, but gnutls version is actually working, so if you have the urgent need, you can compile your own sngrep with --with-gnutls while I check where the problem is.
Regards!
Thanks Kaian, compiling with --with-gnutls
worked for me. On Debian 11 Buster I also had to install the following packages to satisfy ./configure
:
Thanks again for this amazing tool!
Above commit should fix the implementation of GCM cipher with openssl if you want to give it a try. We never use TLS decrpyt in sngrep, so it looks like it've never worked before.
Thanks a lot for taking the time for the detailed bug report, providing sample data and feedback!!
Can confirm that commit fixed the issue for me.
Kind regards
Thanks for the confirmation! I'm closing this, it will be included in next release (no release date yet)
Hi, I'm trying to use sngrep to view SIP traffic over TLS. I can see SIP traffic in wireshark with decryption using private key. In sngrep I don't see any SIP traffic using the same private key. I can see unencrypted traffic fine. I can confirm from wireshark that the ssl handshake is using tlsv1.2 with
TLS_RSA_WITH_AES_256_GCM_SHA384 0x009D
These are the versions installed: sngrep - compiled from source
openssl version
OpenSSL 1.1.1n 15 Mar 2022
debian version
Executing sngrep with:
sngrep -k <path/to/privkey.pem> host <partner.sip.ip.address>
What I've done:
#define TLS_DEBUG 1
incapture_openssl.c
and can see it parsing out the tls handshake and application data packets.It seems to go through the logic in
tls_process_record_handshake
and do ClientHello, ServerHello and ClientKeyExchange. It picks up the correct client and server randoms (compared to what's seen in wireshark) and also prints out all the tls info e.g.client_write_key
,server_write_key
, etcIn the sngrep UI none of the expected TLS traffic shows. If I change the filter to listen to unencrypted traffic on port 5060 then sngrep displays the SIP traces as expected.
I can supply a pcap from wireshark if required.