Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109290
b: refs/heads/master
c: d972405
h: refs/heads/master
v: v3
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Aug 27, 2008
1 parent 6a13798 commit 773230e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 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: 328fc47ea0bcc27d9afa69c3ad6e52431cadd76c
refs/heads/master: d97240552cd98c4b07322f30f66fd9c3ba4171de
3 changes: 3 additions & 0 deletions trunk/net/sctp/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,9 @@ int sctp_auth_ep_set_hmacs(struct sctp_endpoint *ep,
for (i = 0; i < hmacs->shmac_num_idents; i++) {
id = hmacs->shmac_idents[i];

if (id > SCTP_AUTH_HMAC_ID_MAX)
return -EOPNOTSUPP;

if (SCTP_AUTH_HMAC_ID_SHA1 == id)
has_sha1 = 1;

Expand Down
6 changes: 4 additions & 2 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -3086,6 +3086,7 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk,
int optlen)
{
struct sctp_hmacalgo *hmacs;
u32 idents;
int err;

if (!sctp_auth_enable)
Expand All @@ -3103,8 +3104,9 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk,
goto out;
}

if (hmacs->shmac_num_idents == 0 ||
hmacs->shmac_num_idents > SCTP_AUTH_NUM_HMACS) {
idents = hmacs->shmac_num_idents;
if (idents == 0 || idents > SCTP_AUTH_NUM_HMACS ||
(idents * sizeof(u16)) > (optlen - sizeof(struct sctp_hmacalgo))) {
err = -EINVAL;
goto out;
}
Expand Down

0 comments on commit 773230e

Please sign in to comment.