]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add tls flag to packets
authorAlan T. DeKok <aland@freeradius.org>
Fri, 16 Feb 2024 13:33:54 +0000 (08:33 -0500)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Mon, 8 Jul 2024 15:22:09 +0000 (16:22 +0100)
and set it for TLS transport send / receive.  This lets the
packet encoder and verification routines behave differently for
TLS and non-TLS transport

src/include/libradius.h
src/main/tls_listen.c

index 777927edb325aded5696ddfcb7fe732c91017c46..36fe87fc9e504eff66fc25e566545e9001cacf55 100644 (file)
@@ -410,6 +410,7 @@ typedef struct radius_packet {
 #ifdef WITH_RADIUSV11
        bool                    radiusv11;
 #endif
+       bool                    tls;            //!< uses secure transport
 } RADIUS_PACKET;
 
 typedef enum {
index 8c2d3db7fcc4ac015a3fb545e2783b42ca269239..3dc786bb55116986cfa682facdcc785ee5013102 100644 (file)
@@ -673,6 +673,7 @@ read_application_data:
 #ifdef WITH_RADIUSV11
        packet->radiusv11 = sock->radiusv11;
 #endif
+       packet->tls = true;
 
        if (!rad_packet_ok(packet, 0, NULL)) {
                if (DEBUG_ENABLED) ERROR("Receive - %s", fr_strerror());
@@ -1286,6 +1287,7 @@ int proxy_tls_recv(rad_listen_t *listener)
        }
 
 #endif
+       packet->tls = true;
 
        /*
         *      FIXME: Client MIB updates?
@@ -1373,6 +1375,7 @@ int proxy_tls_send(rad_listen_t *listener, REQUEST *request)
         *      if there's no packet, encode it here.
         */
        if (!request->proxy->data) {
+               request->reply->tls = true;
                request->proxy_listener->proxy_encode(request->proxy_listener,
                                                      request);
        }
@@ -1510,6 +1513,8 @@ int proxy_tls_send_reply(rad_listen_t *listener, REQUEST *request)
        if ((listener->status != RAD_LISTEN_STATUS_INIT &&
            (listener->status != RAD_LISTEN_STATUS_KNOWN))) return 0;
 
+       request->reply->tls = true;
+
        /*
         *      Pack the VPs
         */