srtp-utils: Reuse existing function to get expected key length
This avoids unnecessary and potentially error-prone duplication.
This commit is contained in:
committed by
Evangelos Ribeiro Tzaras
parent
3db2c5dbb9
commit
e6bfa6d933
@@ -89,14 +89,8 @@ validate_crypto_attribute (calls_srtp_crypto_attribute *attr,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (attr->crypto_suite) {
|
expected_key_salt_length = get_key_size_for_suite (attr->crypto_suite);
|
||||||
case CALLS_SRTP_SUITE_AES_128_SHA1_32:
|
if (expected_key_salt_length == 0) {
|
||||||
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:
|
|
||||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||||
"Crypto suite unknown");
|
"Crypto suite unknown");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user