]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sctp/sm_make_chunk.c
[SCTP]: sctp_unpack_cookie() fix
[linux-2.6-omap-h63xx.git] / net / sctp / sm_make_chunk.c
index 5e0de3c0eead5309e908ec7365e53d2dcf759932..2a8773691695243fe6b4901f4b3a7f3328b78665 100644 (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);