Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions modules/dtls_gw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ key negotiation and SRTP encryption/decryption.

## Command Protocol

The module supports 5 basic commands, those can be combined with the
respective U or L command with sub-command extension (&&) and module
The module supports 6 basic commands, those can be combined with the
respective U, L or Q command with sub-command extension (&&) and module
index:instance (e.g. " && M4:1" for the case of just a single instance
loaded).

Expand Down Expand Up @@ -42,6 +42,26 @@ loaded).

Detach and destroy DTLS context created by the `S` command.

- `Q`

Query the incoming stream's DTLS state without creating or reconfiguring
an endpoint. Returns `none` when no endpoint is attached, otherwise `init`,
`connecting`, `up`, or `dead`. `up` means the peer fingerprint has been
verified and both SRTP contexts are installed. State is read under the
same lock used by the handshake and media paths.

Use as a subcommand of the session query, for example:

```
Q CALL-ID FROM-TAG TO-TAG npkts_ina && M4:1 Q
```

The response ends with ` && STATE`. The query selects the incoming
stream for `FROM-TAG`; swap the tags to inspect the other leg. Poll both
DTLS peers with a bounded timeout before starting loss-sensitive traffic:
completing the signaling commands does not mean the handshake is done.
The returned state is a snapshot, not a guarantee against later failure.

## Supported Scenarios with examples:

1. Incoming INVITE with the RTP/AVP. 183/200 OK with UDP/TLS/RTP/SAVP.
Expand Down
31 changes: 29 additions & 2 deletions modules/dtls_gw/rtpp_dtls_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ static struct res_loc rtpp_dtls_conn_srtp_recv(struct rtpp_dtls_conn *,
static enum rtpp_dtls_mode rtpp_dtls_conn_setmode(struct rtpp_dtls_conn *,
const struct rdc_peer_spec *rdfsp);
static void rtpp_dtls_conn_godead(struct rtpp_dtls_conn *);
static const char *rtpp_dtls_conn_getstate(struct rtpp_dtls_conn *);

static int tls_srtp_keyinfo(SSL *, const struct srtp_crypto_suite **,
uint8_t *, size_t, uint8_t *, size_t, struct rtpp_log *);
Expand All @@ -180,6 +181,7 @@ DEFINE_SMETHODS(rtpp_dtls_conn,
.srtp_recv = &rtpp_dtls_conn_srtp_recv,
.setmode = &rtpp_dtls_conn_setmode,
.godead = &rtpp_dtls_conn_godead,
.getstate = &rtpp_dtls_conn_getstate,
);

static void
Expand Down Expand Up @@ -275,6 +277,26 @@ rtpp_dtls_conn_pickmode(enum rtpp_dtls_mode peer_mode)
/* Not Reached */
}

/* Report readiness only after fingerprint verification and both SRTP contexts. */
static const char *
rtpp_dtls_conn_getstate(struct rtpp_dtls_conn *self)
{
struct rtpp_dtls_conn_priv *pvt;
enum rdc_state state;
static const char * const names[] = {
[RDC_INIT] = "init",
[RDC_CONNECTING] = "connecting",
[RDC_UP] = "up",
[RDC_DEAD] = "dead"
};

PUB2PVT(self, pvt);
pthread_mutex_lock(&pvt->state_lock);
state = pvt->state;
pthread_mutex_unlock(&pvt->state_lock);
return (names[state]);
}

