]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rever TEAP related changes for TTLS
authorAlan T. DeKok <aland@freeradius.org>
Sat, 6 Jul 2024 14:01:18 +0000 (10:01 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 6 Jul 2024 14:01:18 +0000 (10:01 -0400)
Which broke some systems

src/modules/rlm_eap/libeap/eap_tls.c
src/modules/rlm_eap/libeap/eap_tls.h
src/modules/rlm_eap/types/rlm_eap_ttls/rlm_eap_ttls.c

index 424c4b5c0135ff2f36affd8fa56e75269441df9e..3a915bc624d69b99a180bc4a86bfb2d85704754c 100644 (file)
@@ -105,6 +105,28 @@ tls_session_t *eaptls_session(eap_handler_t *handler, fr_tls_server_conf_t *tls_
        return talloc_steal(handler, ssn); /* ssn */
 }
 
+/*
+   The S flag is set only within the EAP-TLS start message
+   sent from the EAP server to the peer.
+*/
+int eaptls_start(EAP_DS *eap_ds, int peap_flag)
+{
+       EAPTLS_PACKET   reply;
+
+       reply.code = FR_TLS_START;
+       reply.length = TLS_HEADER_LEN + 1/*flags*/;
+
+       reply.flags = peap_flag;
+       reply.flags = SET_START(reply.flags);
+
+       reply.data = NULL;
+       reply.dlen = 0;
+
+       eaptls_compose(eap_ds, &reply);
+
+       return 1;
+}
+
 /** Send an EAP-TLS success
  *
  * Composes an EAP-TLS-Success.  This is a message with code EAP_TLS_ESTABLISHED.
index 616265b6f6f02e62ffd447b3ab07e016a39cb1ca..1112bcbef39b0193bfca986004ef01df99d18621 100644 (file)
@@ -105,6 +105,7 @@ typedef struct tls_packet {
 EAPTLS_PACKET  *eaptls_alloc(void);
 void           eaptls_free(EAPTLS_PACKET **eaptls_packet_ptr);
 tls_session_t  *eaptls_session(eap_handler_t *handler, fr_tls_server_conf_t *tls_conf, bool client_cert, bool allow_tls13);
+int            eaptls_start(EAP_DS *eap_ds, int peap);
 int            eaptls_compose(EAP_DS *eap_ds, EAPTLS_PACKET *reply);
 
 fr_tls_server_conf_t *eaptls_conf_parse(CONF_SECTION *cs, char const *key);
index 035a1f6044ad121939682c237862515c0c794b05..9ce78430c523dd2b0fd63f2c15d97415ad3c07f0 100644 (file)
@@ -204,13 +204,7 @@ static int mod_session_init(void *type_arg, eap_handler_t *handler)
         *      TLS session initialization is over.  Now handle TLS
         *      related handshaking or application data.
         */
-       status = eaptls_request(handler->eap_ds, ssn, true);
-       if ((status == FR_TLS_INVALID) || (status == FR_TLS_FAIL)) {
-               REDEBUG("[eaptls start] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
-       } else {
-               RDEBUG3("[eaptls start] = %s", fr_int2str(fr_tls_status_table, status, "<INVALID>"));
-       }
-       if (status == 0) return 0;
+       eaptls_start(handler->eap_ds, ssn->peap_flag);
 
        /*
         *      The next stage to process the packet.