diff options
author | Aleix Conchillo Flaqué <aleix@oblong.com> | 2013-12-13 14:16:49 -0800 |
---|---|---|
committer | Olivier Crête <olivier.crete@collabora.com> | 2013-12-13 17:51:18 -0500 |
commit | fefd021ee2916531b8c0698c14787c2e810e9324 (patch) | |
tree | be2c820d99243f7dedd668f62dee8984eb189dac /ext/srtp/gstsrtp.c | |
parent | b3910cabaf3cc0e606a307411e496c9136dbfccc (diff) | |
download | gstreamer-plugins-bad-fefd021ee2916531b8c0698c14787c2e810e9324.tar.gz |
srtp: add 256-bit key support
* ext/srtp/gstsrtp.[ch]: added GST_SRTP_CIPHER_AES_256_ICM to
GstSrtpCipherType and new function cipher_key_size.
* ext/srtp/gstsrtpenc.c: maximum key size is now 46 characters (14 for
the salt plus the key). If different ciphers are chosen for RTP and
RTCP the maximum needed key size is expected.
* ext/srtp/gstsrtpdec.c: minor documentation updates.
https://bugzilla.gnome.org/show_bug.cgi?id=720434
Diffstat (limited to 'ext/srtp/gstsrtp.c')
-rw-r--r-- | ext/srtp/gstsrtp.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/ext/srtp/gstsrtp.c b/ext/srtp/gstsrtp.c index 427db7cf5..0f0a77fa0 100644 --- a/ext/srtp/gstsrtp.c +++ b/ext/srtp/gstsrtp.c @@ -177,9 +177,13 @@ set_crypto_policy_cipher_auth (GstSrtpCipherType cipher, { switch (cipher) { case GST_SRTP_CIPHER_AES_128_ICM: - policy->cipher_type = AES_128_ICM; + policy->cipher_type = AES_ICM; policy->cipher_key_len = 30; break; + case GST_SRTP_CIPHER_AES_256_ICM: + policy->cipher_type = AES_ICM; + policy->cipher_key_len = 46; + break; case GST_SRTP_CIPHER_NULL: policy->cipher_type = NULL_CIPHER; policy->cipher_key_len = 0; @@ -216,6 +220,28 @@ set_crypto_policy_cipher_auth (GstSrtpCipherType cipher, policy->sec_serv = sec_serv_conf_and_auth; } +guint +cipher_key_size (GstSrtpCipherType cipher) +{ + guint size = 0; + + switch (cipher) { + case GST_SRTP_CIPHER_AES_128_ICM: + size = 30; + break; + case GST_SRTP_CIPHER_AES_256_ICM: + size = 46; + break; + case GST_SRTP_CIPHER_NULL: + size = 0; + break; + default: + g_assert_not_reached (); + } + + return size; +} + static gboolean plugin_init (GstPlugin * plugin) { |