summaryrefslogtreecommitdiffstats
path: root/netwerk/sctp/src
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-05-06 10:54:14 +0000
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-05-06 19:03:23 +0200
commit1ed84ac1f81b096c10751d75edabc3e8e03f563a (patch)
tree07ceccc16e2caab41b4df65ef55b2c1e82f7b9b0 /netwerk/sctp/src
parent9c9d04e3e06fe63661be78fecc7d555a29a09085 (diff)
downloadUXP-1ed84ac1f81b096c10751d75edabc3e8e03f563a.tar
UXP-1ed84ac1f81b096c10751d75edabc3e8e03f563a.tar.gz
UXP-1ed84ac1f81b096c10751d75edabc3e8e03f563a.tar.lz
UXP-1ed84ac1f81b096c10751d75edabc3e8e03f563a.tar.xz
UXP-1ed84ac1f81b096c10751d75edabc3e8e03f563a.zip
[WebRTC] Port some upstream sctp fixes
- add SCTP auth token boundary check. - turn off SCTP auth and address reconfiguration.
Diffstat (limited to 'netwerk/sctp/src')
-rwxr-xr-xnetwerk/sctp/src/netinet/sctp_input.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/netwerk/sctp/src/netinet/sctp_input.c b/netwerk/sctp/src/netinet/sctp_input.c
index 54f2f9ba3..1301b430c 100755
--- a/netwerk/sctp/src/netinet/sctp_input.c
+++ b/netwerk/sctp/src/netinet/sctp_input.c
@@ -2073,7 +2073,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
int init_offset, initack_offset, initack_limit;
int retval;
int error = 0;
- uint8_t auth_chunk_buf[SCTP_PARAM_BUFFER_SIZE];
+ uint8_t auth_chunk_buf[SCTP_CHUNK_BUFFER_SIZE];
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
struct socket *so;
@@ -2264,8 +2264,12 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
if (auth_skipped) {
struct sctp_auth_chunk *auth;
- auth = (struct sctp_auth_chunk *)
- sctp_m_getptr(m, auth_offset, auth_len, auth_chunk_buf);
+ if (auth_len <= SCTP_CHUNK_BUFFER_SIZE) {
+ auth = (struct sctp_auth_chunk *)
+ sctp_m_getptr(m, auth_offset, auth_len, auth_chunk_buf);
+ } else {
+ auth = NULL;
+ }
if ((auth == NULL) || sctp_handle_auth(stcb, auth, m, auth_offset)) {
/* auth HMAC failed, dump the assoc and packet */
SCTPDBG(SCTP_DEBUG_AUTH1,
@@ -4655,11 +4659,15 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length,
if (auth_skipped && (stcb != NULL)) {
struct sctp_auth_chunk *auth;
- auth = (struct sctp_auth_chunk *)
- sctp_m_getptr(m, auth_offset,
+ if (auth_len <= SCTP_CHUNK_BUFFER_SIZE) {
+ auth = (struct sctp_auth_chunk *)
+ sctp_m_getptr(m, auth_offset,
auth_len, chunk_buf);
- got_auth = 1;
- auth_skipped = 0;
+ got_auth = 1;
+ auth_skipped = 0;
+ } else {
+ auth = NULL;
+ }
if ((auth == NULL) || sctp_handle_auth(stcb, auth, m,
auth_offset)) {
/* auth HMAC failed so dump it */