Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88306
b: refs/heads/master
c: 72da7b3
h: refs/heads/master
v: v3
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Apr 13, 2008
1 parent 694e937 commit 70935d7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e56cfad132f2ae269082359d279c17230c987e74
refs/heads/master: 72da7b3860cabf427590b4982bc880bafab4d5c8
29 changes: 26 additions & 3 deletions trunk/net/sctp/sm_make_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,10 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc,
struct sctp_chunk *chunk,
struct sctp_chunk **err_chunk)
{
struct sctp_hmac_algo_param *hmacs;
int retval = SCTP_IERROR_NO_ERROR;
__u16 n_elt, id = 0;
int i;

/* FIXME - This routine is not looking at each parameter per the
* chunk type, i.e., unrecognized parameters should be further
Expand Down Expand Up @@ -2056,9 +2059,29 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc,
break;

case SCTP_PARAM_HMAC_ALGO:
if (sctp_auth_enable)
break;
/* Fall Through */
if (!sctp_auth_enable)
goto fallthrough;

hmacs = (struct sctp_hmac_algo_param *)param.p;
n_elt = (ntohs(param.p->length) - sizeof(sctp_paramhdr_t)) >> 1;

/* SCTP-AUTH: Section 6.1
* The HMAC algorithm based on SHA-1 MUST be supported and
* included in the HMAC-ALGO parameter.
*/
for (i = 0; i < n_elt; i++) {
id = ntohs(hmacs->hmac_ids[i]);

if (id == SCTP_AUTH_HMAC_ID_SHA1)
break;
}

if (id != SCTP_AUTH_HMAC_ID_SHA1) {
sctp_process_inv_paramlength(asoc, param.p, chunk,
err_chunk);
retval = SCTP_IERROR_ABORT;
}
break;
fallthrough:
default:
SCTP_DEBUG_PRINTK("Unrecognized param: %d for chunk %d.\n",
Expand Down

0 comments on commit 70935d7

Please sign in to comment.