Index: include/asterisk/sdp_srtp.h =================================================================== --- include/asterisk/sdp_srtp.h (revision 402525) +++ include/asterisk/sdp_srtp.h (working copy) @@ -43,6 +43,7 @@ #define AST_SRTP_CRYPTO_OFFER_OK (1 << 1) #define AST_SRTP_CRYPTO_TAG_32 (1 << 2) #define AST_SRTP_CRYPTO_TAG_80 (1 << 3) +#define AST_SRTP_CRYPTO_TAG_8 (1 << 4) /*! * \brief allocate a ast_sdp_srtp structure Index: include/asterisk/res_srtp.h =================================================================== --- include/asterisk/res_srtp.h (revision 402525) +++ include/asterisk/res_srtp.h (working copy) @@ -52,9 +52,10 @@ /* Crypto suites */ enum ast_srtp_suite { - AST_AES_CM_128_HMAC_SHA1_80 = 1, - AST_AES_CM_128_HMAC_SHA1_32 = 2, - AST_F8_128_HMAC_SHA1_80 = 3 + AST_AEAD_AES_GCM_128_8 = 1, + AST_AES_CM_128_HMAC_SHA1_80 = 2, + AST_AES_CM_128_HMAC_SHA1_32 = 3, + AST_F8_128_HMAC_SHA1_80 = 4 }; struct ast_srtp_policy_res { Index: res/res_srtp.c =================================================================== --- res/res_srtp.c (revision 402525) +++ res/res_srtp.c (working copy) @@ -251,6 +251,15 @@ static int policy_set_suite(crypto_policy_t *p, enum ast_srtp_suite suite) { switch (suite) { + case AST_AEAD_AES_GCM_128_8: + p->cipher_type = AES_128_GCM; + p->cipher_key_len = 30; + p->auth_type = NULL_AUTH; + p->auth_key_len = 0; + p->auth_tag_len = 8; + p->sec_serv = sec_serv_conf_and_auth; + return 0; + case AST_AES_CM_128_HMAC_SHA1_80: p->cipher_type = AES_128_ICM; p->cipher_key_len = 30; Index: main/sdp_srtp.c =================================================================== --- main/sdp_srtp.c (revision 402525) +++ main/sdp_srtp.c (working copy) @@ -241,7 +241,11 @@ return -1; } - if (!strcmp(suite, "AES_CM_128_HMAC_SHA1_80")) { + if (!strcmp(suite, "AEAD_AES_GCM_128_8")) { + suite_val = AST_AEAD_AES_GCM_128_8; + ast_set_flag(srtp, AST_SRTP_CRYPTO_TAG_8); + taglen = 8; + } else if (!strcmp(suite, "AES_CM_128_HMAC_SHA1_80")) { suite_val = AST_AES_CM_128_HMAC_SHA1_80; ast_set_flag(srtp, AST_SRTP_CRYPTO_TAG_80); taglen = 80; @@ -321,10 +325,18 @@ ast_free(p->a_crypto); } - if (ast_asprintf(&p->a_crypto, "%s AES_CM_128_HMAC_SHA1_%i inline:%s", - p->tag ? p->tag : "1", taglen, p->local_key64) == -1) { - ast_log(LOG_ERROR, "Could not allocate memory for crypto line\n"); - return -1; + if (taglen == 8) { + if (ast_asprintf(&p->a_crypto, "%s AEAD_AES_GCM_128_%i inline:%s", + p->tag ? p->tag : "1", taglen, p->local_key64) == -1) { + ast_log(LOG_ERROR, "Could not allocate memory for crypto line\n"); + return -1; + } + } else { + if (ast_asprintf(&p->a_crypto, "%s AES_CM_128_HMAC_SHA1_%i inline:%s", + p->tag ? p->tag : "1", taglen, p->local_key64) == -1) { + ast_log(LOG_ERROR, "Could not allocate memory for crypto line\n"); + return -1; + } } ast_debug(1, "Crypto line: a=crypto:%s\n", p->a_crypto); @@ -351,7 +363,9 @@ } /* set the key length based on INVITE or settings */ - if (ast_test_flag(srtp, AST_SRTP_CRYPTO_TAG_80)) { + if (ast_test_flag(srtp, AST_SRTP_CRYPTO_TAG_8)) { + taglen = 8; + } else if (ast_test_flag(srtp, AST_SRTP_CRYPTO_TAG_80)) { taglen = 80; } else if (ast_test_flag(srtp, AST_SRTP_CRYPTO_TAG_32)) { taglen = 32;