]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Added option to force SoH version 1 (tnc=soh1)
authorJouni Malinen <j@w1.fi>
Sun, 7 Dec 2008 19:00:42 +0000 (21:00 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 7 Dec 2008 19:00:42 +0000 (21:00 +0200)
The default version with tnc=soh remains to be 2 which is the currently
recommended version in SoH specification.

src/eap_peer/eap_peap.c
src/eap_peer/tncc.c
src/eap_peer/tncc.h

index 392b36a996f4d983c6a84e87e5fb2b388194c715..f27049885c97ad284ec318139f8f718fabb53931 100644 (file)
@@ -119,9 +119,15 @@ static int eap_peap_parse_phase1(struct eap_peap_data *data,
        }
 
 #ifdef EAP_TNC
-       if (os_strstr(phase1, "tnc=soh")) {
+       if (os_strstr(phase1, "tnc=soh2")) {
+               data->soh = 2;
+               wpa_printf(MSG_DEBUG, "EAP-PEAP: SoH version 2 enabled");
+       } else if (os_strstr(phase1, "tnc=soh1")) {
                data->soh = 1;
-               wpa_printf(MSG_DEBUG, "EAP-PEAP: SoH enabled");
+               wpa_printf(MSG_DEBUG, "EAP-PEAP: SoH version 1 enabled");
+       } else if (os_strstr(phase1, "tnc=soh")) {
+               data->soh = 2;
+               wpa_printf(MSG_DEBUG, "EAP-PEAP: SoH version 2 enabled");
        }
 #endif /* EAP_TNC */
 
@@ -668,7 +674,8 @@ static int eap_peap_phase2_request(struct eap_sm *sm,
                                struct wpabuf *buf;
                                wpa_printf(MSG_DEBUG,
                                           "EAP-PEAP: SoH EAP Extensions");
-                               buf = tncc_process_soh_request(epos, eleft);
+                               buf = tncc_process_soh_request(data->soh,
+                                                              epos, eleft);
                                if (buf) {
                                        *resp = eap_msg_alloc(
                                                EAP_VENDOR_MICROSOFT, 0x21,
index 7e69f1337e465256c5a561733ddacae639d72441..662662d296ec91fa256c8606584517a3a5600611 100644 (file)
@@ -1218,12 +1218,11 @@ void tncc_deinit(struct tncc_data *tncc)
 }
 
 
-static struct wpabuf * tncc_build_soh(void)
+static struct wpabuf * tncc_build_soh(int ver)
 {
        struct wpabuf *buf;
        u8 *tlv_len, *tlv_len2, *outer_len, *inner_len, *ssoh_len, *end;
        u8 correlation_id[24];
-       int ver = 2;
        /* TODO: get correct name */
        char *machinename = "wpa_supplicant@w1.fi";
 
@@ -1332,7 +1331,7 @@ static struct wpabuf * tncc_build_soh(void)
 }
 
 
-struct wpabuf * tncc_process_soh_request(const u8 *data, size_t len)
+struct wpabuf * tncc_process_soh_request(int ver, const u8 *data, size_t len)
 {
        const u8 *pos;
 
@@ -1365,5 +1364,5 @@ struct wpabuf * tncc_process_soh_request(const u8 *data, size_t len)
 
        wpa_printf(MSG_DEBUG, "TNC: SoH Request TLV received");
 
-       return tncc_build_soh();
+       return tncc_build_soh(2);
 }
index 984721233cef6f7052c3df1e00db580dd2134fdd..4d42a05b9a0e201e834af3dccce09e74e5279f78 100644 (file)
@@ -37,6 +37,6 @@ enum tncc_process_res {
 enum tncc_process_res tncc_process_if_tnccs(struct tncc_data *tncc,
                                            const u8 *msg, size_t len);
 
-struct wpabuf * tncc_process_soh_request(const u8 *data, size_t len);
+struct wpabuf * tncc_process_soh_request(int ver, const u8 *data, size_t len);
 
 #endif /* TNCC_H */