net: sctp: remove unused multiple cookie keys
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: Neil Horman <nhorman@tuxdriver.com> Cc: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
0790bbb68f
commit
570617e79c
@@ -151,9 +151,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
|
||||
ep->rcvbuf_policy = net->sctp.rcvbuf_policy;
|
||||
|
||||
/* Initialize the secret key used with cookie. */
|
||||
get_random_bytes(&ep->secret_key[0], SCTP_SECRET_SIZE);
|
||||
ep->last_key = ep->current_key = 0;
|
||||
ep->key_changed_at = jiffies;
|
||||
get_random_bytes(ep->secret_key, sizeof(ep->secret_key));
|
||||
|
||||
/* SCTP-AUTH extensions*/
|
||||
INIT_LIST_HEAD(&ep->endpoint_shared_keys);
|
||||
@@ -249,8 +247,6 @@ void sctp_endpoint_free(struct sctp_endpoint *ep)
|
||||
/* Final destructor for endpoint. */
|
||||
static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
|
||||
{
|
||||
int i;
|
||||
|
||||
SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
|
||||
|
||||
/* Free up the HMAC transform. */
|
||||
@@ -273,8 +269,7 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep)
|
||||
sctp_inq_free(&ep->base.inqueue);
|
||||
sctp_bind_addr_free(&ep->base.bind_addr);
|
||||
|
||||
for (i = 0; i < SCTP_HOW_MANY_SECRETS; ++i)
|
||||
memset(&ep->secret_key[i], 0, SCTP_SECRET_SIZE);
|
||||
memset(ep->secret_key, 0, sizeof(ep->secret_key));
|
||||
|
||||
/* Remove and free the port */
|
||||
if (sctp_sk(ep->base.sk)->bind_hash)
|
||||
|
||||
Reference in New Issue
Block a user