[SCTP]: sctp_unpack_cookie() fix

sizeof(pointer) != sizeof(array)...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Al Viro 2006-06-20 03:26:14 -07:00 committed by David S. Miller
parent 65fd28f743
commit 8ca84481b6
1 changed files with 2 additions and 2 deletions

View File

@ -1402,14 +1402,14 @@ struct sctp_association *sctp_unpack_cookie(
sg.length = bodysize;
key = (char *)ep->secret_key[ep->current_key];
memset(digest, 0x00, sizeof(digest));
memset(digest, 0x00, SCTP_SIGNATURE_SIZE);
sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, &sg,
1, digest);
if (memcmp(digest, cookie->signature, SCTP_SIGNATURE_SIZE)) {
/* Try the previous key. */
key = (char *)ep->secret_key[ep->last_key];
memset(digest, 0x00, sizeof(digest));
memset(digest, 0x00, SCTP_SIGNATURE_SIZE);
sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen,
&sg, 1, digest);