Merge pull request #1304 in FS/freeswitch from ~TREVORA/freeswitch:bugfix/FS-10370-enable-padding-for-srtp-keys to master

* commit '09174819a9a2a69d89aaafe25470d567a73d7bc6':
  FS-10370: Enable SRTP Key Padding
This commit is contained in:
Brian West 2017-06-15 14:44:07 +00:00
commit fa0edd81ba

View File

@ -1173,10 +1173,12 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh
#endif
switch_b64_encode(key, SUITES[ctype].keylen, b64_key, sizeof(b64_key));
p = strrchr((char *) b64_key, '=');
if (!switch_channel_var_true(channel, "rtp_pad_srtp_keys")) {
p = strrchr((char *) b64_key, '=');
while (p && *p && *p == '=') {
*p-- = '\0';
while (p && *p && *p == '=') {
*p-- = '\0';
}
}
if (index == SWITCH_NO_CRYPTO_TAG) index = ctype + 1;