From: Alan T. DeKok Date: Mon, 30 Jul 2018 20:54:17 +0000 (-0400) Subject: verify client structure and secret X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ba0508eb0472ac5df4bb55219f08d790291336c;p=thirdparty%2Ffreeradius-server.git verify client structure and secret --- diff --git a/src/lib/server/client.c b/src/lib/server/client.c index f258d232194..dae220ce146 100644 --- a/src/lib/server/client.c +++ b/src/lib/server/client.c @@ -331,6 +331,9 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client) */ (void) talloc_steal(clients, client); /* reparent it */ + FR_STRUCT_MEMBER_SIGN(client, secret, talloc_array_length(client->secret)); + FR_STRUCT_SIGN(client); + return true; } @@ -408,6 +411,8 @@ RADCLIENT *client_find(RADCLIENT_LIST const *clients, fr_ipaddr_t const *ipaddr, fr_ipaddr_mask(&my_client.ipaddr, i); client = rbtree_finddata(clients->tree[i], &my_client); if (client) { + FR_STRUCT_MEMBER_VERIFY(client, secret, talloc_array_length(client->secret)); + FR_STRUCT_VERIFY(client); return client; } } diff --git a/src/lib/server/clients.h b/src/lib/server/clients.h index d0486a96ecd..1cf5a7fd5fa 100644 --- a/src/lib/server/clients.h +++ b/src/lib/server/clients.h @@ -80,6 +80,9 @@ typedef struct radclient { #ifdef WITH_TCP fr_socket_limit_t limit; //!< Connections per client (TCP clients only). #endif + + FR_STRUCT_MEMBER_SIGNATURE(secret) + FR_STRUCT_SIGNATURE } RADCLIENT; typedef struct radclient_list RADCLIENT_LIST;