]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
verify client structure and secret
authorAlan T. DeKok <aland@freeradius.org>
Mon, 30 Jul 2018 20:54:17 +0000 (16:54 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 30 Jul 2018 20:58:48 +0000 (16:58 -0400)
src/lib/server/client.c
src/lib/server/clients.h

index f258d232194cb647d268a4676bde8be4636231ed..dae220ce1467add590aa4f35597a7905896ccaf5 100644 (file)
@@ -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;
                }
        }
index d0486a96ecd98bc7f874a6b93e092b1acea247ce..1cf5a7fd5fa0592f181d905eca99eeea9c0f1c53 100644 (file)
@@ -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;