mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
res_srtp: Set all possible flags while selecting the Crypto Suite.
The flags of a previous selection could have been set within the object 'srtp', for example, when the previous selection returned failure after setting just 'some' flags. Now, not to clutter the code, all possible flags are cleared first, and then the selected flags are set as before. ASTERISK-28903 Change-Id: I1b9d7aade7d5120244ce7e3a8865518cbd6e0eee
This commit is contained in:
committed by
Joshua Colp
parent
441b614fa0
commit
ab0ab19993
@@ -863,6 +863,14 @@ static int res_sdp_crypto_parse_offer(struct ast_rtp_instance *rtp, struct ast_s
|
||||
crypto->tag = tag_from_sdp;
|
||||
}
|
||||
|
||||
ast_clear_flag(srtp, AST_SRTP_CRYPTO_TAG_8);
|
||||
ast_clear_flag(srtp, AST_SRTP_CRYPTO_TAG_16);
|
||||
ast_clear_flag(srtp, AST_SRTP_CRYPTO_TAG_32);
|
||||
ast_clear_flag(srtp, AST_SRTP_CRYPTO_TAG_80);
|
||||
ast_clear_flag(srtp, AST_SRTP_CRYPTO_AES_192);
|
||||
ast_clear_flag(srtp, AST_SRTP_CRYPTO_AES_256);
|
||||
ast_clear_flag(srtp, AST_SRTP_CRYPTO_OLD_NAME);
|
||||
|
||||
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);
|
||||
|
Reference in New Issue
Block a user