[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130212143627.GA7849@hmsreliant.think-freely.org>
Date: Tue, 12 Feb 2013 09:36:27 -0500
From: Neil Horman <nhorman@...driver.com>
To: Daniel Borkmann <dborkman@...hat.com>
Cc: davem@...emloft.net, linux-sctp@...r.kernel.org,
netdev@...r.kernel.org, Vlad Yasevich <vyasevic@...hat.com>
Subject: Re: [PATCH net-next] net: sctp: remove unused multiple cookie keys
On Mon, Feb 11, 2013 at 03:50:07PM +0100, Daniel Borkmann wrote:
> Vlad says: The whole multiple cookie keys code is completely unused
> and has been all this time. Noone uses anything other then the
> secret_key[0] since there is no changeover support anywhere.
>
> Thus, for now clean up its left-over fragments.
>
> Cc: Vlad Yasevich <vyasevic@...hat.com>
> Signed-off-by: Daniel Borkmann <dborkman@...hat.com>
>
> /* Remove and free the port */
> if (sctp_sk(ep->base.sk)->bind_hash)
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index e1c5fc2..1063b83 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -1650,8 +1650,8 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
>
> /* Sign the message. */
> sg_init_one(&sg, &cookie->c, bodysize);
> - keylen = SCTP_SECRET_SIZE;
> - key = (char *)ep->secret_key[ep->current_key];
> + keylen = sizeof(ep->secret_key);
> + key = (char *) ep->secret_key;
You can drop the use of they local key variable entirely here.
crypto_hash_setkey takes a u8 * as a key parameter, so you can pass
ep->secret_key directly.
> desc.tfm = sctp_sk(ep->base.sk)->hmac;
> desc.flags = 0;
>
> @@ -1718,9 +1718,9 @@ struct sctp_association *sctp_unpack_cookie(
> goto no_hmac;
>
> /* Check the signature. */
> - keylen = SCTP_SECRET_SIZE;
> sg_init_one(&sg, bear_cookie, bodysize);
> - key = (char *)ep->secret_key[ep->current_key];
> + keylen = sizeof(ep->secret_key);
> + key = (char *) ep->secret_key;
Ditto the above.
Otherwise it looks good.
Neil
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists