Skip to content

Commit

Permalink
enable AES-192 for SRTP enable AES-192 and AES-256 for SRTCP
Browse files Browse the repository at this point in the history
Apply pull request #170 on to master
  • Loading branch information
traud authored and pabuhler committed Feb 21, 2017
1 parent 29c6509 commit 4a74b82
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions srtp/srtp.c
Expand Up @@ -2039,7 +2039,8 @@ srtp_protect_mki(srtp_ctx_t *ctx, void *rtp_hdr, int *pkt_octet_len,
/*
* if we're using rindael counter mode, set nonce and seq
*/
if (session_keys->rtp_cipher->type->id == SRTP_AES_ICM ||
if (session_keys->rtp_cipher->type->id == SRTP_AES_128_ICM ||
session_keys->rtp_cipher->type->id == SRTP_AES_192_ICM ||
session_keys->rtp_cipher->type->id == SRTP_AES_256_ICM) {
v128_t iv;

Expand Down Expand Up @@ -2276,9 +2277,9 @@ srtp_unprotect_mki(srtp_ctx_t *ctx, void *srtp_hdr, int *pkt_octet_len,
* set the cipher's IV properly, depending on whatever cipher we
* happen to be using
*/
if (session_keys->rtp_cipher->type->id == SRTP_AES_ICM ||
if (session_keys->rtp_cipher->type->id == SRTP_AES_128_ICM ||
session_keys->rtp_cipher->type->id == SRTP_AES_192_ICM ||
session_keys->rtp_cipher->type->id == SRTP_AES_256_ICM) {

/* aes counter mode */
iv.v32[0] = 0;
iv.v32[1] = hdr->ssrc; /* still in network order */
Expand Down Expand Up @@ -3706,7 +3707,9 @@ srtp_protect_rtcp_mki(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len,
/*
* if we're using rindael counter mode, set nonce and seq
*/
if (session_keys->rtcp_cipher->type->id == SRTP_AES_ICM) {
if (session_keys->rtcp_cipher->type->id == SRTP_AES_128_ICM ||
session_keys->rtcp_cipher->type->id == SRTP_AES_192_ICM ||
session_keys->rtcp_cipher->type->id == SRTP_AES_256_ICM) {
v128_t iv;

iv.v32[0] = 0;
Expand Down Expand Up @@ -3963,7 +3966,9 @@ srtp_unprotect_rtcp_mki(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len,
/*
* if we're using aes counter mode, set nonce and seq
*/
if (session_keys->rtcp_cipher->type->id == SRTP_AES_ICM) {
if (session_keys->rtcp_cipher->type->id == SRTP_AES_128_ICM ||
session_keys->rtcp_cipher->type->id == SRTP_AES_192_ICM ||
session_keys->rtcp_cipher->type->id == SRTP_AES_256_ICM) {
v128_t iv;

iv.v32[0] = 0;
Expand Down

0 comments on commit 4a74b82

Please sign in to comment.