From aa1b39e8fecfa79d1e314d59e20780f606b0a71c Mon Sep 17 00:00:00 2001 From: Mateus Vanin de Lemos Date: Mon, 9 Nov 2026 12:19:55 -0300 Subject: [PATCH 1/4] Add --record_fname_encode to record calls whose Call-ID contains '/' Since 9c50b4e7, rtpp_record_ctor() refuses to record (R, Rs, -a) when the Call-ID or from-tag used in the file name contains '/', which keeps recordings inside of the recording directory. '/' is a legal Call-ID character and some carriers use it routinely, so those calls end up not recorded at all for clients that still rely on R. Add an opt-in --record_fname_encode option. When it is given, '/' and '%' in the Call-ID and from-tag are percent-encoded as "%2F" and "%25" before the name is built, so the file is created inside of the recording directory, never contains '/', and the original value can be recovered by decoding the "%XX" sequences. The encoded value is bounded by the same PATH_MAX buffers and the snprintf() truncation checks are kept, so names that do not fit are still refused. The default behaviour is unchanged: without the option '/' is refused as before (the log message now points at the option). Names given explicitly with C are not affected. Add a recording/basic sub-test, badpath_enc, that records the traversal Call-IDs from badpath and a Call-ID with '%' under their encoded names with the option, and still refuses an over-long Call-ID. --- doc/manpage.xml | 17 +++++++ rtpproxy.8 | 24 ++++++++- src/main.c | 7 +++ src/rtpp_cfg.h | 2 + src/rtpp_record.c | 68 +++++++++++++++++++++----- tests/recording/basic | 2 +- tests/recording/basic.badpath_enc.rptl | 51 +++++++++++++++++++ 7 files changed, 158 insertions(+), 13 deletions(-) create mode 100644 tests/recording/basic.badpath_enc.rptl diff --git a/doc/manpage.xml b/doc/manpage.xml index 8ac63170c..6bbcad936 100644 --- a/doc/manpage.xml +++ b/doc/manpage.xml @@ -186,6 +186,7 @@ + @@ -819,6 +820,22 @@ names. + + + + + + When the recording file name is built from the Call-ID and + from-tag (the R command and the + option), percent-encode the / + and % characters as %2F and + %25 instead of refusing to record calls whose + Call-ID or from-tag contains /, which is a legal + character in SIP. The original value can be recovered by decoding + the %XX sequences. File names given explicitly with + the C command are not affected. + + diff --git a/rtpproxy.8 b/rtpproxy.8 index 695805388..aa947f602 100644 --- a/rtpproxy.8 +++ b/rtpproxy.8 @@ -31,7 +31,7 @@ rtpproxy \- RTP (Real\-time Transport Protocol) Proxy Server .SH "SYNOPSIS" .HP \w'\fBrtpproxy\fR\ 'u -\fBrtpproxy\fR [\fB\-?\fR] [\fB\-2\fR] [\fB\-f\fR] [\fB\-v\fR] [\fB\-V\fR] [\fB\-R\fR] [\fB\-l\fR\ \fIaddr1\fR\fI[/addr2]\fR...] [\fB\-l\fR\ \fI[label@]\fR\fIaddress\fR\fI[=advertized_address]\fR...] [\fB\-6\fR\ \fIaddr1\fR\fI[/addr2]\fR...] [\fB\-6\fR\ \fI[label@]\fR\fIaddress\fR\fI[=advertized_address]\fR...] [\fB\-s\fR\ \fIctrl_socket\fR] [\fB\-t\fR\ \fItos\fR] [\fB\-p\fR\ \fIpidfile\fR] [\fB\-T\fR\ \fImax_ttl\fR] [\fB\-\-maxpps\fR\ \fIpps\fR\fI[,rtcp_pps]\fR] [\fB\-\-maxpsize\fR\ \fIsize\fR\fI[,rtcp_size]\fR] [\fB\-r\fR\ \fIrdir\fR\ [\fB\-S\fR\ \fIsdir\fR]] [\fB\-L\fR\ \fInofile_limit\fR] [\fB\-A\fR\ \fIadvaddr1\fR\fI[/advaddr2]\fR] [\fB\-m\fR\ \fImin_port\fR] [\fB\-M\fR\ \fImax_port\fR] [\fB\-u\fR\ \fIuname\fR\fI[:gname]\fR] [\fB\-w\fR\ \fIsock_mode\fR] [\fB\-F\fR] [\fB\-i\fR] [\fB\-n\fR\ \fItimeout_socket\fR] [\fB\-P\fR] [\fB\-a\fR] [\fB\-d\fR\ \fIlog_level\fR\fI[:log_facility]\fR] [\fB\-W\fR\ \fIsetup_ttl\fR] [\fB\-\-force_asymmetric\fR] [\fB\-b\fR] [\fB\-c\fR\ \fIfifo|rr\fR] [\fB\-\-nice\fR\ \fIlevel\fR] [\fB\-D\fR] [\fB\-\-no_redirect\fR] [\fB\-\-config\fR\ \fIconfig_file\fR] [\fB\-\-dso\fR\ \fImodule\fR...] [\fB\-\-bridge_symmetric\fR] [\fB\-\-no_resolve\fR] +\fBrtpproxy\fR [\fB\-?\fR] [\fB\-2\fR] [\fB\-f\fR] [\fB\-v\fR] [\fB\-V\fR] [\fB\-R\fR] [\fB\-l\fR\ \fIaddr1\fR\fI[/addr2]\fR...] [\fB\-l\fR\ \fI[label@]\fR\fIaddress\fR\fI[=advertized_address]\fR...] [\fB\-6\fR\ \fIaddr1\fR\fI[/addr2]\fR...] [\fB\-6\fR\ \fI[label@]\fR\fIaddress\fR\fI[=advertized_address]\fR...] [\fB\-s\fR\ \fIctrl_socket\fR] [\fB\-t\fR\ \fItos\fR] [\fB\-p\fR\ \fIpidfile\fR] [\fB\-T\fR\ \fImax_ttl\fR] [\fB\-\-maxpps\fR\ \fIpps\fR\fI[,rtcp_pps]\fR] [\fB\-\-maxpsize\fR\ \fIsize\fR\fI[,rtcp_size]\fR] [\fB\-r\fR\ \fIrdir\fR\ [\fB\-S\fR\ \fIsdir\fR]] [\fB\-L\fR\ \fInofile_limit\fR] [\fB\-A\fR\ \fIadvaddr1\fR\fI[/advaddr2]\fR] [\fB\-m\fR\ \fImin_port\fR] [\fB\-M\fR\ \fImax_port\fR] [\fB\-u\fR\ \fIuname\fR\fI[:gname]\fR] [\fB\-w\fR\ \fIsock_mode\fR] [\fB\-F\fR] [\fB\-i\fR] [\fB\-n\fR\ \fItimeout_socket\fR] [\fB\-P\fR] [\fB\-a\fR] [\fB\-d\fR\ \fIlog_level\fR\fI[:log_facility]\fR] [\fB\-W\fR\ \fIsetup_ttl\fR] [\fB\-\-force_asymmetric\fR] [\fB\-b\fR] [\fB\-c\fR\ \fIfifo|rr\fR] [\fB\-\-nice\fR\ \fIlevel\fR] [\fB\-D\fR] [\fB\-\-no_redirect\fR] [\fB\-\-config\fR\ \fIconfig_file\fR] [\fB\-\-dso\fR\ \fImodule\fR...] [\fB\-\-bridge_symmetric\fR] [\fB\-\-no_resolve\fR] [\fB\-\-record_fname_encode\fR] .HP \w'\fBrtpproxy\fR\ 'u \fBrtpproxy\fR \fB\-C\fR .SH "DESCRIPTION" @@ -502,6 +502,28 @@ In the bridging mode, do not treat all sessions as asymmetric, which is the defa .RS 4 Only accept numeric IP addresses, in the command line arguments and in the control commands, instead of resolving host names\&. .RE +.PP +\fB\-\-record_fname_encode\fR +.RS 4 +When the recording file name is built from the Call\-ID and from\-tag (the +\fBR\fR +command and the +\fB\-a\fR +option), percent\-encode the +"/" +and +"%" +characters as +"%2F" +and +"%25" +instead of refusing to record calls whose Call\-ID or from\-tag contains +"/", which is a legal character in SIP\&. The original value can be recovered by decoding the +"%XX" +sequences\&. File names given explicitly with the +\fBC\fR +command are not affected\&. +.RE .SH "PRINCIPLES OF OPERATION" .PP When the SIP controller receives an INVITE request, it extracts the Call\-ID and from_tag from INVITE\&. The call controller communicates it with the rtpproxy via Unix domain socket or a UDP socket\&. rtpproxy looks for an existing session with the given Call\-ID and from_tag\&. diff --git a/src/main.c b/src/main.c index fc1bce691..f5a24404b 100644 --- a/src/main.c +++ b/src/main.c @@ -152,6 +152,7 @@ usage(void) "[-n timeout_socket]\n\t [-d log_level[:log_facility]] [-p pid_file]\n" "\t [-c fifo|rr] [-A addr1[/addr2] [-W setup_ttl]\n" "\t [--maxpps pps[,rtcp_pps]] [--maxpsize size[,rtcp_size]]\n" + "\t [--record_fname_encode]\n" "\trtpproxy -V\n"); } @@ -266,6 +267,7 @@ ehandler(void) #define LOPT_NO_REDIR 263 #define LOPT_MAXPPS 264 #define LOPT_MAXPSIZE 265 +#define LOPT_RFNAME_ENC 266 const static struct option longopts[] = { { "dso", required_argument, NULL, LOPT_DSO }, @@ -278,6 +280,7 @@ const static struct option longopts[] = { { "no_redirect", no_argument, NULL, LOPT_NO_REDIR }, { "maxpps", required_argument, NULL, LOPT_MAXPPS }, { "maxpsize", required_argument, NULL, LOPT_MAXPSIZE }, + { "record_fname_encode", no_argument, NULL, LOPT_RFNAME_ENC }, { NULL, 0, NULL, 0 } }; @@ -519,6 +522,10 @@ init_config(struct rtpp_cfg *cfsp, int argc, const char * const *argv) } break; + case LOPT_RFNAME_ENC: + cfsp->record_fname_enc = 1; + break; + case 'c': if (strcmp(optarg, "fifo") == 0) { cfsp->sched_policy = SCHED_FIFO; diff --git a/src/rtpp_cfg.h b/src/rtpp_cfg.h index 9ea183660..724313041 100644 --- a/src/rtpp_cfg.h +++ b/src/rtpp_cfg.h @@ -108,6 +108,8 @@ struct rtpp_cfg { const char *sdir; int record_pcap; /* Record in the PCAP format? */ int record_all; /* Record everything */ + int record_fname_enc; /* Percent-encode '/' and '%' in file names + built from Call-ID and from-tag */ int rrtcp; /* Whether or not to relay RTCP? */ struct rtpp_log *glog; diff --git a/src/rtpp_record.c b/src/rtpp_record.c index 30c216e7b..a9427a448 100644 --- a/src/rtpp_record.c +++ b/src/rtpp_record.c @@ -164,6 +164,44 @@ ropen_remote_ctor_pa(const struct rtpp_cfg *cfg, struct rtpp_record_channel *rrc return (0); } +/* + * Copy slen bytes of src (a Call-ID or a from-tag, which are not + * NUL-terminated) into dst as a NUL-terminated file name component. With + * encode set, '/' and '%' are percent-encoded as "%2F" and "%25", so the + * result never contains '/' and the original value can be recovered by + * decoding "%XX". Returns the length of the result, or -1 if it does not + * fit into dlen bytes. + */ +static int +rtpp_record_fname_cpy(char *dst, size_t dlen, const char *src, size_t slen, + int encode) +{ + size_t i, j; + const char *esc; + + if (dlen == 0) + return (-1); + for (i = j = 0; i < slen; i++) { + esc = NULL; + if (encode && src[i] == '/') + esc = "%2F"; + else if (encode && src[i] == '%') + esc = "%25"; + if (esc != NULL) { + if (dlen - j < 4) + return (-1); + memcpy(dst + j, esc, 3); + j += 3; + } else { + if (dlen - j < 2) + return (-1); + dst[j++] = src[i]; + } + } + dst[j] = '\0'; + return ((int)j); +} + struct rtpp_record * rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap, struct rtpp_session *sp, const char *rname, int orig, int record_type) @@ -173,6 +211,7 @@ rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap int rval, remote; size_t len; pcap_hdr_t pcap_hdr; + char cid[PATH_MAX + 1], tag[PATH_MAX + 1]; remote = (rname != NULL && strncmp("udp:", rname, 4) == 0) ? 1 : 0; @@ -211,11 +250,20 @@ rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap goto e2; } - if (rname == NULL && (memchr(sp->call_id->s, '/', sp->call_id->len) != NULL || - memchr(sp->from_tag_nmn->s, '/', sp->from_tag_nmn->len) != NULL)) { - RTPP_LOG(sp->log, RTPP_LOG_ERR, "call-id or from-tag contains '/', " - "refusing to use it in the recording file name"); - goto e2; + if (rname == NULL) { + if (rtpp_record_fname_cpy(cid, sizeof(cid), sp->call_id->s, + sp->call_id->len, cfsp->record_fname_enc) < 0 || + rtpp_record_fname_cpy(tag, sizeof(tag), sp->from_tag_nmn->s, + sp->from_tag_nmn->len, cfsp->record_fname_enc) < 0) { + RTPP_LOG(sp->log, RTPP_LOG_ERR, "recording file name is too long"); + goto e2; + } + if (strchr(cid, '/') != NULL || strchr(tag, '/') != NULL) { + RTPP_LOG(sp->log, RTPP_LOG_ERR, "call-id or from-tag contains '/', " + "refusing to use it in the recording file name (see " + "--record_fname_encode)"); + goto e2; + } } if (cfsp->record_pcap != 0) { @@ -240,9 +288,8 @@ rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap sdir = cfsp->sdir; rrc->needspool = 1; if (rname == NULL) { - len = snprintf(rrc->rpath, sizeof(rrc->rpath), "%s/%.*s=%.*s%s%s", - cfsp->rdir, (int)sp->call_id->len, sp->call_id->s, - (int)sp->from_tag_nmn->len, sp->from_tag_nmn->s, suffix1, suffix2); + len = snprintf(rrc->rpath, sizeof(rrc->rpath), "%s/%s=%s%s%s", + cfsp->rdir, cid, tag, suffix1, suffix2); } else { len = snprintf(rrc->rpath, sizeof(rrc->rpath), "%s/%s%s", cfsp->rdir, rname, suffix2); @@ -253,9 +300,8 @@ rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap } } if (rname == NULL) { - len = snprintf(rrc->spath, sizeof(rrc->spath), "%s/%.*s=%.*s%s%s", - sdir, (int)sp->call_id->len, sp->call_id->s, - (int)sp->from_tag_nmn->len, sp->from_tag_nmn->s, suffix1, suffix2); + len = snprintf(rrc->spath, sizeof(rrc->spath), "%s/%s=%s%s%s", + sdir, cid, tag, suffix1, suffix2); } else { len = snprintf(rrc->spath, sizeof(rrc->spath), "%s/%s%s", sdir, rname, suffix2); diff --git a/tests/recording/basic b/tests/recording/basic index 2426e7763..b228386bf 100755 --- a/tests/recording/basic +++ b/tests/recording/basic @@ -37,7 +37,7 @@ run_recording() { report_rc ${RPTL_RC} "running basic.${stest}.rptl RPTL script" } -SUB_TESTS="${SUB_TESTS:-"files singlefile singlefile_c stopall files_stophalf singlefile_stophalf remote remote_p badpath"}" +SUB_TESTS="${SUB_TESTS:-"files singlefile singlefile_c stopall files_stophalf singlefile_stophalf remote remote_p badpath badpath_enc"}" for stest in ${SUB_TESTS} do diff --git a/tests/recording/basic.badpath_enc.rptl b/tests/recording/basic.badpath_enc.rptl new file mode 100644 index 000000000..83c7df093 --- /dev/null +++ b/tests/recording/basic.badpath_enc.rptl @@ -0,0 +1,51 @@ +# Same Call-IDs as in basic.badpath, with --record_fname_encode: '/' and +# '%' in the Call-ID or from-tag are written as "%2F" and "%25", so the +# recording (R, Rs) is created inside of the recording directory under the +# encoded name instead of being refused. Names that do not fit into +# PATH_MAX are still refused. + +.eval: 0 -> RES_OK +.eval: E50 -> RES_E50 +.eval: recording.%%SUBTEST%% -> WORK_BASE +.eval: ../%%WORK_BASE%%.rec. -> CALLID +.eval: ../%%WORK_BASE%%.recs. -> CALLID_S +.eval: %%WORK_BASE%%.pct%41 -> CALLID_P +.eval: %%RECORD_SPL_DIR%%/%%CALLID%%=from_tag_1 -> REC_BASE +.eval: %%RECORD_SPL_DIR%%/%%CALLID_S%%=from_tag_1 -> REC_BASE_S +# Same names, encoded ('?' stands for the '%' of the escape sequences). +.eval: %%RECORD_SPL_DIR%%/..?2F%%WORK_BASE%%.rec.=from_tag_1 -> ENC_BASE +.eval: %%RECORD_SPL_DIR%%/..?2F%%WORK_BASE%%.recs.=from_tag_1 -> ENC_BASE_S +.eval: %%RECORD_SPL_DIR%%/%%WORK_BASE%%.pct?2541=from_tag_1 -> ENC_BASE_P + +.exec: mkdir -p %%RECORD_SPL_DIR%% +.exec: rm -f %%REC_BASE%%.* %%REC_BASE_S%%* %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_P%%.* + +# Longer than PATH_MAX on any supported platform, yet short enough for +# the commands carrying it to fit into the RTPP_CMD_BUFLEN. +.exec: printf '%4200s' '' | tr ' ' x -> LONG_NAME +.eval: %%WORK_BASE%%.long.%%LONG_NAME%% -> CALLID_LONG + +.eval: -d dbug -T60 -W60 -P -r %%RECORD_SPL_DIR%% --record_fname_encode -> RTPPROXY_ARGS +socket rtpp: stdio: %%RTPPROXY_ARGS%% -> %%WORK_BASE%%.rout + +rtpp: U %%CALLID%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_S%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_S%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: Rs %%CALLID_S%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_P%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_P%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID_P%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_LONG%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_LONG%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_E50) +rtpp: Rs %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_E50) + +.close: rtpp +.exec: for f in %%REC_BASE%%.* %%REC_BASE_S%%*; do test ! -e "$f" || exit 1; done +.exec: ls %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_P%%.* > /dev/null +.exec: rm -f %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_P%%.* From c48909c8bb57c93e5d7219265be2df7fc55aa8ce Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Fri, 20 Nov 2026 23:00:01 -0700 Subject: [PATCH 2/4] Replace --record_fname_encode with --record_callid_hash method Instead of percent-encoding '/' and '%' in the Call-ID, select how the Call-ID is put into the recording file name built for R, Rs and -a: raw the Call-ID as is (the default), '/' is refused as before; sha256 SHA-256 digest of the Call-ID in lowercase hex, recommended for its security properties; fixed length, so even Call-IDs too long to be used as is can be recorded; needs OpenSSL; b64url URL-safe base64 (RFC 4648 sec. 5) without padding, for when the Call-ID has to be recovered from the file name. Neither sha256 nor b64url can produce '/', so the result always stays inside of the recording directory. The from-tag is used as is with any method and '/' in it is still refused. Names given with C/Cs and remote (udp:) recording are not affected. An unknown method, or sha256 in a build without OpenSSL, is reported at startup and rtpproxy exits with a non-zero code; usage() lists only the methods available in the build. The option parsing, the RTPP_RCID_* values and rtpp_record_callid_fname(), which builds and checks the "=" part of the file name and reports why it cannot, live in a new rtpp_record_util.[ch] rather than in main.c and rtpp_record.c. configure gets a standalone libcrypto (EVP_Digest) check, independent of libsrtp, that defines HAVE_LIBCRYPTO in config.h and sets an automake conditional of the same name, under which ${LIB_CRYPTO} is linked into rtpproxy_debug and librtpproxy (and so into rtpproxy). Generated files (configure, Makefile.in, config.h.in) are not regenerated here. Tests: badpath_enc is replaced with badpath_b64 and badpath_sha256. They check that traversal Call-IDs are recorded under the expected names inside of the recording directory, that '/' in the from-tag is still refused, that an over-long Call-ID is refused with b64url but recorded with sha256, and that an unknown method is rejected. badpath_sha256 runs in builds with HAVE_LIBCRYPTO, which tests/Makefile.am now exports to the tests, so a build with OpenSSL where the method does not work fails the test. --- configure.ac | 22 +++ doc/manpage.xml | 62 +++++-- rtpproxy.8 | 51 ++++-- src/Makefile.am | 5 + src/main.c | 15 +- src/rtpp_cfg.h | 5 +- src/rtpp_record.c | 70 ++------ src/rtpp_record_util.c | 195 ++++++++++++++++++++++ src/rtpp_record_util.h | 38 +++++ tests/Makefile.am | 3 + tests/recording/basic | 9 +- tests/recording/basic.badpath_b64.rptl | 58 +++++++ tests/recording/basic.badpath_enc.rptl | 51 ------ tests/recording/basic.badpath_sha256.rptl | 56 +++++++ 14 files changed, 495 insertions(+), 145 deletions(-) create mode 100644 src/rtpp_record_util.c create mode 100644 src/rtpp_record_util.h create mode 100644 tests/recording/basic.badpath_b64.rptl delete mode 100644 tests/recording/basic.badpath_enc.rptl create mode 100644 tests/recording/basic.badpath_sha256.rptl diff --git a/configure.ac b/configure.ac index 52d4d6749..56bf3b08f 100644 --- a/configure.ac +++ b/configure.ac @@ -299,6 +299,27 @@ else fi fi +# libcrypto (OpenSSL), for --record_callid_hash sha256 +AC_CHECK_HEADER(openssl/evp.h, found_libcrypto=yes) +if test "$found_libcrypto" = yes +then + save_LIBS="${LIBS}" + LIBS="${LIBS} ${LIB_CRYPTO}" + AC_MSG_CHECKING([for EVP_Digest in libcrypto]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([ + #include + ], [ + return EVP_Digest("", 0, NULL, NULL, EVP_sha256(), NULL); + ])], [ + AC_MSG_RESULT([yes]) + found_evp_digest=yes + AC_DEFINE([HAVE_LIBCRYPTO], 1, [Define if you have libcrypto (OpenSSL) installed]) + ], [ + AC_MSG_RESULT([no]) + ]) + LIBS="${save_LIBS}" +fi + # libelperiodic AC_CHECK_HEADER(elperiodic.h, found_libelperiodic=yes) if test "$found_libelperiodic" = yes @@ -494,6 +515,7 @@ AM_CONDITIONAL(BUILD_MODULES, [test "${ENABLE_MODULE_IF}" = 1]) AM_CONDITIONAL(ENABLE_MODULE_IF, [test "${ENABLE_MODULE_IF}" = 1]) AM_CONDITIONAL(BUILD_ELPERIODIC, [test "${EXTERNAL_ELPERIODIC}" != 1]) AM_CONDITIONAL(BUILD_CRYPTO, [test "${LIBS_SRTP}" != ""]) +AM_CONDITIONAL(HAVE_LIBCRYPTO, [test "x${found_evp_digest}" = xyes]) AM_CONDITIONAL(BUILD_LOG_STAND, [test "${LIBS_SIPLOG}" = ""]) AM_CONDITIONAL(BUILD_UDP_CONTENTION, [test "${ENABLE_UDP_CONTENTION}" = 1]) AM_CONDITIONAL(BUILD_OBJCK, [test "${ENABLE_OBJCK}" = 1]) diff --git a/doc/manpage.xml b/doc/manpage.xml index 6bbcad936..3346c484e 100644 --- a/doc/manpage.xml +++ b/doc/manpage.xml @@ -186,7 +186,7 @@ - + method @@ -822,18 +822,58 @@ - + + method - When the recording file name is built from the Call-ID and - from-tag (the R command and the - option), percent-encode the / - and % characters as %2F and - %25 instead of refusing to record calls whose - Call-ID or from-tag contains /, which is a legal - character in SIP. The original value can be recovered by decoding - the %XX sequences. File names given explicitly with - the C command are not affected. + Selects how the Call-ID is put into the recording file name + when the name is built from the Call-ID and from-tag (the + R and Rs commands and the + option). File names given explicitly with the + C command are not affected. The from-tag is + always used as is. method is one + of: + + + + raw + + + Use the Call-ID as is (the default). Calls whose + Call-ID contains / are not recorded. + + + + + sha256 + + + Use the SHA-256 digest of the Call-ID, written as 64 + lowercase hex characters. This is the recommended method + for its security properties. A recording can be found from + a known Call-ID by computing the same digest, for example + with printf '%s' "$CALLID" | sha256sum. + Available only if rtpproxy has been + built with OpenSSL. + + + + + b64url + + + Use the Call-ID encoded with the URL-safe base64 + alphabet (RFC 4648, section 5) without padding. Use it when + the Call-ID has to be recovered from the file name, for + example to index existing recordings. The resulting file + names are case-sensitive. + + + + + If method is unknown or is not + available in this build, rtpproxy reports an + error and exits. diff --git a/rtpproxy.8 b/rtpproxy.8 index aa947f602..f316096bf 100644 --- a/rtpproxy.8 +++ b/rtpproxy.8 @@ -31,7 +31,7 @@ rtpproxy \- RTP (Real\-time Transport Protocol) Proxy Server .SH "SYNOPSIS" .HP \w'\fBrtpproxy\fR\ 'u -\fBrtpproxy\fR [\fB\-?\fR] [\fB\-2\fR] [\fB\-f\fR] [\fB\-v\fR] [\fB\-V\fR] [\fB\-R\fR] [\fB\-l\fR\ \fIaddr1\fR\fI[/addr2]\fR...] [\fB\-l\fR\ \fI[label@]\fR\fIaddress\fR\fI[=advertized_address]\fR...] [\fB\-6\fR\ \fIaddr1\fR\fI[/addr2]\fR...] [\fB\-6\fR\ \fI[label@]\fR\fIaddress\fR\fI[=advertized_address]\fR...] [\fB\-s\fR\ \fIctrl_socket\fR] [\fB\-t\fR\ \fItos\fR] [\fB\-p\fR\ \fIpidfile\fR] [\fB\-T\fR\ \fImax_ttl\fR] [\fB\-\-maxpps\fR\ \fIpps\fR\fI[,rtcp_pps]\fR] [\fB\-\-maxpsize\fR\ \fIsize\fR\fI[,rtcp_size]\fR] [\fB\-r\fR\ \fIrdir\fR\ [\fB\-S\fR\ \fIsdir\fR]] [\fB\-L\fR\ \fInofile_limit\fR] [\fB\-A\fR\ \fIadvaddr1\fR\fI[/advaddr2]\fR] [\fB\-m\fR\ \fImin_port\fR] [\fB\-M\fR\ \fImax_port\fR] [\fB\-u\fR\ \fIuname\fR\fI[:gname]\fR] [\fB\-w\fR\ \fIsock_mode\fR] [\fB\-F\fR] [\fB\-i\fR] [\fB\-n\fR\ \fItimeout_socket\fR] [\fB\-P\fR] [\fB\-a\fR] [\fB\-d\fR\ \fIlog_level\fR\fI[:log_facility]\fR] [\fB\-W\fR\ \fIsetup_ttl\fR] [\fB\-\-force_asymmetric\fR] [\fB\-b\fR] [\fB\-c\fR\ \fIfifo|rr\fR] [\fB\-\-nice\fR\ \fIlevel\fR] [\fB\-D\fR] [\fB\-\-no_redirect\fR] [\fB\-\-config\fR\ \fIconfig_file\fR] [\fB\-\-dso\fR\ \fImodule\fR...] [\fB\-\-bridge_symmetric\fR] [\fB\-\-no_resolve\fR] [\fB\-\-record_fname_encode\fR] +\fBrtpproxy\fR [\fB\-?\fR] [\fB\-2\fR] [\fB\-f\fR] [\fB\-v\fR] [\fB\-V\fR] [\fB\-R\fR] [\fB\-l\fR\ \fIaddr1\fR\fI[/addr2]\fR...] [\fB\-l\fR\ \fI[label@]\fR\fIaddress\fR\fI[=advertized_address]\fR...] [\fB\-6\fR\ \fIaddr1\fR\fI[/addr2]\fR...] [\fB\-6\fR\ \fI[label@]\fR\fIaddress\fR\fI[=advertized_address]\fR...] [\fB\-s\fR\ \fIctrl_socket\fR] [\fB\-t\fR\ \fItos\fR] [\fB\-p\fR\ \fIpidfile\fR] [\fB\-T\fR\ \fImax_ttl\fR] [\fB\-\-maxpps\fR\ \fIpps\fR\fI[,rtcp_pps]\fR] [\fB\-\-maxpsize\fR\ \fIsize\fR\fI[,rtcp_size]\fR] [\fB\-r\fR\ \fIrdir\fR\ [\fB\-S\fR\ \fIsdir\fR]] [\fB\-L\fR\ \fInofile_limit\fR] [\fB\-A\fR\ \fIadvaddr1\fR\fI[/advaddr2]\fR] [\fB\-m\fR\ \fImin_port\fR] [\fB\-M\fR\ \fImax_port\fR] [\fB\-u\fR\ \fIuname\fR\fI[:gname]\fR] [\fB\-w\fR\ \fIsock_mode\fR] [\fB\-F\fR] [\fB\-i\fR] [\fB\-n\fR\ \fItimeout_socket\fR] [\fB\-P\fR] [\fB\-a\fR] [\fB\-d\fR\ \fIlog_level\fR\fI[:log_facility]\fR] [\fB\-W\fR\ \fIsetup_ttl\fR] [\fB\-\-force_asymmetric\fR] [\fB\-b\fR] [\fB\-c\fR\ \fIfifo|rr\fR] [\fB\-\-nice\fR\ \fIlevel\fR] [\fB\-D\fR] [\fB\-\-no_redirect\fR] [\fB\-\-config\fR\ \fIconfig_file\fR] [\fB\-\-dso\fR\ \fImodule\fR...] [\fB\-\-bridge_symmetric\fR] [\fB\-\-no_resolve\fR] [\fB\-\-record_callid_hash\fR\ \fImethod\fR] .HP \w'\fBrtpproxy\fR\ 'u \fBrtpproxy\fR \fB\-C\fR .SH "DESCRIPTION" @@ -503,26 +503,43 @@ In the bridging mode, do not treat all sessions as asymmetric, which is the defa Only accept numeric IP addresses, in the command line arguments and in the control commands, instead of resolving host names\&. .RE .PP -\fB\-\-record_fname_encode\fR +\fB\-\-record_callid_hash\fR \fImethod\fR .RS 4 -When the recording file name is built from the Call\-ID and from\-tag (the +Selects how the Call\-ID is put into the recording file name when the name is built from the Call\-ID and from\-tag (the \fBR\fR -command and the -\fB\-a\fR -option), percent\-encode the -"/" -and -"%" -characters as -"%2F" and -"%25" -instead of refusing to record calls whose Call\-ID or from\-tag contains -"/", which is a legal character in SIP\&. The original value can be recovered by decoding the -"%XX" -sequences\&. File names given explicitly with the +\fBRs\fR +commands and the +\fB\-a\fR +option)\&. File names given explicitly with the \fBC\fR -command are not affected\&. +command are not affected\&. The from\-tag is always used as is\&. +\fImethod\fR +is one of: +.PP +raw +.RS 4 +Use the Call\-ID as is (the default)\&. Calls whose Call\-ID contains "/" are not recorded\&. +.RE +.PP +sha256 +.RS 4 +Use the SHA\-256 digest of the Call\-ID, written as 64 lowercase hex characters\&. This is the recommended method for its security properties\&. A recording can be found from a known Call\-ID by computing the same digest, for example with +\fBprintf \*(Aq%s\*(Aq "$CALLID" | sha256sum\fR\&. Available only if +\fBrtpproxy\fR +has been built with OpenSSL\&. +.RE +.PP +b64url +.RS 4 +Use the Call\-ID encoded with the URL\-safe base64 alphabet (RFC 4648, section 5) without padding\&. Use it when the Call\-ID has to be recovered from the file name, for example to index existing recordings\&. The resulting file names are case\-sensitive\&. +.RE +.sp +If +\fImethod\fR +is unknown or is not available in this build, +\fBrtpproxy\fR +reports an error and exits\&. .RE .SH "PRINCIPLES OF OPERATION" .PP diff --git a/src/Makefile.am b/src/Makefile.am index 01c5db0de..046de3a6f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -75,6 +75,7 @@ BASE_SOURCES=main.c rtp.h rtpp_server.c \ rtpp_network_io.c rtpp_network_io.h rtpp_wi_pkt.c rtpp_wi_pkt.h \ rtpp_timeout_data.c rtpp_timeout_data.h rtpp_locking.h \ rtpp_nofile.c rtpp_nofile.h rtpp_record_adhoc.h \ + rtpp_record_util.c rtpp_record_util.h \ $(CMDSRCDIR)/rpcpv1_norecord.c $(CMDSRCDIR)/rpcpv1_norecord.h \ $(CMDSRCDIR)/rpcpv1_ul_subc.c $(CMDSRCDIR)/rpcpv1_ul_subc.h \ $(RTPP_AUTOSRC_SOURCES) rtpp_epoll.c rtpp_str.c rtpp_str.h \ @@ -222,6 +223,10 @@ endif endif librtpproxy_la_LDFLAGS = -static librtpproxy_la_LIBADD += @LIBS_ELPERIODIC@ +if HAVE_LIBCRYPTO +rtpproxy_debug_LDADD += $(LIB_CRYPTO) +librtpproxy_la_LIBADD += $(LIB_CRYPTO) +endif update_autosrc: @echo "# Auto-generated by $(srcdir)/Makefile - DO NOT EDIT!" > $(RTPP_AUTOSRC_DIR)/Makefile.ami diff --git a/src/main.c b/src/main.c index f5a24404b..5d95f0f77 100644 --- a/src/main.c +++ b/src/main.c @@ -115,6 +115,7 @@ #include "rtpp_debug.h" #include "rtpp_locking.h" #include "rtpp_nofile.h" +#include "rtpp_record_util.h" #include "advanced/pproc_manager.h" #include "ucl.h" #include "rtpp_ucl.h" @@ -152,8 +153,8 @@ usage(void) "[-n timeout_socket]\n\t [-d log_level[:log_facility]] [-p pid_file]\n" "\t [-c fifo|rr] [-A addr1[/addr2] [-W setup_ttl]\n" "\t [--maxpps pps[,rtcp_pps]] [--maxpsize size[,rtcp_size]]\n" - "\t [--record_fname_encode]\n" - "\trtpproxy -V\n"); + "\t [--record_callid_hash %s]\n" + "\trtpproxy -V\n", rtpp_record_callid_hash_usage); } static struct rtpp_cfg *_sig_cf; @@ -267,7 +268,7 @@ ehandler(void) #define LOPT_NO_REDIR 263 #define LOPT_MAXPPS 264 #define LOPT_MAXPSIZE 265 -#define LOPT_RFNAME_ENC 266 +#define LOPT_RCID_HASH 266 const static struct option longopts[] = { { "dso", required_argument, NULL, LOPT_DSO }, @@ -280,7 +281,7 @@ const static struct option longopts[] = { { "no_redirect", no_argument, NULL, LOPT_NO_REDIR }, { "maxpps", required_argument, NULL, LOPT_MAXPPS }, { "maxpsize", required_argument, NULL, LOPT_MAXPSIZE }, - { "record_fname_encode", no_argument, NULL, LOPT_RFNAME_ENC }, + { "record_callid_hash", required_argument, NULL, LOPT_RCID_HASH }, { NULL, 0, NULL, 0 } }; @@ -522,8 +523,10 @@ init_config(struct rtpp_cfg *cfsp, int argc, const char * const *argv) } break; - case LOPT_RFNAME_ENC: - cfsp->record_fname_enc = 1; + case LOPT_RCID_HASH: + if (rtpp_record_callid_hash_parse(optarg, + &cfsp->record_callid_hash, &errmsg) != 0) + IC_ERRX(1, "%s: %s", optarg, errmsg); break; case 'c': diff --git a/src/rtpp_cfg.h b/src/rtpp_cfg.h index 724313041..24c10d14f 100644 --- a/src/rtpp_cfg.h +++ b/src/rtpp_cfg.h @@ -108,8 +108,9 @@ struct rtpp_cfg { const char *sdir; int record_pcap; /* Record in the PCAP format? */ int record_all; /* Record everything */ - int record_fname_enc; /* Percent-encode '/' and '%' in file names - built from Call-ID and from-tag */ + int record_callid_hash; /* How the Call-ID goes into recording + file names, RTPP_RCID_*, see + rtpp_record_util.h */ int rrtcp; /* Whether or not to relay RTCP? */ struct rtpp_log *glog; diff --git a/src/rtpp_record.c b/src/rtpp_record.c index a9427a448..af7ed13f5 100644 --- a/src/rtpp_record.c +++ b/src/rtpp_record.c @@ -52,6 +52,7 @@ #include "config.h" + #include "rtpp_types.h" #include "rtp.h" #include "rtpp_time.h" @@ -67,6 +68,7 @@ #include "rtpp_mallocs.h" #include "rtpp_network.h" #include "rtpp_record.h" +#include "rtpp_record_util.h" #include "rtpp_record_fin.h" #include "rtpp_record_adhoc.h" #include "rtpp_record_private.h" @@ -164,44 +166,6 @@ ropen_remote_ctor_pa(const struct rtpp_cfg *cfg, struct rtpp_record_channel *rrc return (0); } -/* - * Copy slen bytes of src (a Call-ID or a from-tag, which are not - * NUL-terminated) into dst as a NUL-terminated file name component. With - * encode set, '/' and '%' are percent-encoded as "%2F" and "%25", so the - * result never contains '/' and the original value can be recovered by - * decoding "%XX". Returns the length of the result, or -1 if it does not - * fit into dlen bytes. - */ -static int -rtpp_record_fname_cpy(char *dst, size_t dlen, const char *src, size_t slen, - int encode) -{ - size_t i, j; - const char *esc; - - if (dlen == 0) - return (-1); - for (i = j = 0; i < slen; i++) { - esc = NULL; - if (encode && src[i] == '/') - esc = "%2F"; - else if (encode && src[i] == '%') - esc = "%25"; - if (esc != NULL) { - if (dlen - j < 4) - return (-1); - memcpy(dst + j, esc, 3); - j += 3; - } else { - if (dlen - j < 2) - return (-1); - dst[j++] = src[i]; - } - } - dst[j] = '\0'; - return ((int)j); -} - struct rtpp_record * rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap, struct rtpp_session *sp, const char *rname, int orig, int record_type) @@ -211,7 +175,8 @@ rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap int rval, remote; size_t len; pcap_hdr_t pcap_hdr; - char cid[PATH_MAX + 1], tag[PATH_MAX + 1]; + char fname[PATH_MAX + 1]; + const char *emsg; remote = (rname != NULL && strncmp("udp:", rname, 4) == 0) ? 1 : 0; @@ -250,20 +215,11 @@ rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap goto e2; } - if (rname == NULL) { - if (rtpp_record_fname_cpy(cid, sizeof(cid), sp->call_id->s, - sp->call_id->len, cfsp->record_fname_enc) < 0 || - rtpp_record_fname_cpy(tag, sizeof(tag), sp->from_tag_nmn->s, - sp->from_tag_nmn->len, cfsp->record_fname_enc) < 0) { - RTPP_LOG(sp->log, RTPP_LOG_ERR, "recording file name is too long"); - goto e2; - } - if (strchr(cid, '/') != NULL || strchr(tag, '/') != NULL) { - RTPP_LOG(sp->log, RTPP_LOG_ERR, "call-id or from-tag contains '/', " - "refusing to use it in the recording file name (see " - "--record_fname_encode)"); - goto e2; - } + if (rname == NULL && rtpp_record_callid_fname(fname, sizeof(fname), + sp->call_id->s, sp->call_id->len, sp->from_tag_nmn->s, + sp->from_tag_nmn->len, cfsp->record_callid_hash, &emsg) < 0) { + RTPP_LOG(sp->log, RTPP_LOG_ERR, "%s", emsg); + goto e2; } if (cfsp->record_pcap != 0) { @@ -288,8 +244,8 @@ rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap sdir = cfsp->sdir; rrc->needspool = 1; if (rname == NULL) { - len = snprintf(rrc->rpath, sizeof(rrc->rpath), "%s/%s=%s%s%s", - cfsp->rdir, cid, tag, suffix1, suffix2); + len = snprintf(rrc->rpath, sizeof(rrc->rpath), "%s/%s%s%s", + cfsp->rdir, fname, suffix1, suffix2); } else { len = snprintf(rrc->rpath, sizeof(rrc->rpath), "%s/%s%s", cfsp->rdir, rname, suffix2); @@ -300,8 +256,8 @@ rtpp_record_ctor(const struct rtpp_cfg *cfsp, const struct remote_copy_args *rap } } if (rname == NULL) { - len = snprintf(rrc->spath, sizeof(rrc->spath), "%s/%s=%s%s%s", - sdir, cid, tag, suffix1, suffix2); + len = snprintf(rrc->spath, sizeof(rrc->spath), "%s/%s%s%s", + sdir, fname, suffix1, suffix2); } else { len = snprintf(rrc->spath, sizeof(rrc->spath), "%s/%s%s", sdir, rname, suffix2); diff --git a/src/rtpp_record_util.c b/src/rtpp_record_util.c new file mode 100644 index 000000000..7f39822ef --- /dev/null +++ b/src/rtpp_record_util.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2026 Sippy Software, Inc., http://www.sippysoft.com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +#include +#include + +#include "config.h" + +#if defined(HAVE_LIBCRYPTO) +#include +#endif + +#include "rtpp_record_util.h" + +#if defined(HAVE_LIBCRYPTO) +#define RCID_SHA256_AVAIL 1 +#define RCID_METHODS "raw, b64url, sha256" +#else +#define RCID_SHA256_AVAIL 0 +#define RCID_METHODS "raw, b64url" +#endif + +static const struct { + const char *name; + int method; + int avail; +} rcid_methods[] = { + {"raw", RTPP_RCID_RAW, 1}, + {"b64url", RTPP_RCID_B64URL, 1}, + {"sha256", RTPP_RCID_SHA256, RCID_SHA256_AVAIL}, +}; + +#if defined(HAVE_LIBCRYPTO) +const char rtpp_record_callid_hash_usage[] = "raw|b64url|sha256"; +#else +const char rtpp_record_callid_hash_usage[] = "raw|b64url"; +#endif + +/* + * Parse the argument of the --record_callid_hash option into one of the + * RTPP_RCID_* values. Returns 0 on success, or -1 with *emsgp pointing to + * the reason if the method is unknown or not available in this build. + */ +int +rtpp_record_callid_hash_parse(const char *arg, int *methodp, + const char **emsgp) +{ + size_t i; + + for (i = 0; i < sizeof(rcid_methods) / sizeof(rcid_methods[0]); i++) { + if (strcmp(arg, rcid_methods[i].name) != 0) + continue; + if (!rcid_methods[i].avail) { + *emsgp = "--record_callid_hash method is not available, " + "rtpproxy has been built without OpenSSL"; + return (-1); + } + *methodp = rcid_methods[i].method; + return (0); + } + *emsgp = "unknown --record_callid_hash method, supported: " RCID_METHODS; + return (-1); +} + +/* + * Encode the Call-ID (src, slen, not NUL-terminated) into dst as selected + * by method. Returns the length of the result, or -1 if it does not fit + * into dlen bytes or cannot be built. + */ +static int +rcid_encode(char *dst, size_t dlen, const char *src, size_t slen, int method) +{ + static const char b64url[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz0123456789-_"; + size_t i, j; + uint32_t v; + + switch (method) { + case RTPP_RCID_RAW: + if (slen >= dlen) + return (-1); + memcpy(dst, src, slen); + dst[slen] = '\0'; + return ((int)slen); + + case RTPP_RCID_B64URL: + if (slen > (dlen - 1) / 4 * 3) + return (-1); + for (i = j = 0; i < slen; i += 3) { + v = (uint32_t)(unsigned char)src[i] << 16; + if (i + 1 < slen) + v |= (uint32_t)(unsigned char)src[i + 1] << 8; + if (i + 2 < slen) + v |= (uint32_t)(unsigned char)src[i + 2]; + dst[j++] = b64url[(v >> 18) & 0x3f]; + dst[j++] = b64url[(v >> 12) & 0x3f]; + if (i + 1 < slen) + dst[j++] = b64url[(v >> 6) & 0x3f]; + if (i + 2 < slen) + dst[j++] = b64url[v & 0x3f]; + } + dst[j] = '\0'; + return ((int)j); + +#if defined(HAVE_LIBCRYPTO) + case RTPP_RCID_SHA256: { + static const char hex[] = "0123456789abcdef"; + unsigned char md[EVP_MAX_MD_SIZE]; + unsigned int mdlen; + + if (EVP_Digest(src, slen, md, &mdlen, EVP_sha256(), NULL) != 1) + return (-1); + if ((size_t)mdlen * 2 >= dlen) + return (-1); + for (i = 0; i < mdlen; i++) { + dst[i * 2] = hex[md[i] >> 4]; + dst[i * 2 + 1] = hex[md[i] & 0xf]; + } + dst[i * 2] = '\0'; + return ((int)(i * 2)); + } +#endif + + default: + return (-1); + } +} + +/* + * Build the "=" part of a recording file name into dst + * (dlen bytes, NUL-terminated). The Call-ID and the from-tag are not + * NUL-terminated. The from-tag is used as is, the Call-ID as selected by + * method (RTPP_RCID_*): RTPP_RCID_RAW uses it as is, RTPP_RCID_B64URL + * encodes it with the URL-safe base64 alphabet (RFC 4648 sec. 5) without + * padding, so it can be recovered from the file name, and RTPP_RCID_SHA256 + * replaces it with its SHA-256 digest in lowercase hex. Neither of the + * latter two can produce '/', and a raw Call-ID or a from-tag containing + * '/' is refused, so the result never contains '/'. + * + * Returns the length of the result, or -1 with *emsgp pointing to the + * reason. + */ +int +rtpp_record_callid_fname(char *dst, size_t dlen, const char *cid, + size_t cidlen, const char *tag, size_t taglen, int method, + const char **emsgp) +{ + int len; + + if (method == RTPP_RCID_RAW && memchr(cid, '/', cidlen) != NULL) { + *emsgp = "call-id contains '/', refusing to use it in the recording " + "file name (see --record_callid_hash)"; + return (-1); + } + if (memchr(tag, '/', taglen) != NULL) { + *emsgp = "from-tag contains '/', refusing to use it in the recording " + "file name"; + return (-1); + } + len = rcid_encode(dst, dlen, cid, cidlen, method); + if (len < 0 || dlen - (size_t)len < taglen + 2) { + *emsgp = "recording file name is too long"; + return (-1); + } + dst[len++] = '='; + memcpy(dst + len, tag, taglen); + len += (int)taglen; + dst[len] = '\0'; + return (len); +} diff --git a/src/rtpp_record_util.h b/src/rtpp_record_util.h new file mode 100644 index 000000000..8074332b5 --- /dev/null +++ b/src/rtpp_record_util.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2026 Sippy Software, Inc., http://www.sippysoft.com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* Values of the rtpp_cfg.record_callid_hash */ +#define RTPP_RCID_RAW 0 /* Call-ID as is, '/' is refused */ +#define RTPP_RCID_B64URL 1 /* URL-safe base64 (RFC 4648 sec. 5) */ +#define RTPP_RCID_SHA256 2 /* SHA-256, lowercase hex */ + +/* Methods available in this build, as "raw|b64url[|sha256]" */ +extern const char rtpp_record_callid_hash_usage[]; + +int rtpp_record_callid_hash_parse(const char *, int *, const char **); +int rtpp_record_callid_fname(char *, size_t, const char *, size_t, + const char *, size_t, int, const char **); diff --git a/tests/Makefile.am b/tests/Makefile.am index 47a0fbccc..ac05391fc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -38,6 +38,9 @@ TESTS_ENVIRONMENT = \ BASEDIR=${abs_srcdir} ; export BASEDIR ; \ BUILDDIR=${abs_builddir} ; export BUILDDIR ; \ TOP_BUILDDIR=${abs_top_builddir} ; export TOP_BUILDDIR ; +if HAVE_LIBCRYPTO +TESTS_ENVIRONMENT += HAVE_LIBCRYPTO=1 ; export HAVE_LIBCRYPTO ; +endif CLEANFILES += *.core test-suite.log # Keep live output and serial execution, and repeat failures at the end. diff --git a/tests/recording/basic b/tests/recording/basic index b228386bf..542a8770f 100755 --- a/tests/recording/basic +++ b/tests/recording/basic @@ -37,7 +37,14 @@ run_recording() { report_rc ${RPTL_RC} "running basic.${stest}.rptl RPTL script" } -SUB_TESTS="${SUB_TESTS:-"files singlefile singlefile_c stopall files_stophalf singlefile_stophalf remote remote_p badpath badpath_enc"}" +# The sha256 method of --record_callid_hash is only available if rtpproxy +# has been built with OpenSSL (HAVE_LIBCRYPTO is set by the test harness). +if [ "${HAVE_LIBCRYPTO}" = 1 ] +then + SUB_TESTS_SHA256="badpath_sha256" +fi + +SUB_TESTS="${SUB_TESTS:-"files singlefile singlefile_c stopall files_stophalf singlefile_stophalf remote remote_p badpath badpath_b64 ${SUB_TESTS_SHA256}"}" for stest in ${SUB_TESTS} do diff --git a/tests/recording/basic.badpath_b64.rptl b/tests/recording/basic.badpath_b64.rptl new file mode 100644 index 000000000..30d105aef --- /dev/null +++ b/tests/recording/basic.badpath_b64.rptl @@ -0,0 +1,58 @@ +# Same Call-IDs as in basic.badpath, with --record_callid_hash b64url: the +# Call-ID is put into the recording file name encoded with the URL-safe +# base64 alphabet (RFC 4648 sec. 5) without padding, so the recording (R, Rs) +# is created inside of the recording directory under the encoded name +# instead of being refused. Names that do not fit into PATH_MAX are still +# refused, and so is '/' in the from-tag, which is always used as is. + +.eval: 0 -> RES_OK +.eval: E50 -> RES_E50 +.eval: recording.%%SUBTEST%% -> WORK_BASE +.eval: ../%%WORK_BASE%%.rec. -> CALLID +.eval: ../%%WORK_BASE%%.recs. -> CALLID_S +.eval: %%WORK_BASE%%.tag -> CALLID_T +.eval: %%RECORD_SPL_DIR%%/%%CALLID%%=from_tag_1 -> REC_BASE +.eval: %%RECORD_SPL_DIR%%/%%CALLID_S%%=from_tag_1 -> REC_BASE_S + +.eval: import sys, base64; print(base64.urlsafe_b64encode(sys.argv[1].encode()).decode().rstrip("=")) -> B64 +.exec: %%PYINT%% -c '%%B64%%' '%%CALLID%%' -> CALLID_ENC +.exec: %%PYINT%% -c '%%B64%%' '%%CALLID_S%%' -> CALLID_S_ENC +.eval: %%RECORD_SPL_DIR%%/%%CALLID_ENC%%=from_tag_1 -> ENC_BASE +.eval: %%RECORD_SPL_DIR%%/%%CALLID_S_ENC%%=from_tag_1 -> ENC_BASE_S + +# Unknown methods are rejected at startup. +.exec: %%RTPPROXY_BIN%% --record_callid_hash foo -V 2>&1 | grep -q 'unknown --record_callid_hash method' +.exec: %%RTPPROXY_BIN%% --record_callid_hash raw -V > /dev/null + +.exec: mkdir -p %%RECORD_SPL_DIR%% +.exec: rm -f %%REC_BASE%%.* %%REC_BASE_S%%* %%ENC_BASE%%.* %%ENC_BASE_S%%* + +# Longer than PATH_MAX once encoded on any supported platform, yet short +# enough for the commands carrying it to fit into the RTPP_CMD_BUFLEN. +.exec: printf '%4200s' '' | tr ' ' x -> LONG_NAME +.eval: %%WORK_BASE%%.long.%%LONG_NAME%% -> CALLID_LONG + +.eval: -d dbug -T60 -W60 -P -r %%RECORD_SPL_DIR%% --record_callid_hash b64url -> RTPPROXY_ARGS +socket rtpp: stdio: %%RTPPROXY_ARGS%% -> %%WORK_BASE%%.rout + +rtpp: U %%CALLID%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_S%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_S%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: Rs %%CALLID_S%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_T%% 127.0.0.1 12345 ../from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_T%% 127.0.0.1 54321 ../from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID_T%% to_tag_1 ../from_tag_1 -> str_compare(RES_E50) + +rtpp: U %%CALLID_LONG%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_LONG%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_E50) +rtpp: Rs %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_E50) + +.close: rtpp +.exec: for f in %%REC_BASE%%.* %%REC_BASE_S%%*; do test ! -e "$f" || exit 1; done +.exec: ls %%ENC_BASE%%.* %%ENC_BASE_S%%* > /dev/null +.exec: rm -f %%ENC_BASE%%.* %%ENC_BASE_S%%* diff --git a/tests/recording/basic.badpath_enc.rptl b/tests/recording/basic.badpath_enc.rptl deleted file mode 100644 index 83c7df093..000000000 --- a/tests/recording/basic.badpath_enc.rptl +++ /dev/null @@ -1,51 +0,0 @@ -# Same Call-IDs as in basic.badpath, with --record_fname_encode: '/' and -# '%' in the Call-ID or from-tag are written as "%2F" and "%25", so the -# recording (R, Rs) is created inside of the recording directory under the -# encoded name instead of being refused. Names that do not fit into -# PATH_MAX are still refused. - -.eval: 0 -> RES_OK -.eval: E50 -> RES_E50 -.eval: recording.%%SUBTEST%% -> WORK_BASE -.eval: ../%%WORK_BASE%%.rec. -> CALLID -.eval: ../%%WORK_BASE%%.recs. -> CALLID_S -.eval: %%WORK_BASE%%.pct%41 -> CALLID_P -.eval: %%RECORD_SPL_DIR%%/%%CALLID%%=from_tag_1 -> REC_BASE -.eval: %%RECORD_SPL_DIR%%/%%CALLID_S%%=from_tag_1 -> REC_BASE_S -# Same names, encoded ('?' stands for the '%' of the escape sequences). -.eval: %%RECORD_SPL_DIR%%/..?2F%%WORK_BASE%%.rec.=from_tag_1 -> ENC_BASE -.eval: %%RECORD_SPL_DIR%%/..?2F%%WORK_BASE%%.recs.=from_tag_1 -> ENC_BASE_S -.eval: %%RECORD_SPL_DIR%%/%%WORK_BASE%%.pct?2541=from_tag_1 -> ENC_BASE_P - -.exec: mkdir -p %%RECORD_SPL_DIR%% -.exec: rm -f %%REC_BASE%%.* %%REC_BASE_S%%* %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_P%%.* - -# Longer than PATH_MAX on any supported platform, yet short enough for -# the commands carrying it to fit into the RTPP_CMD_BUFLEN. -.exec: printf '%4200s' '' | tr ' ' x -> LONG_NAME -.eval: %%WORK_BASE%%.long.%%LONG_NAME%% -> CALLID_LONG - -.eval: -d dbug -T60 -W60 -P -r %%RECORD_SPL_DIR%% --record_fname_encode -> RTPPROXY_ARGS -socket rtpp: stdio: %%RTPPROXY_ARGS%% -> %%WORK_BASE%%.rout - -rtpp: U %%CALLID%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) -rtpp: L %%CALLID%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) -rtpp: R %%CALLID%% to_tag_1 from_tag_1 -> str_compare(RES_OK) - -rtpp: U %%CALLID_S%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) -rtpp: L %%CALLID_S%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) -rtpp: Rs %%CALLID_S%% to_tag_1 from_tag_1 -> str_compare(RES_OK) - -rtpp: U %%CALLID_P%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) -rtpp: L %%CALLID_P%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) -rtpp: R %%CALLID_P%% to_tag_1 from_tag_1 -> str_compare(RES_OK) - -rtpp: U %%CALLID_LONG%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) -rtpp: L %%CALLID_LONG%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) -rtpp: R %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_E50) -rtpp: Rs %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_E50) - -.close: rtpp -.exec: for f in %%REC_BASE%%.* %%REC_BASE_S%%*; do test ! -e "$f" || exit 1; done -.exec: ls %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_P%%.* > /dev/null -.exec: rm -f %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_P%%.* diff --git a/tests/recording/basic.badpath_sha256.rptl b/tests/recording/basic.badpath_sha256.rptl new file mode 100644 index 000000000..c0cd68294 --- /dev/null +++ b/tests/recording/basic.badpath_sha256.rptl @@ -0,0 +1,56 @@ +# Same Call-IDs as in basic.badpath, with --record_callid_hash sha256: the +# Call-ID is replaced in the recording file name with its SHA-256 digest +# in lowercase hex, so the recording (R, Rs) is created inside of the +# recording directory under a fixed-length name instead of being refused, +# even for Call-IDs too long to be used as is. '/' in the from-tag, which +# is always used as is, is still refused. Only run if rtpproxy has been +# built with OpenSSL. + +.eval: 0 -> RES_OK +.eval: E50 -> RES_E50 +.eval: recording.%%SUBTEST%% -> WORK_BASE +.eval: ../%%WORK_BASE%%.rec. -> CALLID +.eval: ../%%WORK_BASE%%.recs. -> CALLID_S +.eval: %%WORK_BASE%%.tag -> CALLID_T +.eval: %%RECORD_SPL_DIR%%/%%CALLID%%=from_tag_1 -> REC_BASE +.eval: %%RECORD_SPL_DIR%%/%%CALLID_S%%=from_tag_1 -> REC_BASE_S + +# Longer than PATH_MAX on any supported platform, yet short enough for +# the commands carrying it to fit into the RTPP_CMD_BUFLEN. +.exec: printf '%4200s' '' | tr ' ' x -> LONG_NAME +.eval: %%WORK_BASE%%.long.%%LONG_NAME%% -> CALLID_LONG + +.eval: import sys, hashlib; print(hashlib.sha256(sys.argv[1].encode()).hexdigest()) -> SHA +.exec: %%PYINT%% -c '%%SHA%%' '%%CALLID%%' -> CALLID_ENC +.exec: %%PYINT%% -c '%%SHA%%' '%%CALLID_S%%' -> CALLID_S_ENC +.exec: %%PYINT%% -c '%%SHA%%' '%%CALLID_LONG%%' -> CALLID_LONG_ENC +.eval: %%RECORD_SPL_DIR%%/%%CALLID_ENC%%=from_tag_1 -> ENC_BASE +.eval: %%RECORD_SPL_DIR%%/%%CALLID_S_ENC%%=from_tag_1 -> ENC_BASE_S +.eval: %%RECORD_SPL_DIR%%/%%CALLID_LONG_ENC%%=from_tag_1 -> ENC_BASE_L + +.exec: mkdir -p %%RECORD_SPL_DIR%% +.exec: rm -f %%REC_BASE%%.* %%REC_BASE_S%%* %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_L%%* + +.eval: -d dbug -T60 -W60 -P -r %%RECORD_SPL_DIR%% --record_callid_hash sha256 -> RTPPROXY_ARGS +socket rtpp: stdio: %%RTPPROXY_ARGS%% -> %%WORK_BASE%%.rout + +rtpp: U %%CALLID%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_S%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_S%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: Rs %%CALLID_S%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_T%% 127.0.0.1 12345 ../from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_T%% 127.0.0.1 54321 ../from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID_T%% to_tag_1 ../from_tag_1 -> str_compare(RES_E50) + +rtpp: U %%CALLID_LONG%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_LONG%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: Rs %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +.close: rtpp +.exec: for f in %%REC_BASE%%.* %%REC_BASE_S%%*; do test ! -e "$f" || exit 1; done +.exec: ls %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_L%%* > /dev/null +.exec: rm -f %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_L%%* From 1b39658733dc50043645a6fbfd115fb2d798a3a4 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Fri, 20 Nov 2026 23:04:01 -0700 Subject: [PATCH 3/4] tests: cover spool, record-all and from-tag paths of --record_callid_hash badpath_b64 and badpath_sha256 now also: - record with a spool directory (-S), with both R and Rs, and check that the files end up in the recording directory under the encoded name and nothing is left in the spool; - record everything (-a) and check the file names, and that a session whose from-tag contains '/' is still set up but not recorded; - refuse '/' in the from-tag with -S as well. The Call-IDs used cover all three base64 tail lengths. badpath now checks that '/' in the from-tag is refused in the default raw mode too. In a build without OpenSSL (no HAVE_LIBCRYPTO), recording/basic now checks that --record_callid_hash sha256 is refused with the explicit error. --- tests/recording/basic | 5 +++ tests/recording/basic.badpath.rptl | 6 +++ tests/recording/basic.badpath_b64.rptl | 51 ++++++++++++++++++++-- tests/recording/basic.badpath_sha256.rptl | 53 +++++++++++++++++++++-- 4 files changed, 108 insertions(+), 7 deletions(-) diff --git a/tests/recording/basic b/tests/recording/basic index 542a8770f..6c93b7881 100755 --- a/tests/recording/basic +++ b/tests/recording/basic @@ -39,9 +39,14 @@ run_recording() { # The sha256 method of --record_callid_hash is only available if rtpproxy # has been built with OpenSSL (HAVE_LIBCRYPTO is set by the test harness). +# Without it, the method must be refused with an explicit error. if [ "${HAVE_LIBCRYPTO}" = 1 ] then SUB_TESTS_SHA256="badpath_sha256" +else + RTPP_GLITCH_ACT="" ${RTPPROXY} --record_callid_hash sha256 -V 2>&1 | \ + grep -q 'rtpproxy has been built without OpenSSL' + report "--record_callid_hash sha256 is refused in a build without OpenSSL" fi SUB_TESTS="${SUB_TESTS:-"files singlefile singlefile_c stopall files_stophalf singlefile_stophalf remote remote_p badpath badpath_b64 ${SUB_TESTS_SHA256}"}" diff --git a/tests/recording/basic.badpath.rptl b/tests/recording/basic.badpath.rptl index c7d694bc5..ba71a707c 100644 --- a/tests/recording/basic.badpath.rptl +++ b/tests/recording/basic.badpath.rptl @@ -31,6 +31,12 @@ rtpp: L %%CALLID%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(PORT_O) rtpp: R %%CALLID%% to_tag_1 from_tag_1 -> str_compare(RES_E50) rtpp: Rs %%CALLID%% to_tag_1 from_tag_1 -> str_compare(RES_E50) +# '/' in the from-tag is refused as well. +rtpp: U %%CALLID_SHORT%%.tag 127.0.0.1 12345 ../from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_SHORT%%.tag 127.0.0.1 54321 ../from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID_SHORT%%.tag to_tag_1 ../from_tag_1 -> str_compare(RES_E50) +rtpp: Rs %%CALLID_SHORT%%.tag to_tag_1 ../from_tag_1 -> str_compare(RES_E50) + rtpp: U %%CALLID_LONG%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) rtpp: L %%CALLID_LONG%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) rtpp: R %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_E50) diff --git a/tests/recording/basic.badpath_b64.rptl b/tests/recording/basic.badpath_b64.rptl index 30d105aef..4708d0920 100644 --- a/tests/recording/basic.badpath_b64.rptl +++ b/tests/recording/basic.badpath_b64.rptl @@ -14,9 +14,9 @@ .eval: %%RECORD_SPL_DIR%%/%%CALLID%%=from_tag_1 -> REC_BASE .eval: %%RECORD_SPL_DIR%%/%%CALLID_S%%=from_tag_1 -> REC_BASE_S -.eval: import sys, base64; print(base64.urlsafe_b64encode(sys.argv[1].encode()).decode().rstrip("=")) -> B64 -.exec: %%PYINT%% -c '%%B64%%' '%%CALLID%%' -> CALLID_ENC -.exec: %%PYINT%% -c '%%B64%%' '%%CALLID_S%%' -> CALLID_S_ENC +.eval: import sys, base64; print(base64.urlsafe_b64encode(sys.argv[1].encode()).decode().rstrip("=")) -> ENC +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID%%' -> CALLID_ENC +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID_S%%' -> CALLID_S_ENC .eval: %%RECORD_SPL_DIR%%/%%CALLID_ENC%%=from_tag_1 -> ENC_BASE .eval: %%RECORD_SPL_DIR%%/%%CALLID_S_ENC%%=from_tag_1 -> ENC_BASE_S @@ -56,3 +56,48 @@ rtpp: Rs %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_E50) .exec: for f in %%REC_BASE%%.* %%REC_BASE_S%%*; do test ! -e "$f" || exit 1; done .exec: ls %%ENC_BASE%%.* %%ENC_BASE_S%%* > /dev/null .exec: rm -f %%ENC_BASE%%.* %%ENC_BASE_S%%* + +# With a spool directory (-S) the files are created there and moved into +# the recording directory when closed, both under the encoded name. +.eval: ../%%WORK_BASE%%.spool.r. -> CALLID_SR +.eval: ../%%WORK_BASE%%.spool.rs.x -> CALLID_SRS +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID_SR%%' -> CALLID_SR_ENC +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID_SRS%%' -> CALLID_SRS_ENC +.exec: rm -f %%RECORD_DIR%%/%%CALLID_SR_ENC%%=* %%RECORD_DIR%%/%%CALLID_SRS_ENC%%=* %%RECORD_SPL_DIR%%/%%CALLID_SR_ENC%%=* %%RECORD_SPL_DIR%%/%%CALLID_SRS_ENC%%=* + +.eval: -d dbug -T60 -W60 -P -r %%RECORD_DIR%% -S %%RECORD_SPL_DIR%% --record_callid_hash b64url -> RTPPROXY_ARGS +socket rtpp: stdio: %%RTPPROXY_ARGS%% -> %%WORK_BASE%%.S.rout + +rtpp: U %%CALLID_SR%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_SR%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID_SR%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_SRS%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_SRS%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: Rs %%CALLID_SRS%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_T%%.S 127.0.0.1 12345 ../from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_T%%.S 127.0.0.1 54321 ../from_tag_1 to_tag_1 -> validate_port(_) +rtpp: Rs %%CALLID_T%%.S to_tag_1 ../from_tag_1 -> str_compare(RES_E50) + +.close: rtpp +.exec: ls %%RECORD_DIR%%/%%CALLID_SR_ENC%%=from_tag_1.* %%RECORD_DIR%%/%%CALLID_SRS_ENC%%=from_tag_1* > /dev/null +.exec: for f in %%RECORD_SPL_DIR%%/%%CALLID_SR_ENC%%=* %%RECORD_SPL_DIR%%/%%CALLID_SRS_ENC%%=*; do test ! -e "$f" || exit 1; done +.exec: rm -f %%RECORD_DIR%%/%%CALLID_SR_ENC%%=* %%RECORD_DIR%%/%%CALLID_SRS_ENC%%=* + +# Record-all mode (-a) builds the names the same way. A session whose +# from-tag contains '/' is still set up, just not recorded. +.eval: ../%%WORK_BASE%%.all -> CALLID_A +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID_A%%' -> CALLID_A_ENC +.exec: rm -f %%RECORD_SPL_DIR%%/%%CALLID_A_ENC%%=* + +.eval: -d dbug -T60 -W60 -P -a -r %%RECORD_SPL_DIR%% --record_callid_hash b64url -> RTPPROXY_ARGS +socket rtpp: stdio: %%RTPPROXY_ARGS%% -> %%WORK_BASE%%.a.rout + +rtpp: U %%CALLID_A%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_A%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: U %%CALLID_A%%.tag 127.0.0.1 12345 ../from_tag_1 -> validate_port(_) + +.close: rtpp +.exec: ls %%RECORD_SPL_DIR%%/%%CALLID_A_ENC%%=from_tag_1* > /dev/null +.exec: rm -f %%RECORD_SPL_DIR%%/%%CALLID_A_ENC%%=* diff --git a/tests/recording/basic.badpath_sha256.rptl b/tests/recording/basic.badpath_sha256.rptl index c0cd68294..a93c64c85 100644 --- a/tests/recording/basic.badpath_sha256.rptl +++ b/tests/recording/basic.badpath_sha256.rptl @@ -20,10 +20,10 @@ .exec: printf '%4200s' '' | tr ' ' x -> LONG_NAME .eval: %%WORK_BASE%%.long.%%LONG_NAME%% -> CALLID_LONG -.eval: import sys, hashlib; print(hashlib.sha256(sys.argv[1].encode()).hexdigest()) -> SHA -.exec: %%PYINT%% -c '%%SHA%%' '%%CALLID%%' -> CALLID_ENC -.exec: %%PYINT%% -c '%%SHA%%' '%%CALLID_S%%' -> CALLID_S_ENC -.exec: %%PYINT%% -c '%%SHA%%' '%%CALLID_LONG%%' -> CALLID_LONG_ENC +.eval: import sys, hashlib; print(hashlib.sha256(sys.argv[1].encode()).hexdigest()) -> ENC +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID%%' -> CALLID_ENC +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID_S%%' -> CALLID_S_ENC +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID_LONG%%' -> CALLID_LONG_ENC .eval: %%RECORD_SPL_DIR%%/%%CALLID_ENC%%=from_tag_1 -> ENC_BASE .eval: %%RECORD_SPL_DIR%%/%%CALLID_S_ENC%%=from_tag_1 -> ENC_BASE_S .eval: %%RECORD_SPL_DIR%%/%%CALLID_LONG_ENC%%=from_tag_1 -> ENC_BASE_L @@ -54,3 +54,48 @@ rtpp: Rs %%CALLID_LONG%% to_tag_1 from_tag_1 -> str_compare(RES_OK) .exec: for f in %%REC_BASE%%.* %%REC_BASE_S%%*; do test ! -e "$f" || exit 1; done .exec: ls %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_L%%* > /dev/null .exec: rm -f %%ENC_BASE%%.* %%ENC_BASE_S%%* %%ENC_BASE_L%%* + +# With a spool directory (-S) the files are created there and moved into +# the recording directory when closed, both under the encoded name. +.eval: ../%%WORK_BASE%%.spool.r. -> CALLID_SR +.eval: ../%%WORK_BASE%%.spool.rs.x -> CALLID_SRS +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID_SR%%' -> CALLID_SR_ENC +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID_SRS%%' -> CALLID_SRS_ENC +.exec: rm -f %%RECORD_DIR%%/%%CALLID_SR_ENC%%=* %%RECORD_DIR%%/%%CALLID_SRS_ENC%%=* %%RECORD_SPL_DIR%%/%%CALLID_SR_ENC%%=* %%RECORD_SPL_DIR%%/%%CALLID_SRS_ENC%%=* + +.eval: -d dbug -T60 -W60 -P -r %%RECORD_DIR%% -S %%RECORD_SPL_DIR%% --record_callid_hash sha256 -> RTPPROXY_ARGS +socket rtpp: stdio: %%RTPPROXY_ARGS%% -> %%WORK_BASE%%.S.rout + +rtpp: U %%CALLID_SR%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_SR%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: R %%CALLID_SR%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_SRS%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_SRS%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: Rs %%CALLID_SRS%% to_tag_1 from_tag_1 -> str_compare(RES_OK) + +rtpp: U %%CALLID_T%%.S 127.0.0.1 12345 ../from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_T%%.S 127.0.0.1 54321 ../from_tag_1 to_tag_1 -> validate_port(_) +rtpp: Rs %%CALLID_T%%.S to_tag_1 ../from_tag_1 -> str_compare(RES_E50) + +.close: rtpp +.exec: ls %%RECORD_DIR%%/%%CALLID_SR_ENC%%=from_tag_1.* %%RECORD_DIR%%/%%CALLID_SRS_ENC%%=from_tag_1* > /dev/null +.exec: for f in %%RECORD_SPL_DIR%%/%%CALLID_SR_ENC%%=* %%RECORD_SPL_DIR%%/%%CALLID_SRS_ENC%%=*; do test ! -e "$f" || exit 1; done +.exec: rm -f %%RECORD_DIR%%/%%CALLID_SR_ENC%%=* %%RECORD_DIR%%/%%CALLID_SRS_ENC%%=* + +# Record-all mode (-a) builds the names the same way. A session whose +# from-tag contains '/' is still set up, just not recorded. +.eval: ../%%WORK_BASE%%.all -> CALLID_A +.exec: %%PYINT%% -c '%%ENC%%' '%%CALLID_A%%' -> CALLID_A_ENC +.exec: rm -f %%RECORD_SPL_DIR%%/%%CALLID_A_ENC%%=* + +.eval: -d dbug -T60 -W60 -P -a -r %%RECORD_SPL_DIR%% --record_callid_hash sha256 -> RTPPROXY_ARGS +socket rtpp: stdio: %%RTPPROXY_ARGS%% -> %%WORK_BASE%%.a.rout + +rtpp: U %%CALLID_A%% 127.0.0.1 12345 from_tag_1 -> validate_port(_) +rtpp: L %%CALLID_A%% 127.0.0.1 54321 from_tag_1 to_tag_1 -> validate_port(_) +rtpp: U %%CALLID_A%%.tag 127.0.0.1 12345 ../from_tag_1 -> validate_port(_) + +.close: rtpp +.exec: ls %%RECORD_SPL_DIR%%/%%CALLID_A_ENC%%=from_tag_1* > /dev/null +.exec: rm -f %%RECORD_SPL_DIR%%/%%CALLID_A_ENC%%=* From a6ce175e64a24ae513b422474f3a087944182721 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Fri, 20 Nov 2026 23:57:29 -0700 Subject: [PATCH 4/4] Re-gen. --- configure | 64 ++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.in | 65 +++++++++++++++++++++++++++++++++++++---------- src/config.h.in | 3 +++ tests/Makefile.in | 19 ++++++++------ 4 files changed, 130 insertions(+), 21 deletions(-) diff --git a/configure b/configure index 26ead08ba..167faf0a2 100755 --- a/configure +++ b/configure @@ -683,6 +683,8 @@ BUILD_UDP_CONTENTION_FALSE BUILD_UDP_CONTENTION_TRUE BUILD_LOG_STAND_FALSE BUILD_LOG_STAND_TRUE +HAVE_LIBCRYPTO_FALSE +HAVE_LIBCRYPTO_TRUE BUILD_CRYPTO_FALSE BUILD_CRYPTO_TRUE BUILD_ELPERIODIC_FALSE @@ -15426,6 +15428,56 @@ fi fi fi +# libcrypto (OpenSSL), for --record_callid_hash sha256 +ac_fn_c_check_header_compile "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_evp_h" = xyes +then : + found_libcrypto=yes +fi + +if test "$found_libcrypto" = yes +then + save_LIBS="${LIBS}" + LIBS="${LIBS} ${LIB_CRYPTO}" + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for EVP_Digest in libcrypto" >&5 +printf %s "checking for EVP_Digest in libcrypto... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + return EVP_Digest("", 0, NULL, NULL, EVP_sha256(), NULL); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_evp_digest=yes + +printf '%s\n' "#define HAVE_LIBCRYPTO 1" >>confdefs.h + + +else case e in #( + e) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="${save_LIBS}" +fi + # libelperiodic ac_fn_c_check_header_compile "$LINENO" "elperiodic.h" "ac_cv_header_elperiodic_h" "$ac_includes_default" if test "x$ac_cv_header_elperiodic_h" = xyes @@ -16949,6 +17001,14 @@ else BUILD_CRYPTO_FALSE= fi + if test "x${found_evp_digest}" = xyes; then + HAVE_LIBCRYPTO_TRUE= + HAVE_LIBCRYPTO_FALSE='#' +else + HAVE_LIBCRYPTO_TRUE='#' + HAVE_LIBCRYPTO_FALSE= +fi + if test "${LIBS_SIPLOG}" = ""; then BUILD_LOG_STAND_TRUE= BUILD_LOG_STAND_FALSE='#' @@ -17230,6 +17290,10 @@ if test -z "${BUILD_CRYPTO_TRUE}" && test -z "${BUILD_CRYPTO_FALSE}"; then as_fn_error $? "conditional \"BUILD_CRYPTO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_LIBCRYPTO_TRUE}" && test -z "${HAVE_LIBCRYPTO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIBCRYPTO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_LOG_STAND_TRUE}" && test -z "${BUILD_LOG_STAND_FALSE}"; then as_fn_error $? "conditional \"BUILD_LOG_STAND\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/src/Makefile.in b/src/Makefile.in index b02e980a7..dd98e5c75 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -118,6 +118,8 @@ bin_PROGRAMS = rtpproxy$(EXEEXT) $(am__EXEEXT_1) @BUILD_CRYPTO_TRUE@@BUILD_MODULES_TRUE@am__append_15 = $(MOD_DIR)/dtls_gw/librtpp_dtls_gw.la \ @BUILD_CRYPTO_TRUE@@BUILD_MODULES_TRUE@ $(MOD_DIR)/ice_lite/librtpp_ice_lite.la +@HAVE_LIBCRYPTO_TRUE@am__append_16 = $(LIB_CRYPTO) +@HAVE_LIBCRYPTO_TRUE@am__append_17 = $(LIB_CRYPTO) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ @@ -167,9 +169,11 @@ am__uninstall_files_from_dir = { \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +@HAVE_LIBCRYPTO_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) librtpproxy_la_DEPENDENCIES = $(top_srcdir)/libucl/libucl.la \ $(XXH_DIR)/libxxHash.la $(RTQ_DIR)/libRTQueue.la \ - $(am__append_14) $(am__append_15) + $(am__append_14) $(am__append_15) $(am__DEPENDENCIES_2) am__librtpproxy_la_SOURCES_DIST = main.c rtp.h rtpp_server.c \ rtpp_defines.h rtpp_log.h rtpp_record.c rtpp_session.h \ rtpp_util.c rtpp_util.h rtp.c rtp_resizer.c rtp_resizer.h \ @@ -212,6 +216,7 @@ am__librtpproxy_la_SOURCES_DIST = main.c rtp.h rtpp_server.c \ rtpp_network_io.c rtpp_network_io.h rtpp_wi_pkt.c \ rtpp_wi_pkt.h rtpp_timeout_data.c rtpp_timeout_data.h \ rtpp_locking.h rtpp_nofile.c rtpp_nofile.h rtpp_record_adhoc.h \ + rtpp_record_util.c rtpp_record_util.h \ $(CMDSRCDIR)/rpcpv1_norecord.c $(CMDSRCDIR)/rpcpv1_norecord.h \ $(CMDSRCDIR)/rpcpv1_ul_subc.c $(CMDSRCDIR)/rpcpv1_ul_subc.h \ rtpp_command_rcache.h rtpp_log_obj.h rtpp_port_table.h \ @@ -301,6 +306,7 @@ am__objects_6 = librtpproxy_la-main.lo librtpproxy_la-rtpp_server.lo \ librtpproxy_la-rtpp_wi_pkt.lo \ librtpproxy_la-rtpp_timeout_data.lo \ librtpproxy_la-rtpp_nofile.lo \ + librtpproxy_la-rtpp_record_util.lo \ $(CMDSRCDIR)/librtpproxy_la-rpcpv1_norecord.lo \ $(CMDSRCDIR)/librtpproxy_la-rpcpv1_ul_subc.lo $(am__objects_2) \ librtpproxy_la-rtpp_epoll.lo librtpproxy_la-rtpp_str.lo \ @@ -358,8 +364,8 @@ am_pproc_manager_test_OBJECTS = \ $(am__objects_15) \ $(RTPP_AUTOSRC_DIR)/pproc_manager_test-rtpp_refcnt_fin.$(OBJEXT) pproc_manager_test_OBJECTS = $(am_pproc_manager_test_OBJECTS) -am__DEPENDENCIES_1 = $(top_srcdir)/libexecinfo/libexecinfo.la -pproc_manager_test_DEPENDENCIES = $(am__DEPENDENCIES_1) +am__DEPENDENCIES_3 = $(top_srcdir)/libexecinfo/libexecinfo.la +pproc_manager_test_DEPENDENCIES = $(am__DEPENDENCIES_3) pproc_manager_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(pproc_manager_test_CFLAGS) $(CFLAGS) \ @@ -445,7 +451,7 @@ am__objects_52 = $(am__objects_25) $(am__objects_26) $(am__objects_27) \ am_rtpp_fintest_OBJECTS = rtpp_fintest-rtpp_fintest.$(OBJEXT) \ $(am__objects_17) $(am__objects_24) $(am__objects_52) rtpp_fintest_OBJECTS = $(am_rtpp_fintest_OBJECTS) -rtpp_fintest_DEPENDENCIES = $(am__DEPENDENCIES_1) +rtpp_fintest_DEPENDENCIES = $(am__DEPENDENCIES_3) rtpp_fintest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rtpp_fintest_CFLAGS) \ $(CFLAGS) $(rtpp_fintest_LDFLAGS) $(LDFLAGS) -o $@ @@ -548,8 +554,7 @@ am__objects_90 = $(am__objects_63) $(am__objects_64) $(am__objects_65) \ am_rtpp_objck_OBJECTS = $(am__objects_60) $(am__objects_62) \ $(am__objects_90) rtpp_objck_OBJECTS = $(am_rtpp_objck_OBJECTS) -am__DEPENDENCIES_2 = -rtpp_objck_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +rtpp_objck_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) rtpp_objck_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rtpp_objck_CFLAGS) \ $(CFLAGS) $(rtpp_objck_LDFLAGS) $(LDFLAGS) -o $@ @@ -651,7 +656,7 @@ am_rtpp_rzmalloc_perf_debug_OBJECTS = \ $(am__objects_100) $(am__objects_128) rtpp_rzmalloc_perf_debug_OBJECTS = \ $(am_rtpp_rzmalloc_perf_debug_OBJECTS) -rtpp_rzmalloc_perf_debug_DEPENDENCIES = $(am__DEPENDENCIES_2) \ +rtpp_rzmalloc_perf_debug_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_srcdir)/libexecinfo/libexecinfo.la rtpp_rzmalloc_perf_debug_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -724,7 +729,7 @@ am_rtpp_wref_test_OBJECTS = rtpp_wref_test-rtpp_wref_test.$(OBJEXT) \ rtpp_wref_test-rtpp_wref.$(OBJEXT) $(am__objects_130) \ $(am__objects_158) rtpp_wref_test_OBJECTS = $(am_rtpp_wref_test_OBJECTS) -rtpp_wref_test_DEPENDENCIES = $(am__DEPENDENCIES_1) +rtpp_wref_test_DEPENDENCIES = $(am__DEPENDENCIES_3) rtpp_wref_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(rtpp_wref_test_CFLAGS) $(CFLAGS) $(rtpp_wref_test_LDFLAGS) \ @@ -735,8 +740,8 @@ am__rtpproxy_SOURCES_DIST = main.c librtpproxy.la rtpp_module_if.c \ @ENABLE_MODULE_IF_TRUE@ rtpproxy-rtpp_module_if.$(OBJEXT) am_rtpproxy_OBJECTS = rtpproxy-main.$(OBJEXT) $(am__objects_159) rtpproxy_OBJECTS = $(am_rtpproxy_OBJECTS) -rtpproxy_DEPENDENCIES = librtpproxy.la $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_2) +rtpproxy_DEPENDENCIES = librtpproxy.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) rtpproxy_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(rtpproxy_CFLAGS) \ $(CFLAGS) $(rtpproxy_LDFLAGS) $(LDFLAGS) -o $@ @@ -782,6 +787,7 @@ am__rtpproxy_debug_SOURCES_DIST = main.c rtp.h rtpp_server.c \ rtpp_network_io.c rtpp_network_io.h rtpp_wi_pkt.c \ rtpp_wi_pkt.h rtpp_timeout_data.c rtpp_timeout_data.h \ rtpp_locking.h rtpp_nofile.c rtpp_nofile.h rtpp_record_adhoc.h \ + rtpp_record_util.c rtpp_record_util.h \ $(CMDSRCDIR)/rpcpv1_norecord.c $(CMDSRCDIR)/rpcpv1_norecord.h \ $(CMDSRCDIR)/rpcpv1_ul_subc.c $(CMDSRCDIR)/rpcpv1_ul_subc.h \ rtpp_command_rcache.h rtpp_log_obj.h rtpp_port_table.h \ @@ -948,6 +954,7 @@ am__objects_163 = rtpproxy_debug-main.$(OBJEXT) \ rtpproxy_debug-rtpp_wi_pkt.$(OBJEXT) \ rtpproxy_debug-rtpp_timeout_data.$(OBJEXT) \ rtpproxy_debug-rtpp_nofile.$(OBJEXT) \ + rtpproxy_debug-rtpp_record_util.$(OBJEXT) \ $(CMDSRCDIR)/rtpproxy_debug-rpcpv1_norecord.$(OBJEXT) \ $(CMDSRCDIR)/rtpproxy_debug-rpcpv1_ul_subc.$(OBJEXT) \ $(am__objects_2) rtpproxy_debug-rtpp_epoll.$(OBJEXT) \ @@ -1043,7 +1050,8 @@ am_rtpproxy_debug_OBJECTS = $(am__objects_163) $(am__objects_170) \ rtpproxy_debug_OBJECTS = $(am_rtpproxy_debug_OBJECTS) rtpproxy_debug_DEPENDENCIES = $(top_srcdir)/libucl/libucl_debug.la \ $(XXH_DIR)/libxxHash_debug.la $(RTQ_DIR)/libRTQueue_debug.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) + $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) rtpproxy_debug_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(rtpproxy_debug_CFLAGS) $(CFLAGS) $(rtpproxy_debug_LDFLAGS) \ @@ -1354,6 +1362,7 @@ am__depfiles_remade = \ ./$(DEPDIR)/librtpproxy_la-rtpp_proc_wakeup.Plo \ ./$(DEPDIR)/librtpproxy_la-rtpp_queue.Plo \ ./$(DEPDIR)/librtpproxy_la-rtpp_record.Plo \ + ./$(DEPDIR)/librtpproxy_la-rtpp_record_util.Plo \ ./$(DEPDIR)/librtpproxy_la-rtpp_refcnt.Plo \ ./$(DEPDIR)/librtpproxy_la-rtpp_refproxy.Plo \ ./$(DEPDIR)/librtpproxy_la-rtpp_ringbuf.Plo \ @@ -1478,6 +1487,7 @@ am__depfiles_remade = \ ./$(DEPDIR)/rtpproxy_debug-rtpp_proc_wakeup.Po \ ./$(DEPDIR)/rtpproxy_debug-rtpp_queue.Po \ ./$(DEPDIR)/rtpproxy_debug-rtpp_record.Po \ + ./$(DEPDIR)/rtpproxy_debug-rtpp_record_util.Po \ ./$(DEPDIR)/rtpproxy_debug-rtpp_refproxy.Po \ ./$(DEPDIR)/rtpproxy_debug-rtpp_ringbuf.Po \ ./$(DEPDIR)/rtpproxy_debug-rtpp_rw_lock.Po \ @@ -1847,6 +1857,7 @@ BASE_SOURCES = main.c rtp.h rtpp_server.c rtpp_defines.h rtpp_log.h \ rtpp_network_io.c rtpp_network_io.h rtpp_wi_pkt.c \ rtpp_wi_pkt.h rtpp_timeout_data.c rtpp_timeout_data.h \ rtpp_locking.h rtpp_nofile.c rtpp_nofile.h rtpp_record_adhoc.h \ + rtpp_record_util.c rtpp_record_util.h \ $(CMDSRCDIR)/rpcpv1_norecord.c $(CMDSRCDIR)/rpcpv1_norecord.h \ $(CMDSRCDIR)/rpcpv1_ul_subc.c $(CMDSRCDIR)/rpcpv1_ul_subc.h \ $(RTPP_AUTOSRC_SOURCES) rtpp_epoll.c rtpp_str.c rtpp_str.h \ @@ -1864,7 +1875,7 @@ rtpproxy_LDADD = librtpproxy.la -lm -lpthread $(am__append_6) \ rtpproxy_debug_LDADD = -lm -lpthread @LIBS_ELPERIODIC@ \ $(top_srcdir)/libucl/libucl_debug.la \ $(XXH_DIR)/libxxHash_debug.la $(RTQ_DIR)/libRTQueue_debug.la \ - $(RTPP_MEMDEB_LD_ADD) $(am__append_11) + $(RTPP_MEMDEB_LD_ADD) $(am__append_11) $(am__append_16) rtpproxy_debug_LDFLAGS = -Wl,--export-dynamic $(LTO_FLAG) rtpproxy_LDFLAGS = $(LTO_FLAG) $(am__append_7) SRCS_MEMDEB_CORE = $(RTPP_MEMDEB_CORESRCS) rtpp_memdeb_stats.h rtpp_memdeb_test.c @@ -1965,7 +1976,8 @@ librtpproxy_la_CFLAGS = $(rtpproxy_CFLAGS) -fPIC librtpproxy_la_CPPFLAGS = $(rtpproxy_CPPFLAGS) -DLIBRTPPROXY librtpproxy_la_LIBADD = $(top_srcdir)/libucl/libucl.la \ $(XXH_DIR)/libxxHash.la $(RTQ_DIR)/libRTQueue.la \ - $(am__append_14) $(am__append_15) @LIBS_ELPERIODIC@ + $(am__append_14) $(am__append_15) @LIBS_ELPERIODIC@ \ + $(am__append_17) librtpproxy_la_LDFLAGS = -static IPLDIR = $(top_srcdir)/src/ipol all: config.h @@ -3196,6 +3208,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librtpproxy_la-rtpp_proc_wakeup.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librtpproxy_la-rtpp_queue.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librtpproxy_la-rtpp_record.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librtpproxy_la-rtpp_record_util.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librtpproxy_la-rtpp_refcnt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librtpproxy_la-rtpp_refproxy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librtpproxy_la-rtpp_ringbuf.Plo@am__quote@ # am--include-marker @@ -3320,6 +3333,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_proc_wakeup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_queue.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_record.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_record_util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_refproxy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_ringbuf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_rw_lock.Po@am__quote@ # am--include-marker @@ -3859,6 +3873,13 @@ librtpproxy_la-rtpp_nofile.lo: rtpp_nofile.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librtpproxy_la_CPPFLAGS) $(CPPFLAGS) $(librtpproxy_la_CFLAGS) $(CFLAGS) -c -o librtpproxy_la-rtpp_nofile.lo `test -f 'rtpp_nofile.c' || echo '$(srcdir)/'`rtpp_nofile.c +librtpproxy_la-rtpp_record_util.lo: rtpp_record_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librtpproxy_la_CPPFLAGS) $(CPPFLAGS) $(librtpproxy_la_CFLAGS) $(CFLAGS) -MT librtpproxy_la-rtpp_record_util.lo -MD -MP -MF $(DEPDIR)/librtpproxy_la-rtpp_record_util.Tpo -c -o librtpproxy_la-rtpp_record_util.lo `test -f 'rtpp_record_util.c' || echo '$(srcdir)/'`rtpp_record_util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librtpproxy_la-rtpp_record_util.Tpo $(DEPDIR)/librtpproxy_la-rtpp_record_util.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtpp_record_util.c' object='librtpproxy_la-rtpp_record_util.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librtpproxy_la_CPPFLAGS) $(CPPFLAGS) $(librtpproxy_la_CFLAGS) $(CFLAGS) -c -o librtpproxy_la-rtpp_record_util.lo `test -f 'rtpp_record_util.c' || echo '$(srcdir)/'`rtpp_record_util.c + $(CMDSRCDIR)/librtpproxy_la-rpcpv1_norecord.lo: $(CMDSRCDIR)/rpcpv1_norecord.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librtpproxy_la_CPPFLAGS) $(CPPFLAGS) $(librtpproxy_la_CFLAGS) $(CFLAGS) -MT $(CMDSRCDIR)/librtpproxy_la-rpcpv1_norecord.lo -MD -MP -MF $(CMDSRCDIR)/$(DEPDIR)/librtpproxy_la-rpcpv1_norecord.Tpo -c -o $(CMDSRCDIR)/librtpproxy_la-rpcpv1_norecord.lo `test -f '$(CMDSRCDIR)/rpcpv1_norecord.c' || echo '$(srcdir)/'`$(CMDSRCDIR)/rpcpv1_norecord.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(CMDSRCDIR)/$(DEPDIR)/librtpproxy_la-rpcpv1_norecord.Tpo $(CMDSRCDIR)/$(DEPDIR)/librtpproxy_la-rpcpv1_norecord.Plo @@ -8038,6 +8059,20 @@ rtpproxy_debug-rtpp_nofile.obj: rtpp_nofile.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -c -o rtpproxy_debug-rtpp_nofile.obj `if test -f 'rtpp_nofile.c'; then $(CYGPATH_W) 'rtpp_nofile.c'; else $(CYGPATH_W) '$(srcdir)/rtpp_nofile.c'; fi` +rtpproxy_debug-rtpp_record_util.o: rtpp_record_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -MT rtpproxy_debug-rtpp_record_util.o -MD -MP -MF $(DEPDIR)/rtpproxy_debug-rtpp_record_util.Tpo -c -o rtpproxy_debug-rtpp_record_util.o `test -f 'rtpp_record_util.c' || echo '$(srcdir)/'`rtpp_record_util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtpproxy_debug-rtpp_record_util.Tpo $(DEPDIR)/rtpproxy_debug-rtpp_record_util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtpp_record_util.c' object='rtpproxy_debug-rtpp_record_util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -c -o rtpproxy_debug-rtpp_record_util.o `test -f 'rtpp_record_util.c' || echo '$(srcdir)/'`rtpp_record_util.c + +rtpproxy_debug-rtpp_record_util.obj: rtpp_record_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -MT rtpproxy_debug-rtpp_record_util.obj -MD -MP -MF $(DEPDIR)/rtpproxy_debug-rtpp_record_util.Tpo -c -o rtpproxy_debug-rtpp_record_util.obj `if test -f 'rtpp_record_util.c'; then $(CYGPATH_W) 'rtpp_record_util.c'; else $(CYGPATH_W) '$(srcdir)/rtpp_record_util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtpproxy_debug-rtpp_record_util.Tpo $(DEPDIR)/rtpproxy_debug-rtpp_record_util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtpp_record_util.c' object='rtpproxy_debug-rtpp_record_util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -c -o rtpproxy_debug-rtpp_record_util.obj `if test -f 'rtpp_record_util.c'; then $(CYGPATH_W) 'rtpp_record_util.c'; else $(CYGPATH_W) '$(srcdir)/rtpp_record_util.c'; fi` + $(CMDSRCDIR)/rtpproxy_debug-rpcpv1_norecord.o: $(CMDSRCDIR)/rpcpv1_norecord.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -MT $(CMDSRCDIR)/rtpproxy_debug-rpcpv1_norecord.o -MD -MP -MF $(CMDSRCDIR)/$(DEPDIR)/rtpproxy_debug-rpcpv1_norecord.Tpo -c -o $(CMDSRCDIR)/rtpproxy_debug-rpcpv1_norecord.o `test -f '$(CMDSRCDIR)/rpcpv1_norecord.c' || echo '$(srcdir)/'`$(CMDSRCDIR)/rpcpv1_norecord.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(CMDSRCDIR)/$(DEPDIR)/rtpproxy_debug-rpcpv1_norecord.Tpo $(CMDSRCDIR)/$(DEPDIR)/rtpproxy_debug-rpcpv1_norecord.Po @@ -9304,6 +9339,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_proc_wakeup.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_queue.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_record.Plo + -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_record_util.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_refcnt.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_refproxy.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_ringbuf.Plo @@ -9428,6 +9464,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_proc_wakeup.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_queue.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_record.Po + -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_record_util.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_refproxy.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_ringbuf.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_rw_lock.Po @@ -9789,6 +9826,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_proc_wakeup.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_queue.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_record.Plo + -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_record_util.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_refcnt.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_refproxy.Plo -rm -f ./$(DEPDIR)/librtpproxy_la-rtpp_ringbuf.Plo @@ -9913,6 +9951,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_proc_wakeup.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_queue.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_record.Po + -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_record_util.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_refproxy.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_ringbuf.Po -rm -f ./$(DEPDIR)/rtpproxy_debug-rtpp_rw_lock.Po diff --git a/src/config.h.in b/src/config.h.in index 5950636ce..be661765a 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -91,6 +91,9 @@ /* Have kqueue(2) interface. */ #undef HAVE_KQUEUE +/* Define if you have libcrypto (OpenSSL) installed */ +#undef HAVE_LIBCRYPTO + /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H diff --git a/tests/Makefile.in b/tests/Makefile.in index 8f60a8e77..15451b03d 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -101,7 +101,7 @@ host_triplet = @host@ @ENABLE_BASIC_TESTS_TRUE@ unittests/pproc_manager_test \ @ENABLE_BASIC_TESTS_TRUE@ unittests/rptl_pyspawn \ @ENABLE_BASIC_TESTS_TRUE@ unittests/rptl_process_io \ -@ENABLE_BASIC_TESTS_TRUE@ libucl/libucl1 \ +@ENABLE_BASIC_TESTS_TRUE@ libucl/libucl1 config_types/confval1 \ @ENABLE_BASIC_TESTS_TRUE@ libexecinfo/libexecinfo1 \ @ENABLE_BASIC_TESTS_TRUE@ acct_rtcp_hep/confval1 \ @ENABLE_BASIC_TESTS_TRUE@ acct_rtcp_hep/basic acct_csv/basic \ @@ -148,6 +148,7 @@ host_triplet = @host@ @ENABLE_BASIC_TESTS_TRUE@ ${makeann_EXTRA_DIST} \ @ENABLE_BASIC_TESTS_TRUE@ ${unittests_EXTRA_DIST} \ @ENABLE_BASIC_TESTS_TRUE@ ${libucl_EXTRA_DIST} \ +@ENABLE_BASIC_TESTS_TRUE@ ${config_types_EXTRA_DIST} \ @ENABLE_BASIC_TESTS_TRUE@ ${libexecinfo_EXTRA_DIST} \ @ENABLE_BASIC_TESTS_TRUE@ ${acct_rtcp_hep_EXTRA_DIST} \ @ENABLE_BASIC_TESTS_TRUE@ ${acct_csv_EXTRA_DIST} \ @@ -174,6 +175,7 @@ host_triplet = @host@ @BUILD_CRYPTO_TRUE@@ENABLE_BASIC_TESTS_TRUE@am__append_10 = dtls_gw/basic dtls_gw/fingerprint @BUILD_CRYPTO_TRUE@am__append_11 = ${dtls_gw_CLEANFILES} @BUILD_CRYPTO_TRUE@am__append_12 = ${dtls_gw_EXTRA_DIST} +@HAVE_LIBCRYPTO_TRUE@am__append_13 = HAVE_LIBCRYPTO=1 ; export HAVE_LIBCRYPTO ; subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ @@ -239,6 +241,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/basic_versions/Makefile.ami \ $(srcdir)/catch_dtmf/Makefile.ami \ $(srcdir)/command_parser/Makefile.ami \ + $(srcdir)/config_types/Makefile.ami \ $(srcdir)/dtls_gw/Makefile.ami \ $(srcdir)/extractaudio/Makefile.ami \ $(srcdir)/forwarding/Makefile.ami \ @@ -416,6 +419,7 @@ EXTRA_DIST = $(am__append_3) $(am__append_5) $(am__append_9) \ @ENABLE_BASIC_TESTS_TRUE@rtcp2json_CLEANFILES = rtcp1.output @ENABLE_BASIC_TESTS_TRUE@libucl_EXTRA_DIST = libucl @ENABLE_BASIC_TESTS_TRUE@libucl_CLEANFILES = libucl_test.output +@ENABLE_BASIC_TESTS_TRUE@config_types_EXTRA_DIST = config_types @ENABLE_BASIC_TESTS_TRUE@libexecinfo_EXTRA_DIST = libexecinfo @ENABLE_BASIC_TESTS_TRUE@libexecinfo_CLEANFILES = @ENABLE_BASIC_TESTS_TRUE@acct_rtcp_hep_EXTRA_DIST = acct_rtcp_hep @@ -473,15 +477,14 @@ EXTRA_DIST = $(am__append_3) $(am__append_5) $(am__append_9) \ @BUILD_CRYPTO_TRUE@dtls_gw_EXTRA_DIST = dtls_gw @BUILD_CRYPTO_TRUE@dtls_gw_CLEANFILES = dtls_gw.* dtls_fingerprint.* # NB: AM_TESTS_ENVIRONMENT not available until automake 1.12 -TESTS_ENVIRONMENT = \ - BASEDIR=${abs_srcdir} ; export BASEDIR ; \ - BUILDDIR=${abs_builddir} ; export BUILDDIR ; \ - TOP_BUILDDIR=${abs_top_builddir} ; export TOP_BUILDDIR ; - +TESTS_ENVIRONMENT = BASEDIR=${abs_srcdir} ; export BASEDIR ; \ + BUILDDIR=${abs_builddir} ; export BUILDDIR ; \ + TOP_BUILDDIR=${abs_top_builddir} ; export TOP_BUILDDIR ; \ + $(am__append_13) all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/autosrc/Makefile.ami $(srcdir)/recording/Makefile.ami $(srcdir)/makeann/Makefile.ami $(srcdir)/unittests/Makefile.ami $(srcdir)/libucl/Makefile.ami $(srcdir)/libexecinfo/Makefile.ami $(srcdir)/acct_rtcp_hep/Makefile.ami $(srcdir)/acct_csv/Makefile.ami $(srcdir)/catch_dtmf/Makefile.ami $(srcdir)/rtp_analyze/Makefile.ami $(srcdir)/extractaudio/Makefile.ami $(srcdir)/startstop/Makefile.ami $(srcdir)/basic_versions/Makefile.ami $(srcdir)/command_parser/Makefile.ami $(srcdir)/forwarding/Makefile.ami $(srcdir)/session_timeouts/Makefile.ami $(srcdir)/playback/Makefile.ami $(srcdir)/makeann/Makefile.ami $(srcdir)/memdeb/Makefile.ami $(srcdir)/dtls_gw/Makefile.ami $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/autosrc/Makefile.ami $(srcdir)/recording/Makefile.ami $(srcdir)/makeann/Makefile.ami $(srcdir)/unittests/Makefile.ami $(srcdir)/libucl/Makefile.ami $(srcdir)/config_types/Makefile.ami $(srcdir)/libexecinfo/Makefile.ami $(srcdir)/acct_rtcp_hep/Makefile.ami $(srcdir)/acct_csv/Makefile.ami $(srcdir)/catch_dtmf/Makefile.ami $(srcdir)/rtp_analyze/Makefile.ami $(srcdir)/extractaudio/Makefile.ami $(srcdir)/startstop/Makefile.ami $(srcdir)/basic_versions/Makefile.ami $(srcdir)/command_parser/Makefile.ami $(srcdir)/forwarding/Makefile.ami $(srcdir)/session_timeouts/Makefile.ami $(srcdir)/playback/Makefile.ami $(srcdir)/makeann/Makefile.ami $(srcdir)/memdeb/Makefile.ami $(srcdir)/dtls_gw/Makefile.ami $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -501,7 +504,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(srcdir)/autosrc/Makefile.ami $(srcdir)/recording/Makefile.ami $(srcdir)/makeann/Makefile.ami $(srcdir)/unittests/Makefile.ami $(srcdir)/libucl/Makefile.ami $(srcdir)/libexecinfo/Makefile.ami $(srcdir)/acct_rtcp_hep/Makefile.ami $(srcdir)/acct_csv/Makefile.ami $(srcdir)/catch_dtmf/Makefile.ami $(srcdir)/rtp_analyze/Makefile.ami $(srcdir)/extractaudio/Makefile.ami $(srcdir)/startstop/Makefile.ami $(srcdir)/basic_versions/Makefile.ami $(srcdir)/command_parser/Makefile.ami $(srcdir)/forwarding/Makefile.ami $(srcdir)/session_timeouts/Makefile.ami $(srcdir)/playback/Makefile.ami $(srcdir)/makeann/Makefile.ami $(srcdir)/memdeb/Makefile.ami $(srcdir)/dtls_gw/Makefile.ami $(am__empty): +$(srcdir)/autosrc/Makefile.ami $(srcdir)/recording/Makefile.ami $(srcdir)/makeann/Makefile.ami $(srcdir)/unittests/Makefile.ami $(srcdir)/libucl/Makefile.ami $(srcdir)/config_types/Makefile.ami $(srcdir)/libexecinfo/Makefile.ami $(srcdir)/acct_rtcp_hep/Makefile.ami $(srcdir)/acct_csv/Makefile.ami $(srcdir)/catch_dtmf/Makefile.ami $(srcdir)/rtp_analyze/Makefile.ami $(srcdir)/extractaudio/Makefile.ami $(srcdir)/startstop/Makefile.ami $(srcdir)/basic_versions/Makefile.ami $(srcdir)/command_parser/Makefile.ami $(srcdir)/forwarding/Makefile.ami $(srcdir)/session_timeouts/Makefile.ami $(srcdir)/playback/Makefile.ami $(srcdir)/makeann/Makefile.ami $(srcdir)/memdeb/Makefile.ami $(srcdir)/dtls_gw/Makefile.ami $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh