diff options
author | rrs <rrs@FreeBSD.org> | 2007-03-31 11:47:30 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2007-03-31 11:47:30 +0000 |
commit | 9afebb96fc58efdcb69e55a2863d17e89d803dbe (patch) | |
tree | fc7c5aaca2d2ae2e7c1e6abe827b9f910acb9e6b /sys/netinet/sctp_auth.c | |
parent | 897ccc3f10f608b560a198d5f41a22991a08559f (diff) | |
download | FreeBSD-src-9afebb96fc58efdcb69e55a2863d17e89d803dbe.zip FreeBSD-src-9afebb96fc58efdcb69e55a2863d17e89d803dbe.tar.gz |
- Found bug in min split point bundling which caused
incorrect, non-bundlable fragmentation.
- Added min residual to better control split points for
both how big a msg must be as well as how much needs
to be left over.
- With our new algo in place, we need to implicitly
set "end of msg" on the sp-> structure otherwise we
end up with "hung" associations.
- Room reserved up front in IP header by pushing IP
header to back of mbuf.
- Fix so FR's peg count of retransmissions needed.
- Fix so an unlucky chunk that never gets across
will kill the assoc via the kill timer and send an
abort too.
- Fix bug in sctp_input which can result in a crash.
- Do not strip off IP options anymore.
- Clean up sctp_calculate_rto().
- Get rid of unused sysctl.
- Fixed so we discard all M-Cast
- Fixed so port check done AFTER checksum
- Fixed bug in fragmentation code that prevented
us from fragmenting a small complete message when
we needed to.
- Window probes were not marked back to unsent and
flight adjusted when a sack came in with no
window change or accepting of the probe data.
We now fix this with having a mark on the net and
the chunk so we can clear it out when the sack arrives
forcing it to retran just like it was "new" this
improves the handling of window probes, which were
dropped by the receiver.
- Tighten AUTH protocol error checks during INIT/INIT-ACK exchange
Diffstat (limited to 'sys/netinet/sctp_auth.c')
-rw-r--r-- | sys/netinet/sctp_auth.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c index 81973b7..999e877 100644 --- a/sys/netinet/sctp_auth.c +++ b/sys/netinet/sctp_auth.c @@ -1413,7 +1413,7 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m, struct sctp_paramhdr *phdr, tmp_param; uint16_t plen, ptype; uint8_t random_store[SCTP_PARAM_BUFFER_SIZE]; - struct sctp_auth_random *random = NULL; + struct sctp_auth_random *p_random = NULL; uint16_t random_len = 0; uint8_t hmacs_store[SCTP_PARAM_BUFFER_SIZE]; struct sctp_auth_hmac_algo *hmacs = NULL; @@ -1444,8 +1444,8 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m, if (phdr == NULL) return; /* save the random and length for the key */ - random = (struct sctp_auth_random *)phdr; - random_len = plen - sizeof(*random); + p_random = (struct sctp_auth_random *)phdr; + random_len = plen - sizeof(*p_random); } else if (ptype == SCTP_HMAC_LIST) { int num_hmacs; int i; @@ -1503,18 +1503,18 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m, new_key = sctp_alloc_key(keylen); if (new_key != NULL) { /* copy in the RANDOM */ - if (random != NULL) - bcopy(random->random_data, new_key->key, random_len); + if (p_random != NULL) + bcopy(p_random->random_data, new_key->key, random_len); } #else - keylen = sizeof(*random) + random_len + sizeof(*chunks) + num_chunks + + keylen = sizeof(*p_random) + random_len + sizeof(*chunks) + num_chunks + sizeof(*hmacs) + hmacs_len; new_key = sctp_alloc_key(keylen); if (new_key != NULL) { /* copy in the RANDOM */ - if (random != NULL) { - keylen = sizeof(*random) + random_len; - bcopy(random, new_key->key, keylen); + if (p_random != NULL) { + keylen = sizeof(*p_random) + random_len; + bcopy(p_random, new_key->key, keylen); } /* append in the AUTH chunks */ if (chunks != NULL) { @@ -1829,7 +1829,7 @@ sctp_validate_init_auth_params(struct mbuf *m, int offset, int limit) uint16_t ptype, plen; int peer_supports_asconf = 0; int peer_supports_auth = 0; - int got_random = 0, got_hmacs = 0; + int got_random = 0, got_hmacs = 0, got_chklist = 0; /* go through each of the params. */ phdr = sctp_get_next_param(m, offset, &parm_buf, sizeof(parm_buf)); @@ -1904,6 +1904,10 @@ sctp_validate_init_auth_params(struct mbuf *m, int offset, int limit) return (-1); } got_hmacs = 1; + } else if (ptype == SCTP_CHUNK_LIST) { + /* did the peer send a non-empty chunk list? */ + if (plen > 0) + got_chklist = 1; } offset += SCTP_SIZE32(plen); if (offset >= limit) { @@ -1918,6 +1922,13 @@ sctp_validate_init_auth_params(struct mbuf *m, int offset, int limit) } else { peer_supports_auth = 0; } + if (!peer_supports_auth && got_chklist) { +#ifdef SCTP_DEBUG + if (sctp_debug_on & SCTP_DEBUG_AUTH1) + printf("SCTP: peer sent chunk list w/o AUTH\n"); +#endif + return (-1); + } if (!sctp_asconf_auth_nochk && peer_supports_asconf && !peer_supports_auth) { #ifdef SCTP_DEBUG |