Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sngrep for openSUSE:Factory checked in at 2021-06-05 23:31:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sngrep (Old) and /work/SRC/openSUSE:Factory/.sngrep.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sngrep" Sat Jun 5 23:31:31 2021 rev:5 rq:897571 version:1.4.9 Changes: -------- --- /work/SRC/openSUSE:Factory/sngrep/sngrep.changes 2020-11-17 21:25:07.797368554 +0100 +++ /work/SRC/openSUSE:Factory/.sngrep.new.1898/sngrep.changes 2021-06-05 23:32:07.472499777 +0200 @@ -1,0 +2,8 @@ +Sat May 22 14:06:46 UTC 2021 - Martin Hauke <[email protected]> + +- Update to version 1.4.9 + * capture: add support for HEP/EEP protocol packet capture + * capture: fixed a buffer overflow while validating TCP packets + * call flow: improved display for B-leg extended flows + +------------------------------------------------------------------- Old: ---- sngrep-1.4.8.tar.gz New: ---- sngrep-1.4.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sngrep.spec ++++++ --- /var/tmp/diff_new_pack.Xd48OZ/_old 2021-06-05 23:32:07.860500452 +0200 +++ /var/tmp/diff_new_pack.Xd48OZ/_new 2021-06-05 23:32:07.860500452 +0200 @@ -1,8 +1,8 @@ # # spec file for package sngrep # -# Copyright (c) 2020 SUSE LLC -# Copyright (c) 2018-2020, Martin Hauke <[email protected]> +# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2018-2021, Martin Hauke <[email protected]> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: sngrep -Version: 1.4.8 +Version: 1.4.9 Release: 0 Summary: Ncurses SIP Messages flow viewer License: GPL-3.0-or-later ++++++ sngrep-1.4.8.tar.gz -> sngrep-1.4.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/.travis.yml new/sngrep-1.4.9/.travis.yml --- old/sngrep-1.4.8/.travis.yml 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/.travis.yml 2021-05-20 09:04:54.000000000 +0200 @@ -1,4 +1,7 @@ language: c +arch: + - amd64 + - ppc64le compiler: - clang - gcc @@ -16,3 +19,4 @@ only: - master - travis + - ppc64le diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/ChangeLog new/sngrep-1.4.9/ChangeLog --- old/sngrep-1.4.8/ChangeLog 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/ChangeLog 2021-05-20 09:04:54.000000000 +0200 @@ -1,3 +1,11 @@ +2021-05-20 Ivan Alonso <[email protected]> + * sngrep 1.4.9 released + + * capture: add support for HEP/EEP protocol packet capture + * capture: fixed a buffer overflow while validating TCP packets + * core: fixed timestamp formats for OpenBSD + * call flow: improved display for B-leg extended flows + 2020-11-10 Ivan Alonso <[email protected]> * sngrep 1.4.8 released diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/config/sngreprc new/sngrep-1.4.9/config/sngreprc --- old/sngrep-1.4.8/config/sngreprc 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/config/sngreprc 2021-05-20 09:04:54.000000000 +0200 @@ -35,6 +35,9 @@ ## Set size of pcap capture buffer in MB (default: 2) # set capture.buffer 2 +## Uncomment to enable parsing of captured HEP3 packets +# set capture.eep on + ##----------------------------------------------------------------------------- ## Default path in save dialog # set sngrep.savepath /tmp/sngrep-captures @@ -49,7 +52,7 @@ # set cl.defexitbutton 0/1 # Set default filter on startup -# set cl.filter INVITE +# set filter.methods INVITE ##----------------------------------------------------------------------------- ## You can change the default number of columns in call list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/configure.ac new/sngrep-1.4.9/configure.ac --- old/sngrep-1.4.8/configure.ac 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/configure.ac 2021-05-20 09:04:54.000000000 +0200 @@ -1,5 +1,5 @@ AC_PREREQ([2.59]) -AC_INIT([sngrep], [1.4.8], [[email protected]], [sngrep], [http://www.irontec.com/]) +AC_INIT([sngrep], [1.4.9], [[email protected]], [sngrep], [http://www.irontec.com/]) AM_INIT_AUTOMAKE([1.9]) AC_CONFIG_HEADERS([src/config.h]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/doc/sngrep.8 new/sngrep-1.4.9/doc/sngrep.8 --- old/sngrep-1.4.8/doc/sngrep.8 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/doc/sngrep.8 2021-05-20 09:04:54.000000000 +0200 @@ -1,9 +1,9 @@ .\" Man page for the sngrep .\" -.\" Copyright (c) 2013-2020 Ivan Alonso <[email protected]> -.\" Copyright (c) 2013-2020 Irontec S.L. +.\" Copyright (c) 2013-2021 Ivan Alonso <[email protected]> +.\" Copyright (c) 2013-2021 Irontec S.L. -.TH SNGREP 8 "Nov 2020" "sngrep 1.4.8" +.TH SNGREP 8 "May 2021" "sngrep 1.4.9" .SH NAME @@ -11,7 +11,7 @@ .SH SYNOPSIS -.B sngrep [-hVcivlkNq] [ -IO +.B sngrep [-hVcivlkNqE] [ -IO .I pcap_dump .B ] [ -d .I dev @@ -113,6 +113,10 @@ Argument must be an IP address and port in the format: udp:A.B.C.D:PORT .TP +.I -E +Enable parsing of captured HEP3 packets. + +.TP .I match expression Match given expression in Messages' payload. If one request message matches the given expression, the following messages within the same dialog will be also diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/pkg/debian/changelog new/sngrep-1.4.9/pkg/debian/changelog --- old/sngrep-1.4.8/pkg/debian/changelog 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/pkg/debian/changelog 2021-05-20 09:04:54.000000000 +0200 @@ -1,3 +1,9 @@ +sngrep (1.4.9) experimental; urgency=low + + * sngrep 1.4.9 released + + -- Ivan Alonso <[email protected]> Thu, 20 May 2021 09:02:43 +0200 + sngrep (1.4.8) experimental; urgency=low * sngrep 1.4.8 released diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/pkg/rpm/SPECS/sngrep.spec new/sngrep-1.4.9/pkg/rpm/SPECS/sngrep.spec --- old/sngrep-1.4.8/pkg/rpm/SPECS/sngrep.spec 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/pkg/rpm/SPECS/sngrep.spec 2021-05-20 09:04:54.000000000 +0200 @@ -2,7 +2,7 @@ Summary: SIP Messages flow viewer Name: sngrep -Version: 1.4.8 +Version: 1.4.9 Release: 0%{?dist} License: GPLv3 Group: Applications/Engineering @@ -59,6 +59,8 @@ %{__rm} -rf %{buildroot} %changelog +* Thu May 20 2021 Ivan Alonso <[email protected]> - 1.4.9 +- Version 1.4.9 * Tue Oct 10 2020 Ivan Alonso <[email protected]> - 1.4.8 - Version 1.4.8 * Thu May 21 2020 Ivan Alonso <[email protected]> - 1.4.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/capture.c new/sngrep-1.4.9/src/capture.c --- old/sngrep-1.4.8/src/capture.c 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/capture.c 2021-05-20 09:04:54.000000000 +0200 @@ -275,6 +275,10 @@ uint32_t size_payload = size_capture - capinfo->link_hl; // Captured packet info packet_t *pkt; +#ifdef USE_EEP + // Captured HEP3 packet info + packet_t *pkt_hep3; +#endif // Ignore packets while capture is paused if (capture_paused()) @@ -318,10 +322,27 @@ // Remove TCP Header from payload payload = (u_char *) (udp) + udp_off; - // Complete packet with Transport information - packet_set_type(pkt, PACKET_SIP_UDP); - packet_set_payload(pkt, payload, size_payload); - +#ifdef USE_EEP + // check for HEP3 header and parse payload + if(setting_enabled(SETTING_CAPTURE_EEP)) { + pkt_hep3 = capture_eep_receive_v3(payload, size_payload); + + if (pkt_hep3) { + packet_destroy(pkt); + pkt = pkt_hep3; + } else { + // Complete packet with Transport information + packet_set_type(pkt, PACKET_SIP_UDP); + packet_set_payload(pkt, payload, size_payload); + } + } else { +#endif + // Complete packet with Transport information + packet_set_type(pkt, PACKET_SIP_UDP); + packet_set_payload(pkt, payload, size_payload); +#ifdef USE_EEP + } +#endif } else if (pkt->proto == IPPROTO_TCP) { // Get TCP header tcp = (struct tcphdr *)((u_char *)(data) + (size_capture - size_payload)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/capture.h new/sngrep-1.4.9/src/capture.h --- old/sngrep-1.4.8/src/capture.h 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/capture.h 2021-05-20 09:04:54.000000000 +0200 @@ -48,15 +48,6 @@ #define _BSD_SOURCE 1 #endif -/* Old versions of libpcap in OpenBSD use <net/bpf.h> - * which actually defines timestamps as bpf_timeval instead - * of simple timeval. This no longer happens in newest libpcap - * versions, where header packets have timestamps in timeval - * structs */ -#if defined (__OpenBSD__) && defined(_NET_BPF_H_) -#define timeval bpf_timeval -#endif - #if defined(BSD) || defined (__OpenBSD__) || defined(__FreeBSD__) #include <sys/types.h> #include <sys/socket.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/capture_eep.c new/sngrep-1.4.9/src/capture_eep.c --- old/sngrep-1.4.8/src/capture_eep.c 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/capture_eep.c 2021-05-20 09:04:54.000000000 +0200 @@ -488,7 +488,7 @@ case 2: return capture_eep_receive_v2(); case 3: - return capture_eep_receive_v3(); + return capture_eep_receive_v3(NULL, 0); } return NULL; } @@ -600,7 +600,7 @@ * @return packet pointer */ packet_t * -capture_eep_receive_v3() +capture_eep_receive_v3(const u_char *pkt, uint32_t size) { struct hep_generic hg; @@ -623,11 +623,15 @@ //! Packet header struct pcap_pkthdr header; //! New created packet pointer - packet_t *pkt; + packet_t *pkt_new; - /* Receive EEP generic header */ - if (recvfrom(eep_cfg.server_sock, buffer, MAX_CAPTURE_LEN, 0, &eep_client, &eep_client_len) == -1) - return NULL; + if(!pkt) { + /* Receive EEP generic header */ + if (recvfrom(eep_cfg.server_sock, buffer, MAX_CAPTURE_LEN, 0, &eep_client, &eep_client_len) == -1) + return NULL; + } else { + memcpy(&buffer, pkt, size); + } // Initialize structs memset(&hg, 0, sizeof(hep_generic_t)); @@ -747,14 +751,14 @@ } // Create a new packet - pkt = packet_create((hg.ip_family.data == AF_INET)?4:6, hg.ip_proto.data, src, dst, 0); - packet_add_frame(pkt, &header, payload); - packet_set_type(pkt, PACKET_SIP_UDP); - packet_set_payload(pkt, payload, header.caplen); + pkt_new = packet_create((hg.ip_family.data == AF_INET)?4:6, hg.ip_proto.data, src, dst, 0); + packet_add_frame(pkt_new, &header, payload); + packet_set_type(pkt_new, PACKET_SIP_UDP); + packet_set_payload(pkt_new, payload, header.caplen); /* FREE */ sng_free(payload); - return pkt; + return pkt_new; } int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/capture_eep.h new/sngrep-1.4.9/src/capture_eep.h --- old/sngrep-1.4.8/src/capture_eep.h 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/capture_eep.h 2021-05-20 09:04:54.000000000 +0200 @@ -328,10 +328,12 @@ * function will parse received EEP data and create a new packet * structure. * + * @param pkt packet structure data, NULL if socket should be used + * @param size size of packet structure data * @return NULL on any error, packet structure otherwise */ packet_t * -capture_eep_receive_v3(); +capture_eep_receive_v3(const u_char *pkt, uint32_t size); /** * @brief Set EEP server url diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/curses/ui_call_flow.c new/sngrep-1.4.9/src/curses/ui_call_flow.c --- old/sngrep-1.4.8/src/curses/ui_call_flow.c 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/curses/ui_call_flow.c 2021-05-20 09:04:54.000000000 +0200 @@ -1110,7 +1110,7 @@ int raw_width, height, width; call_flow_info_t *info = call_flow_info(ui); ui_t *next_ui; - sip_call_t *call = NULL; + sip_call_t *call = NULL, *xcall = NULL; int rnpag_steps = setting_get_intvalue(SETTING_CF_SCROLLSTEP); int action = -1; @@ -1153,8 +1153,17 @@ werase(ui->win); if (call_group_count(info->group) == 1) { call = vector_first(info->group->calls); - call_group_add_calls(info->group, call->xcalls); - info->group->callid = call->callid; + if (call->xcallid != NULL && strlen(call->xcallid)) { + if ((xcall = sip_find_by_callid(call->xcallid))) { + call_group_del(info->group, call); + call_group_add(info->group, xcall); + call_group_add_calls(info->group, xcall->xcalls); + info->group->callid = xcall->callid; + } + } else { + call_group_add_calls(info->group, call->xcalls); + info->group->callid = call->callid; + } } else { call = vector_first(info->group->calls); vector_clear(info->group->calls); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/curses/ui_call_list.c new/sngrep-1.4.9/src/curses/ui_call_list.c --- old/sngrep-1.4.8/src/curses/ui_call_list.c 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/curses/ui_call_list.c 2021-05-20 09:04:54.000000000 +0200 @@ -563,7 +563,7 @@ ui_t *next_ui; sip_call_group_t *group; int action = -1; - sip_call_t *call; + sip_call_t *call, *xcall; sip_sort_t sort; // Sanity check, this should not happen @@ -632,8 +632,17 @@ // Add xcall to the group if (action == ACTION_SHOW_FLOW_EX) { call = vector_item(info->dcalls, info->cur_call); - call_group_add_calls(group, call->xcalls); - group->callid = call->callid; + if (call->xcallid != NULL && strlen(call->xcallid)) { + if ((xcall = sip_find_by_callid(call->xcallid))) { + call_group_del(group, call); + call_group_add(group, xcall); + call_group_add_calls(group, xcall->xcalls); + group->callid = xcall->callid; + } + } else { + call_group_add_calls(group, call->xcalls); + group->callid = call->callid; + } } if (action == ACTION_SHOW_RAW) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/main.c new/sngrep-1.4.9/src/main.c --- old/sngrep-1.4.8/src/main.c 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/main.c 2021-05-20 09:04:54.000000000 +0200 @@ -57,7 +57,7 @@ " [-k keyfile]" #endif #ifdef USE_EEP - " [-LH capture_url]" + " [-LHE capture_url]" #endif " [<match expression>] [<bpf filter>]\n\n" " -h --help\t\t This usage\n" @@ -80,6 +80,7 @@ #ifdef USE_EEP " -H --eep-send\t Homer sipcapture url (udp:X.X.X.X:XXXX)\n" " -L --eep-listen\t Listen for encapsulated packets (udp:X.X.X.X:XXXX)\n" + " -E --eep-parse\t Enable EEP parsing in captured packets\n" #endif #if defined(WITH_GNUTLS) || defined(WITH_OPENSSL) " -k --keyfile\t RSA private keyfile to decrypt captured packets\n" @@ -163,13 +164,14 @@ #ifdef USE_EEP { "eep-listen", required_argument, 0, 'L' }, { "eep-send", required_argument, 0, 'H' }, + { "eep-parse", required_argument, 0, 'E' }, #endif { "quiet", no_argument, 0, 'q' }, }; // Parse command line arguments that have high priority opterr = 0; - char *options = "hVd:I:O:B:pqtW:k:crl:ivNqDL:H:Rf:F"; + char *options = "hVd:I:O:B:pqtW:k:crl:ivNqDL:H:ERf:F"; while ((opt = getopt_long(argc, argv, options, long_options, &idx)) != -1) { switch (opt) { case 'h': @@ -301,6 +303,14 @@ break; #else fprintf(stderr, "sngrep is not compiled with HEP/EEP support."); + exit(1); +#endif + case 'E': +#ifdef USE_EEP + setting_set_value(SETTING_CAPTURE_EEP, SETTING_ON); + break; +#else + fprintf(stderr, "sngrep is not compiled with HEP/EEP support."); exit(1); #endif case '?': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/setting.c new/sngrep-1.4.9/src/setting.c --- old/sngrep-1.4.8/src/setting.c 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/setting.c 2021-05-20 09:04:54.000000000 +0200 @@ -51,6 +51,9 @@ { SETTING_CAPTURE_KEYFILE, "capture.keyfile", SETTING_FMT_STRING, "", NULL }, { SETTING_CAPTURE_TLSSERVER, "capture.tlsserver", SETTING_FMT_STRING, "", NULL }, #endif +#ifdef USE_EEP + { SETTING_CAPTURE_EEP, "capture.eep", SETTING_FMT_ENUM, SETTING_OFF, SETTING_ENUM_ONOFF }, +#endif { SETTING_CAPTURE_RTP, "capture.rtp", SETTING_FMT_ENUM, SETTING_OFF, SETTING_ENUM_ONOFF }, { SETTING_CAPTURE_STORAGE, "capture.storage", SETTING_FMT_ENUM, "memory", SETTING_ENUM_STORAGE }, { SETTING_CAPTURE_ROTATE, "capture.rotate", SETTING_FMT_ENUM, SETTING_OFF, SETTING_ENUM_ONOFF }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/setting.h new/sngrep-1.4.9/src/setting.h --- old/sngrep-1.4.8/src/setting.h 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/setting.h 2021-05-20 09:04:54.000000000 +0200 @@ -87,6 +87,9 @@ SETTING_CAPTURE_KEYFILE, SETTING_CAPTURE_TLSSERVER, #endif +#ifdef USE_EEP + SETTING_CAPTURE_EEP, +#endif SETTING_CAPTURE_RTP, SETTING_CAPTURE_STORAGE, SETTING_CAPTURE_ROTATE, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/sip.c new/sngrep-1.4.9/src/sip.c --- old/sngrep-1.4.8/src/sip.c 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/sip.c 2021-05-20 09:04:54.000000000 +0200 @@ -262,7 +262,7 @@ { uint32_t plen = packet_payloadlen(packet); u_char payload[MAX_SIP_PAYLOAD]; - regmatch_t pmatch[3]; + regmatch_t pmatch[4]; char cl_header[10]; int content_len; int bodylen; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sngrep-1.4.8/src/sip_msg.c new/sngrep-1.4.9/src/sip_msg.c --- old/sngrep-1.4.8/src/sip_msg.c 2020-11-10 10:53:53.000000000 +0100 +++ new/sngrep-1.4.9/src/sip_msg.c 2021-05-20 09:04:54.000000000 +0200 @@ -108,8 +108,10 @@ struct timeval t = { }; frame_t *frame; - if (msg && (frame = vector_first(msg->packet->frames))) - return frame->header->ts; + if (msg && (frame = vector_first(msg->packet->frames))) { + t.tv_sec = frame->header->ts.tv_sec; + t.tv_usec = frame->header->ts.tv_usec; + } return t; }
