Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Unified Diff: srtp/srtp/srtp.c

Issue 1607613003: Fix wrong endianness in RTCP tag calculation for AEAD/GCM. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libsrtp@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: srtp/srtp/srtp.c
diff --git a/srtp/srtp/srtp.c b/srtp/srtp/srtp.c
index f8e2fc43d35dfb8b624196aaba52de3dde52d5a0..eac2a8af432faf6d9c9cd2962c57f2079cd7024b 100644
--- a/srtp/srtp/srtp.c
+++ b/srtp/srtp/srtp.c
@@ -2378,9 +2378,9 @@ srtp_protect_rtcp_aead (srtp_t ctx, srtp_stream_ctx_t *stream,
}
}
/*
- * put the idx# into network byte order and process it as AAD
+ * Process the sequence# as AAD
*/
- tseq = htonl(*trailer);
+ tseq = *trailer;
status = cipher_set_aad(stream->rtcp_cipher, (uint8_t*)&tseq,
sizeof(srtcp_trailer_t));
if (status) {
@@ -2529,9 +2529,9 @@ srtp_unprotect_rtcp_aead (srtp_t ctx, srtp_stream_ctx_t *stream,
}
/*
- * put the idx# into network byte order, and process it as AAD
+ * Process the sequence# as AAD
*/
- tseq = htonl(*trailer);
+ tseq = *trailer;
status = cipher_set_aad(stream->rtcp_cipher, (uint8_t*)&tseq,
sizeof(srtcp_trailer_t));
if (status) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698