mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
This commit resolves issue #46. The GCM mode was using the wrong master SALT length. The master SALT should be 96 bits instead of 112 bits. Note, GCM mode uses the legacy CTR mode for the KDF. The legagacy CTR mode cipher implementations assume a 112 bit SALT. Changes to the cipher abstraction layer API are required to provide the ability to specify the SALT length. For now this commit modifies the SRTP layer to ensure the SALT is zero-appended before initializing the KDF. This commit also provides public definitions for the GCM cipher suite master key sizes to avoid confusion for application developers.
This commit is contained in:
@@ -1670,7 +1670,7 @@ const srtp_policy_t aes128_gcm_8_policy = {
|
||||
{ ssrc_any_outbound, 0 }, /* SSRC */
|
||||
{ /* SRTP policy */
|
||||
AES_128_GCM, /* cipher type */
|
||||
30, /* cipher key length in octets */
|
||||
AES_128_GCM_KEYSIZE_WSALT, /* cipher key length in octets */
|
||||
NULL_AUTH, /* authentication func type */
|
||||
0, /* auth key length in octets */
|
||||
8, /* auth tag length in octets */
|
||||
@@ -1678,7 +1678,7 @@ const srtp_policy_t aes128_gcm_8_policy = {
|
||||
},
|
||||
{ /* SRTCP policy */
|
||||
AES_128_GCM, /* cipher type */
|
||||
30, /* cipher key length in octets */
|
||||
AES_128_GCM_KEYSIZE_WSALT, /* cipher key length in octets */
|
||||
NULL_AUTH, /* authentication func type */
|
||||
0, /* auth key length in octets */
|
||||
8, /* auth tag length in octets */
|
||||
@@ -1695,7 +1695,7 @@ const srtp_policy_t aes128_gcm_8_cauth_policy = {
|
||||
{ ssrc_any_outbound, 0 }, /* SSRC */
|
||||
{ /* SRTP policy */
|
||||
AES_128_GCM, /* cipher type */
|
||||
30, /* cipher key length in octets */
|
||||
AES_128_GCM_KEYSIZE_WSALT, /* cipher key length in octets */
|
||||
NULL_AUTH, /* authentication func type */
|
||||
0, /* auth key length in octets */
|
||||
8, /* auth tag length in octets */
|
||||
@@ -1703,7 +1703,7 @@ const srtp_policy_t aes128_gcm_8_cauth_policy = {
|
||||
},
|
||||
{ /* SRTCP policy */
|
||||
AES_128_GCM, /* cipher type */
|
||||
30, /* cipher key length in octets */
|
||||
AES_128_GCM_KEYSIZE_WSALT, /* cipher key length in octets */
|
||||
NULL_AUTH, /* authentication func type */
|
||||
0, /* auth key length in octets */
|
||||
8, /* auth tag length in octets */
|
||||
@@ -1720,7 +1720,7 @@ const srtp_policy_t aes256_gcm_8_policy = {
|
||||
{ ssrc_any_outbound, 0 }, /* SSRC */
|
||||
{ /* SRTP policy */
|
||||
AES_256_GCM, /* cipher type */
|
||||
46, /* cipher key length in octets */
|
||||
AES_256_GCM_KEYSIZE_WSALT, /* cipher key length in octets */
|
||||
NULL_AUTH, /* authentication func type */
|
||||
0, /* auth key length in octets */
|
||||
8, /* auth tag length in octets */
|
||||
@@ -1728,7 +1728,7 @@ const srtp_policy_t aes256_gcm_8_policy = {
|
||||
},
|
||||
{ /* SRTCP policy */
|
||||
AES_256_GCM, /* cipher type */
|
||||
46, /* cipher key length in octets */
|
||||
AES_256_GCM_KEYSIZE_WSALT, /* cipher key length in octets */
|
||||
NULL_AUTH, /* authentication func type */
|
||||
0, /* auth key length in octets */
|
||||
8, /* auth tag length in octets */
|
||||
@@ -1745,7 +1745,7 @@ const srtp_policy_t aes256_gcm_8_cauth_policy = {
|
||||
{ ssrc_any_outbound, 0 }, /* SSRC */
|
||||
{ /* SRTP policy */
|
||||
AES_256_GCM, /* cipher type */
|
||||
46, /* cipher key length in octets */
|
||||
AES_256_GCM_KEYSIZE_WSALT, /* cipher key length in octets */
|
||||
NULL_AUTH, /* authentication func type */
|
||||
0, /* auth key length in octets */
|
||||
8, /* auth tag length in octets */
|
||||
@@ -1753,7 +1753,7 @@ const srtp_policy_t aes256_gcm_8_cauth_policy = {
|
||||
},
|
||||
{ /* SRTCP policy */
|
||||
AES_256_GCM, /* cipher type */
|
||||
46, /* cipher key length in octets */
|
||||
AES_256_GCM_KEYSIZE_WSALT, /* cipher key length in octets */
|
||||
NULL_AUTH, /* authentication func type */
|
||||
0, /* auth key length in octets */
|
||||
8, /* auth tag length in octets */
|
||||
|
Reference in New Issue
Block a user