dimpl: configurable SRTP profile order

A DTLS 1.2 server in dimpl picks AES-256-GCM whenever the client offers it,
and there is no setting. Our str0m peers are the DTLS server for official
TeamSpeak 6 viewers, which offer all profiles, so our streams used GCM while
official streams use AES_CM_128_HMAC_SHA1_80.

ConfigBuilder::srtp_profiles sets the profiles in order of preference: the
server picks the first of them the client offered, clients offer them in
that order and reject a server that picks another. Unset, everything is as
upstream. VOELIN-PATCH.md describes the patch and how to drop it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
Claude committed 2026-09-26 23:36:41 +00:00
1 parent d1c4424789
commit 8bb060167b
14 files changed
+448 -32

No files matched your search

+11
View File
@@ -436,6 +436,8 @@ pub enum SecurityError {
ServerSelectedDisallowedCipherSuite(Dtls12CipherSuite),
/// The server selected a DTLS 1.3 cipher suite disallowed by configuration.
ServerSelectedDisallowedDtls13CipherSuite(Dtls13CipherSuite),
/// The server selected an SRTP protection profile the client did not offer.
ServerSelectedUnofferedSrtpProfile(crate::SrtpProfile),
/// DTLS 1.2 extended master secret was required but not negotiated.
ExtendedMasterSecretNotNegotiated,
/// No mutually acceptable cipher suite was found.
@@ -555,6 +557,8 @@ pub enum ConfigError {
NoDtls12KeyExchangeGroupsAfterFiltering,
/// DTLS 1.3 suites are enabled but no key exchange group remains enabled.
NoDtls13KeyExchangeGroupsAfterFiltering,
/// The configured list of SRTP protection profiles is empty.
NoSrtpProfiles,
/// Crypto provider validation failed.
CryptoProvider(CryptoProviderValidationError),
}
@@ -1119,6 +1123,12 @@ impl fmt::Display for SecurityError {
Self::ServerSelectedDisallowedDtls13CipherSuite(suite) => {
write!(f, "server selected disallowed cipher suite: {suite:?}")
}
Self::ServerSelectedUnofferedSrtpProfile(profile) => {
write!(
f,
"server selected SRTP profile {profile} that was not offered"
)
}
Self::ExtendedMasterSecretNotNegotiated => {
write!(f, "extended master secret not negotiated")
}
@@ -1251,6 +1261,7 @@ impl fmt::Display for ConfigError {
f,
"DTLS 1.3 cipher suites are enabled but no key exchange groups remain after filtering"
),
Self::NoSrtpProfiles => write!(f, "no SRTP protection profiles configured"),
Self::CryptoProvider(err) => write!(f, "crypto provider validation failed: {err}"),
}
}