diff options
author | Martin Vopatek <vopatek@ingate.com> | 2018-03-07 15:51:34 +0100 |
---|---|---|
committer | Martin Vopatek <vopatek@ingate.com> | 2018-03-07 15:51:34 +0100 |
commit | ca8e9a5847eae33b27105020936ecc3d54c41f86 (patch) | |
tree | 2a3fa70e75f34f8694accb2cc5c74bc56637d20c /srtp | |
parent | 06a314e9511696e00fcdfba0e73a898cbcc7f8ae (diff) | |
download | libsrtp2-ca8e9a5847eae33b27105020936ecc3d54c41f86.tar.gz |
Fix unprotect when pktlen < (2*mki_size + tag_len)
The condition mki_start_location >= *mki_size in
srtp_get_session_keys() should use base_mki_start_location.
Now the condition is false for packets < 2*mki_size + tag_len.
But as of commit d4bd43c the correct condition is now checked
earlier so we simply remove the expression altogether.
Diffstat (limited to 'srtp')
-rw-r--r-- | srtp/srtp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/srtp/srtp.c b/srtp/srtp.c index 95d1483..a792a87 100644 --- a/srtp/srtp.c +++ b/srtp/srtp.c @@ -1563,9 +1563,8 @@ srtp_session_keys_t *srtp_get_session_keys(srtp_stream_ctx_t *stream, *mki_size = stream->session_keys[i].mki_size; mki_start_location = base_mki_start_location - *mki_size; - if (mki_start_location >= *mki_size && - memcmp(hdr + mki_start_location, stream->session_keys[i].mki_id, - *mki_size) == 0) { + if (memcmp(hdr + mki_start_location, + stream->session_keys[i].mki_id, *mki_size) == 0) { return &stream->session_keys[i]; } } |