1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-09-27 06:05:30 +00:00

srtp-utils: Reuse existing function to get expected key length

This avoids unnecessary and potentially error-prone duplication.
This commit is contained in:
Дилян Палаузов 2023-02-12 11:15:23 +02:00 committed by Evangelos Ribeiro Tzaras
parent 3db2c5dbb9
commit e6bfa6d933

View file

@ -89,14 +89,8 @@ validate_crypto_attribute (calls_srtp_crypto_attribute *attr,
return FALSE;
}
switch (attr->crypto_suite) {
case CALLS_SRTP_SUITE_AES_128_SHA1_32:
case CALLS_SRTP_SUITE_AES_128_SHA1_80:
expected_key_salt_length = 30; /* 16 byte key + 14 byte salt */
break;
case CALLS_SRTP_SUITE_UNKNOWN:
default:
expected_key_salt_length = get_key_size_for_suite (attr->crypto_suite);
if (expected_key_salt_length == 0) {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Crypto suite unknown");
return FALSE;