]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
make it clear that Message-Authenticator is auto-added
authorAlan T. DeKok <aland@freeradius.org>
Fri, 20 Dec 2024 22:05:28 +0000 (17:05 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 20 Dec 2024 22:24:29 +0000 (17:24 -0500)
manual port of 04b4c655fd

src/protocols/radius/packet.c

index 36f4157935c9ca59455287814beeb6db9700f695..91b1f1b915013f9c3dee8ac29a69a99e4ac655ea 100644 (file)
@@ -486,12 +486,31 @@ void fr_radius_packet_header_log(fr_log_t const *log, fr_packet_t *packet, bool
 }
 
 /*
- *     Debug the packet header and all attributes
+ *     Debug the packet header and all attributes.  This function is only called by the client code.
  */
 void fr_radius_packet_log(fr_log_t const *log, fr_packet_t *packet, fr_pair_list_t *list, bool received)
 {
        fr_radius_packet_header_log(log, packet, received);
-       if (fr_debug_lvl >= L_DBG_LVL_1) fr_pair_list_log(log, 4, list);
+
+       if (!fr_debug_lvl) return;
+
+       /*
+        *      If we're auto-adding Message Authenticator, then print
+        *      out that we're auto-adding it.
+        */
+       if (!received) switch (packet->code) {
+       case FR_RADIUS_CODE_ACCESS_REQUEST:
+       case FR_RADIUS_CODE_STATUS_SERVER:
+               if (!fr_pair_find_by_da(list, NULL, attr_message_authenticator)) {
+                       fprintf(fr_log_fp, "\tMessage-Authenticator = 0x\n");
+               }
+               break;
+
+       default:
+               break;
+       }
+
+       fr_pair_list_log(log, 4, list);
 #ifndef NDEBUG
        if (fr_debug_lvl >= L_DBG_LVL_4) fr_packet_log_hex(log, packet);
 #endif