srtp: Allow zero as tag value for a sRTP Crypto Suite.

ASTERISK-25490 #close

Change-Id: I1c5fc0942c33c96d62b24203aad0f1e1a1a0131f
This commit is contained in:
Alexander Traud
2017-03-29 15:27:01 +02:00
parent 95c66234ba
commit ef19db9261

View File

@@ -238,8 +238,8 @@ int ast_sdp_crypto_process(struct ast_rtp_instance *rtp, struct ast_sdp_srtp *sr
return -1; return -1;
} }
/* RFC4568 9.1 - tag is 1-9 digits, greater than zero */ /* RFC4568 9.1 - tag is 1-9 digits */
if (sscanf(tag, "%30d", &crypto->tag) != 1 || crypto->tag <= 0 || crypto->tag > 999999999) { if (sscanf(tag, "%30d", &crypto->tag) != 1 || crypto->tag < 0 || crypto->tag > 999999999) {
ast_log(LOG_WARNING, "Unacceptable a=crypto tag: %s\n", tag); ast_log(LOG_WARNING, "Unacceptable a=crypto tag: %s\n", tag);
return -1; return -1;
} }