static enum rtpp_dtls_mode
rtpp_dtls_conn_setmode(struct rtpp_dtls_conn *self,
const struct rdc_peer_spec *rdfsp)
Expand Down Expand Up @@ -381,6 +403,12 @@ rtpp_dtls_conn_dtls_recv(struct rtpp_dtls_conn *self,

switch (pvt->state) {
case RDC_INIT:
/*
* No peer fingerprint until the A or P command, so the handshake
* could not be verified. Drop it, the peer retransmits.
*/
if (pvt->fingerprint[0] == '\0')
goto out;
pvt->state = RDC_CONNECTING;
break;
case RDC_CONNECTING:
Expand Down Expand Up @@ -429,8 +457,7 @@ rtpp_dtls_conn_dtls_recv(struct rtpp_dtls_conn *self,
goto godead;
}

if (pvt->fingerprint[0] != '\0' &&
strcmp(pvt->fingerprint, srv_fingerprint) != 0) {
if (strcmp(pvt->fingerprint, srv_fingerprint) != 0) {
RTPP_LOG(pvt->mself->log, RTPP_LOG_ERR, "fingerprint verification failed");
goto godead;
}
Expand Down
2 changes: 2 additions & 0 deletions modules/dtls_gw/rtpp_dtls_conn.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ DEFINE_METHOD(rtpp_dtls_conn, rtpp_dtls_conn_srtp_recv, struct res_loc,
DEFINE_METHOD(rtpp_dtls_conn, rtpp_dtls_conn_setmode, enum rtpp_dtls_mode,
const struct rdc_peer_spec *);
DEFINE_METHOD(rtpp_dtls_conn, rtpp_dtls_conn_godead, void);
DEFINE_METHOD(rtpp_dtls_conn, rtpp_dtls_conn_getstate, const char *);

DECLARE_SMETHODS(rtpp_dtls_conn)
{
Expand All @@ -74,6 +75,7 @@ DECLARE_SMETHODS(rtpp_dtls_conn)
METHOD_ENTRY(rtpp_dtls_conn_srtp_recv, srtp_recv);
METHOD_ENTRY(rtpp_dtls_conn_setmode, setmode);
METHOD_ENTRY(rtpp_dtls_conn_godead, godead);
METHOD_ENTRY(rtpp_dtls_conn_getstate, getstate);
};

DECLARE_CLASS_PUBTYPE(rtpp_dtls_conn, {});
19 changes: 18 additions & 1 deletion modules/dtls_gw/rtpp_dtls_gw.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ rtpp_dtls_gw_setup_sender(struct rtpp_module_priv *pvt,
return (0);
}

enum rdg_cmd {RDG_CMD_A, RDG_CMD_P, RDG_CMD_S, RDG_CMD_D, RDG_CMD_U};
enum rdg_cmd {RDG_CMD_A, RDG_CMD_P, RDG_CMD_S, RDG_CMD_D, RDG_CMD_U, RDG_CMD_Q};

static int
rtpp_dtls_gw_handle_command(struct rtpp_module_priv *pvt,
Expand Down Expand Up @@ -308,6 +308,13 @@ rtpp_dtls_gw_handle_command(struct rtpp_module_priv *pvt,
rdg_cmd = RDG_CMD_P;
break;

case 'q':
case 'Q':
if (argc != 1)
goto invalmode;
rdg_cmd = RDG_CMD_Q;
break;

case 's':
case 'S':
if (argc != 1)
Expand Down Expand Up @@ -349,6 +356,7 @@ rtpp_dtls_gw_handle_command(struct rtpp_module_priv *pvt,
rdfs.ssrc = (argc == 4) ? &argv[3] : NULL;
rdfsp = &rdfs;
/* Fallthrough */
case RDG_CMD_Q:
case RDG_CMD_D:
dtls_strmp = ctxp->env->strmp_in;
break;
Expand All @@ -368,6 +376,15 @@ rtpp_dtls_gw_handle_command(struct rtpp_module_priv *pvt,
rtps_c = dtls_in_poi.arg;
}

/* A query must not allocate a connection or alter its mode/fingerprint. */
if (rdg_cmd == RDG_CMD_Q) {
strlcpy(ctxp->resp->buf_t, lookup_res == 0 ? "none" :
CALL_SMETHOD(rtps_c->dtls_conn, getstate), sizeof(ctxp->resp->buf_t));
if (lookup_res == 0)
return (0);
goto out;
}

if (rdg_cmd == RDG_CMD_D || rdg_cmd == RDG_CMD_U) {
if (lookup_res == 0) {
return (-1);
Expand Down
11 changes: 11 additions & 0 deletions python/RPTL/examples/dtls.ready.rptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Q selects the incoming stream for the named tag: reverse tags for the peer.
# Check every endpoint: one peer being ready does not imply the other is.
fwd: Q %%CALLID_F%% %%FT%% %%TT%% npkts_ina && M4:1 Q -> str_split(&&, _, F4A_STATE)
fwd: Q %%CALLID_F%% %%TT%% %%FT%% npkts_ina && M4:1 Q -> str_split(&&, _, F4O_STATE)
fwd: Q %%CALLID_F%%_ipv6 %%FT%% %%TT%% npkts_ina && M4:1 Q -> str_split(&&, _, F6A_STATE)
fwd: Q %%CALLID_F%%_ipv6 %%TT%% %%FT%% npkts_ina && M4:1 Q -> str_split(&&, _, F6O_STATE)
geno: Q %%CALLID_O%% %%FT%% %%TT%% npkts_ina && M4:1 Q -> str_split(&&, _, O4_STATE)
geno: Q %%CALLID_O%%_ipv6 %%FT%% %%TT%% npkts_ina && M4:1 Q -> str_split(&&, _, O6_STATE)
gena: Q %%CALLID_A%% %%FT%% %%TT%% npkts_ina && M4:1 Q -> str_split(&&, _, A4_STATE)
gena: Q %%CALLID_A%%_ipv6 %%FT%% %%TT%% npkts_ina && M4:1 Q -> str_split(&&, _, A6_STATE)
.eval: %%F4A_STATE%% %%F4O_STATE%% %%F6A_STATE%% %%F6O_STATE%% %%O4_STATE%% %%O6_STATE%% %%A4_STATE%% %%A6_STATE%% -> str_equal(DTLS_EXPECTED, DTLS_READY)
18 changes: 11 additions & 7 deletions python/RPTL/examples/dtls.scenario.rptl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ gena: R %%CALLID_A%%_ipv6 %%FT%% %%TT%% -> str_compare(RES_OK)
geno: R %%CALLID_O%% %%FT%% %%TT%% -> str_compare(RES_OK)
geno: R %%CALLID_O%%_ipv6 %%FT%% %%TT%% -> str_compare(RES_OK)

.sleep: 0.1
# Wait for verified SRTP keys at both ends, not a fixed handshake delay.
.eval: none up none up up up none none -> DTLS_EXPECTED
.until: DTLS_READY do dtls.ready.rptl every 0.05 10

.echo: Starting streaming...
geno: P%%NTIMES%% %%CALLID_O%% %%PROMPT_NAME%% %%CODEC%% %%FT%% %%TT%% -> str_compare(RES_OK)
Expand Down Expand Up @@ -78,16 +80,18 @@ fwd: L %%CALLID_F%% 127.0.0.1 %%PORTO_IPv4%% %%FT%% %%TT%% && M4:1 S -> str_spli
.eval: %%DTLS_PARAMS%% -> str_split( , DTLS_MODE, DTLS_DIGALG, DTLS_DIGSUM)
gena: Uc%%CODEC%% %%CALLID_A%% 127.0.0.1 %%PORT2_IPv4%% %%FT%% && M4:1 P %%DTLS_DIGALG%% %%DTLS_DIGSUM%% -> validate_port(_)

fwd: U6 %%CALLID_F%%_ipv6 ::1 %%PORTA_IPv6%% %%TT%% %%FT%% && M4:1 S -> str_split(&&, _, DTLS_PARAMS)
fwd: U6 %%CALLID_F%%_ipv6 ::1 %%PORTA_IPv6%% %%TT%% %%FT%% && M4:1 S -> str_split(&&, _, DTLS_PARAMS_AB)
.eval: %%_%% -> str_compare(PORT2_IPv6)
.eval: %%DTLS_PARAMS%% -> str_split( , DTLS_MODE, DTLS_DIGALG, DTLS_DIGSUM)
gena: U6c%%CODEC%% %%CALLID_A%%_ipv6 ::1 %%PORT2_IPv6%% %%FT%% && M4:1 P %%DTLS_DIGALG%% %%DTLS_DIGSUM%% -> validate_port(_)
gena: L6z60 %%CALLID_A%%_ipv6 %%TRASH_IPv6%% %%TRASH_PORT%% %%FT%% %%TT%% && M4:1 S -> str_split(&&, _, DTLS_PARAMS)
gena: L6z60 %%CALLID_A%%_ipv6 %%TRASH_IPv6%% %%TRASH_PORT%% %%FT%% %%TT%% && M4:1 S -> str_split(&&, _, DTLS_PARAMS_BA)
.eval: %%_%% -> str_compare(PORTA_IPv6)
.eval: %%DTLS_PARAMS%% -> str_split( , DTLS_MODE, DTLS_DIGALG, DTLS_DIGSUM)
.eval: %%DTLS_PARAMS_BA%% -> str_split( , DTLS_MODE, DTLS_DIGALG, DTLS_DIGSUM)
fwd: U6 %%CALLID_F%%_ipv6 ::1 %%PORTA_IPv6%% %%FT%% && M4:1 A %%DTLS_DIGALG%% %%DTLS_DIGSUM%% -> str_compare(PORT1_IPv6)
fwd: L6 %%CALLID_F%%_ipv6 ::1 %%PORTO_IPv6%% %%FT%% %%TT%% && M4:1 A %%DTLS_DIGALG%% %%DTLS_DIGSUM%% -> str_compare(PORT2_IPv6)
.eval: %%DTLS_PARAMS_AB%% -> str_split( , DTLS_MODE, DTLS_DIGALG, DTLS_DIGSUM)
gena: U6c%%CODEC%% %%CALLID_A%%_ipv6 ::1 %%PORT2_IPv6%% %%FT%% && M4:1 P %%DTLS_DIGALG%% %%DTLS_DIGSUM%% -> validate_port(_)

.sleep: 0.1
.eval: up up up up up up up up -> DTLS_EXPECTED
.until: DTLS_READY do dtls.ready.rptl every 0.05 10

.echo: Starting streaming...
geno: P%%NTIMES%% %%CALLID_O%% %%PROMPT_NAME%% %%CODEC%% %%FT%% %%TT%% -> str_compare(RES_OK)
Expand Down
4 changes: 2 additions & 2 deletions tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ host_triplet = @host@
@BUILD_CRYPTO_TRUE@@ENABLE_MEMGLITCHING_TRUE@am__append_7 = memdeb/glitch_dtls_gw
@ENABLE_MEMGLITCHING_TRUE@am__append_8 = ${memdeb_CLEANFILES}
@ENABLE_MEMGLITCHING_TRUE@am__append_9 = ${memdeb_EXTRA_DIST}
@BUILD_CRYPTO_TRUE@@ENABLE_BASIC_TESTS_TRUE@am__append_10 = dtls_gw/basic
@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}
subdir = tests
Expand Down Expand Up @@ -471,7 +471,7 @@ EXTRA_DIST = $(am__append_3) $(am__append_5) $(am__append_9) \
@ENABLE_MEMGLITCHING_TRUE@memdeb_EXTRA_DIST = memdeb
@ENABLE_MEMGLITCHING_TRUE@memdeb_CLEANFILES = glitch1.*
@BUILD_CRYPTO_TRUE@dtls_gw_EXTRA_DIST = dtls_gw
@BUILD_CRYPTO_TRUE@dtls_gw_CLEANFILES = 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 ; \
Expand Down
4 changes: 2 additions & 2 deletions tests/dtls_gw/Makefile.ami
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dtls_gw_EXTRA_DIST = dtls_gw
dtls_gw_CLEANFILES = dtls_gw.*
dtls_gw_CLEANFILES = dtls_gw.* dtls_fingerprint.*
if ENABLE_BASIC_TESTS
TESTS += dtls_gw/basic
TESTS += dtls_gw/basic dtls_gw/fingerprint
endif
CLEANFILES += ${dtls_gw_CLEANFILES}
EXTRA_DIST += ${dtls_gw_EXTRA_DIST}
2 changes: 2 additions & 0 deletions tests/dtls_gw/basic.rptl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ socket fwd: stdio: %%RTPPROXY_ARGS%% -i -> dtls_gw.f.creplies
.eval: dtls_gw.o.rlog -> RTPPROXY_STDERR
socket geno: stdio: %%RTPPROXY_ARGS%% -P -r %%RECORD_DIR%% -S %%RECORD_SPL_DIR%% -> dtls_gw.o.creplies
.echo: OK: rtpproxy GenO started
.eval: 0 -> RES_OK
.include: state.rptl
.include: %%SCENARIO%%
.include: oversize.rptl
.close: geno
Expand Down
23 changes: 23 additions & 0 deletions tests/dtls_gw/fingerprint
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

BASEDIR="${BASEDIR:-$(dirname -- $0)/..}"
BASEDIR="$(readlink -f -- $BASEDIR)"
. "${BASEDIR}/functions"

{ ${RPTL_INT} -s "${BASEDIR}/dtls_gw/fingerprint.rptl" \
-D RTPPROXY_BIN="`strip_wrapper "${RTPPROXY}"`" \
-D DSO="${TOP_BUILDDIR}/modules/dtls_gw/.libs/rtpp_dtls_gw_debug.so" \
-D PROBE_SCRIPT="${BASEDIR}/dtls_gw/preauth_probe.py" \
2>&1 > dtls_fingerprint.vars
echo ${?} > dtls_fingerprint.rptl.rc
} | tee dtls_fingerprint.rlog
RPTL_RC=`cat dtls_fingerprint.rptl.rc`

for logfile in dtls_fingerprint.?.rlog
do
if [ -e "${logfile}" ]
then
cat "${logfile}" >> dtls_fingerprint.rlog
fi
done
report_rc ${RPTL_RC} "DTLS peer-fingerprint security regression"
18 changes: 18 additions & 0 deletions tests/dtls_gw/fingerprint.rptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.eval: -T30 -p /dev/null --bridge_symmetric -d dbug -l 0.0.0.0 -6 /:: --dso %%DSO%% -> RTPPROXY_ARGS
.eval: dtls_fingerprint.f.rlog -> RTPPROXY_STDERR
socket fwd: stdio: %%RTPPROXY_ARGS%% -i
.eval: dtls_fingerprint.o.rlog -> RTPPROXY_STDERR
socket geno: stdio: %%RTPPROXY_ARGS%%
.eval: 0 -> RES_OK
.eval: U -> PA_U
.eval: L -> PA_L
.eval: 127.0.0.1 -> PA_HOST
.include: preauth.rptl
.eval: U6 -> PA_U
.eval: L6 -> PA_L
.eval: ::1 -> PA_HOST
.include: preauth.rptl
# A configured but mismatching peer must still fail certificate verification.
.include: state.rptl
.close: geno
.close: fwd
3 changes: 3 additions & 0 deletions tests/dtls_gw/oversize.ready.rptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fwd: Q %%OS_CALLID%% to_tag_1 from_tag_1 npkts_ina && M4:1 Q -> str_split(&&, _, OS_F_STATE)
geno: Q %%OS_CALLID%% from_tag_1 to_tag_1 npkts_ina && M4:1 Q -> str_split(&&, _, OS_O_STATE)
.eval: %%OS_F_STATE%% %%OS_O_STATE%% -> str_equal(OS_DTLS_EXPECTED, OS_DTLS_READY)
3 changes: 2 additions & 1 deletion tests/dtls_gw/oversize.rptl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ geno: U %%OS_CALLID%% 127.0.0.1 %%OS_PORT1%% from_tag_1 && M4:1 A %%DTLS_DIGALG%
geno: L %%OS_CALLID%% 0.0.0.0 0 from_tag_1 to_tag_1 && M4:1 S -> str_split(&&, OS_PORTO, DTLS_PARAMS)
.eval: %%DTLS_PARAMS%% -> str_split( , DTLS_MODE, DTLS_DIGALG, DTLS_DIGSUM)
fwd: L %%OS_CALLID%% 127.0.0.1 %%OS_PORTO%% from_tag_1 to_tag_1 && M4:1 P %%DTLS_DIGALG%% %%DTLS_DIGSUM%% -> validate_port(OS_PORT2)
.sleep: 1
.eval: up up -> OS_DTLS_EXPECTED
.until: OS_DTLS_READY do oversize.ready.rptl every 0.05 10
.exec: %%PYINT%% -c "import socket; s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM); [s.sendto(bytes.fromhex('8000%04x%08x00000001' % (q, q * 160))+bytes(n),('127.0.0.1',%%OS_PORT2%%)) for q, n in ((1, 160), (2, 9000), (3, 160))]"
.eval: npkts_ina=3 nrelayed=2 ndropped=1 -> OS_EXPECTED
.until: OS_DONE do oversize.check.rptl every 0.1 5
Expand Down
3 changes: 3 additions & 0 deletions tests/dtls_gw/preauth.check.rptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
geno: Q %%PA_CALLID%% from_tag_1 to_tag_1 npkts_ina && M4:1 Q -> str_split(&&, _, PA_O)
fwd: Q %%PA_CALLID%% to_tag_1 from_tag_1 npkts_ina && M4:1 Q -> str_split(&&, _, PA_F)
.eval: %%PA_O%% %%PA_F%% -> str_equal(PA_READY, PA_DONE)
31 changes: 31 additions & 0 deletions tests/dtls_gw/preauth.rptl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Exercise S before A with a real self-signed DTLS peer, on the wire.
.eval: dtls_preauth_%%PA_U%% -> PA_CALLID
.eval: PREAUTH_CLIENTHELLOS_IGNORED -> PA_IGNORED
.eval: AUTHORIZED -> PA_AUTHORIZED
.eval: connecting init -> PA_BLOCKED
.eval: up up -> PA_READY
fwd: %%PA_U%% %%PA_CALLID%% %%PA_HOST%% 0 from_tag_1 && M4:1 S -> str_split(&&, PA_PORTF, PA_FP)
.eval: %%PA_FP%% -> str_split( , _, PA_FALG, PA_FSUM)
.pyspawn: %%PROBE_SCRIPT%% %%PA_HOST%% %%PA_PORTF%% -> preauth_probe
.readline: preauth_probe 5 -> validate_port(PA_RELAY)
fwd: %%PA_L%% %%PA_CALLID%% %%PA_HOST%% %%PA_RELAY%% from_tag_1 to_tag_1 -> validate_port(_)
geno: %%PA_U%% %%PA_CALLID%% %%PA_HOST%% %%PA_RELAY%% from_tag_1 -> validate_port(_)
geno: %%PA_L%% %%PA_CALLID%% %%PA_HOST%% 0 from_tag_1 to_tag_1 && M4:1 S -> str_split(&&, _, PA_FP)
.eval: %%PA_FP%% -> str_split( , _, PA_OALG, PA_OSUM)
geno: %%PA_U%% %%PA_CALLID%% %%PA_HOST%% %%PA_RELAY%% from_tag_1 && M4:1 P %%PA_FALG%% %%PA_FSUM%% -> validate_port(_)
# Do not check init immediately after signaling: wait for actual retries.
# The relay fails on ANY server response, even a handshake that later fails.
.readline: preauth_probe 10 -> str_compare(PA_IGNORED)
geno: Q %%PA_CALLID%% from_tag_1 to_tag_1 npkts_ina && M4:1 Q -> str_split(&&, _, PA_O)
fwd: Q %%PA_CALLID%% to_tag_1 from_tag_1 npkts_ina && M4:1 Q -> str_split(&&, _, PA_F)
.eval: %%PA_O%% %%PA_F%% -> str_compare(PA_BLOCKED)
.kill: preauth_probe USR1
.readline: preauth_probe 5 -> str_compare(PA_AUTHORIZED)
# The SAME peer must recover on retransmission with the matching fingerprint.
fwd: %%PA_L%% %%PA_CALLID%% %%PA_HOST%% %%PA_RELAY%% from_tag_1 to_tag_1 && M4:1 A %%PA_OALG%% %%PA_OSUM%% -> validate_port(_)
.until: PA_DONE do preauth.check.rptl every 0.05 10
.kill: preauth_probe TERM
.wait: preauth_probe 5
fwd: D %%PA_CALLID%% from_tag_1 to_tag_1 -> str_compare(RES_OK)
geno: D %%PA_CALLID%% from_tag_1 to_tag_1 -> str_compare(RES_OK)
.echo: OK: DTLS before fingerprint blocked, then matching peer recovered (%%PA_U%%)
Loading
Loading