summaryrefslogtreecommitdiff
path: root/lib/ext
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2012-12-20 01:20:00 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-12-21 01:21:08 +0200
commitd3ea2626100050612dc72f8263341cffd59ec0df (patch)
tree3277e99401d289bf16d5b44e023d2516f06bd5d0 /lib/ext
parentbc6e4b26a9fcbc9aac2c2778d5a99a33d7ad65c3 (diff)
downloadgnutls-d3ea2626100050612dc72f8263341cffd59ec0df.tar.gz
Don't match further SRTP profiles after one match has been found
This makes SRTP profile matching more straightforward and intuitive, when the first matching SRTP profile will be the one selected, not the last one as before. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'lib/ext')
-rw-r--r--lib/ext/srtp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ext/srtp.c b/lib/ext/srtp.c
index 95d7a3fb89..8474aa8490 100644
--- a/lib/ext/srtp.c
+++ b/lib/ext/srtp.c
@@ -208,12 +208,14 @@ _gnutls_srtp_recv_params (gnutls_session_t session,
return gnutls_assert_val(GNUTLS_E_UNEXPECTED_PACKET_LENGTH);
}
+ priv->selected_profile = 0;
+
while (len > 0)
{
DECR_LEN (data_size, 2);
profile = _gnutls_read_uint16 (p);
- for (i = 0; i < priv->profiles_size;i++)
+ for (i = 0; i < priv->profiles_size && priv->selected_profile == 0; i++)
{
if (priv->profiles[i] == profile)
{