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>
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)
{