mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-12-04 20:07:36 +00:00
srtp-utils: Add implicit padding characters explicitly
Otherwise base64 decoding will give us a wrong key.
This commit is contained in:
parent
cfd371d72e
commit
3db2c5dbb9
1 changed files with 14 additions and 1 deletions
|
@ -405,7 +405,20 @@ calls_srtp_parse_sdp_crypto_attribute (const char *attribute,
|
|||
|
||||
n_key_infos = g_strv_length (key_info_fields);
|
||||
|
||||
key_param->b64_keysalt = g_strdup (key_info_fields[0]);
|
||||
switch (strlen (key_info_fields[0]) % 4) {
|
||||
case 3:
|
||||
key_param->b64_keysalt = g_strconcat (key_info_fields[0], "=", NULL);
|
||||
break;
|
||||
case 2:
|
||||
key_param->b64_keysalt = g_strconcat (key_info_fields[0], "==", NULL);
|
||||
break;
|
||||
case 1:
|
||||
g_assert_not_reached (); /* impossible with base64 */
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
key_param->b64_keysalt = g_strdup (key_info_fields[0]);
|
||||
}
|
||||
|
||||
if (n_key_infos == 1) {
|
||||
key_info_lifetime_index = 0;
|
||||
|
|
Loading…
Reference in a new issue