]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5937: i need to build a test rig for this, go go gadget iphone commit
authorBrian West <brian@freeswitch.org>
Tue, 25 Feb 2014 05:44:35 +0000 (23:44 -0600)
committerBrian West <brian@freeswitch.org>
Tue, 25 Feb 2014 05:44:44 +0000 (23:44 -0600)
src/include/switch_rtp.h
src/switch_core_media.c
src/switch_rtp.c

index 489d6a3a13aacedb3e44091831a4bff083e40cc9..a072fa59fa4ea3d6d5f1ea5cf3ea98739b4eee9a 100644 (file)
@@ -50,7 +50,7 @@ SWITCH_BEGIN_EXTERN_C
 #define SWITCH_RTP_KEY_LEN 30
 #define SWITCH_RTP_CRYPTO_KEY_32 "AES_CM_128_HMAC_SHA1_32"
 #define SWITCH_RTP_CRYPTO_KEY_80 "AES_CM_128_HMAC_SHA1_80"
-#define SWITCH_RTP_CRYPTO_KEY_8 "AES_GCM_128_8"
+#define SWITCH_RTP_CRYPTO_KEY_8 "AEAD_AES_128_GCM_8"
        typedef enum {
        SWITCH_RTP_CRYPTO_SEND,
        SWITCH_RTP_CRYPTO_RECV,
@@ -65,8 +65,8 @@ typedef enum {
        AES_CM_128_HMAC_SHA1_32,
        AES_CM_256_HMAC_SHA1_80,
        AES_CM_192_HMAC_SHA1_80,
-       AES_GCM_256_8,
-       AES_GCM_128_8,
+       AEAD_AES_256_GCM_8,
+       AEAD_AES_128_GCM_8,
        AES_CM_128_NULL_AUTH
 } switch_rtp_crypto_key_type_t;
 
index fec11bb729ffe8ece78c0129b2d26d24104a207b..5cd60d34c39cd8513a6e1923cf9db344e6e28151 100644 (file)
@@ -824,9 +824,9 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh
 
        if (ctype == AES_CM_128_HMAC_SHA1_80) {
                type_str = SWITCH_RTP_CRYPTO_KEY_80;
-       } else if (ctype == AES_GCM_256_8) {
+       } else if (ctype == AEAD_AES_256_GCM_8) {
                type_str = SWITCH_RTP_CRYPTO_KEY_8;
-       } else if (ctype == AES_GCM_128_8) {
+       } else if (ctype == AEAD_AES_128_GCM_8) {
                type_str = SWITCH_RTP_CRYPTO_KEY_8;
        } else if (ctype == AES_CM_256_HMAC_SHA1_80) {
                type_str = SWITCH_RTP_CRYPTO_KEY_80;
@@ -902,7 +902,7 @@ switch_status_t switch_core_media_add_crypto(switch_secure_settings_t *ssec, con
                } else if (!strncasecmp(p, SWITCH_RTP_CRYPTO_KEY_80, strlen(SWITCH_RTP_CRYPTO_KEY_80))) {
                        type = AES_CM_128_HMAC_SHA1_80;
                } else if (!strncasecmp(p, SWITCH_RTP_CRYPTO_KEY_8, strlen(SWITCH_RTP_CRYPTO_KEY_8))) {
-                       type = AES_GCM_128_8;
+                       type = AEAD_AES_128_GCM_8;
                } else {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error near [%s]\n", p);
                        goto bad;
@@ -1049,7 +1049,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio
                                                                                          engine->ssec.local_raw_key, SWITCH_RTP_KEY_LEN);
                                } else if (switch_stristr(SWITCH_RTP_CRYPTO_KEY_8, crypto)) {
                                        switch_channel_set_variable(session->channel, varname, SWITCH_RTP_CRYPTO_KEY_8);
-                                       switch_core_media_build_crypto(session->media_handle, type, crypto_tag, AES_GCM_128_8, SWITCH_RTP_CRYPTO_SEND, 1);
+                                       switch_core_media_build_crypto(session->media_handle, type, crypto_tag, AEAD_AES_128_GCM_8, SWITCH_RTP_CRYPTO_SEND, 1);
                                        switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, atoi(crypto), engine->ssec.crypto_type,
                                                                                          engine->ssec.local_raw_key, SWITCH_RTP_KEY_LEN);
                                } else {
@@ -1090,7 +1090,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio
                                switch_core_media_build_crypto(session->media_handle, type, crypto_tag, AES_CM_128_HMAC_SHA1_80, SWITCH_RTP_CRYPTO_SEND, 1);
                        } else if (switch_stristr(SWITCH_RTP_CRYPTO_KEY_8, crypto)) {
                                switch_channel_set_variable(session->channel, varname, SWITCH_RTP_CRYPTO_KEY_8);
-                               switch_core_media_build_crypto(session->media_handle, type, crypto_tag, AES_GCM_128_8, SWITCH_RTP_CRYPTO_SEND, 1);
+                               switch_core_media_build_crypto(session->media_handle, type, crypto_tag, AEAD_AES_128_GCM_8, SWITCH_RTP_CRYPTO_SEND, 1);
                        } else {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Crypto Setup Failed!.\n");
                        }
@@ -1127,9 +1127,9 @@ SWITCH_DECLARE(void) switch_core_session_check_outgoing_crypto(switch_core_sessi
                } else if (!strcasecmp(var, SWITCH_RTP_CRYPTO_KEY_8)) {
                        switch_channel_set_flag(channel, CF_SECURE);
                        switch_core_media_build_crypto(session->media_handle,
-                                                                                  SWITCH_MEDIA_TYPE_AUDIO, 1, AES_GCM_128_8, SWITCH_RTP_CRYPTO_SEND, 0);
+                                                                                  SWITCH_MEDIA_TYPE_AUDIO, 1, AEAD_AES_128_GCM_8, SWITCH_RTP_CRYPTO_SEND, 0);
                        switch_core_media_build_crypto(session->media_handle,
-                                                                                  SWITCH_MEDIA_TYPE_VIDEO, 1, AES_GCM_128_8, SWITCH_RTP_CRYPTO_SEND, 0);
+                                                                                  SWITCH_MEDIA_TYPE_VIDEO, 1, AEAD_AES_128_GCM_8, SWITCH_RTP_CRYPTO_SEND, 0);
                }
        }
        
index 99fa37a9064f6ce51cee81ca6641cfd32fe0fcb4..a5d0226a3165d15a550efdf88248758f99d3431f 100644 (file)
@@ -3060,21 +3060,21 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
                }
                break;
 
-       case AES_GCM_256_8:
+       case AEAD_AES_256_GCM_8:
                crypto_policy_set_aes_gcm_256_8_auth(&policy->rtp);
                crypto_policy_set_aes_gcm_256_8_auth(&policy->rtcp);
 
                if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
-                       switch_channel_set_variable(channel, "rtp_has_crypto", "AES_GCM_256_8");
+                       switch_channel_set_variable(channel, "rtp_has_crypto", "AEAD_AES_256_GCM_8");
                }
                break;
 
-       case AES_GCM_128_8:
+       case AEAD_AES_128_GCM_8:
                crypto_policy_set_aes_gcm_128_8_auth(&policy->rtp);
                crypto_policy_set_aes_gcm_128_8_auth(&policy->rtcp);
 
                if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
-                       switch_channel_set_variable(channel, "rtp_has_crypto", "AES_GCM_128_8");
+                       switch_channel_set_variable(channel, "rtp_has_crypto", "AEAD_AES_128_GCM_8");
                }
                break;