]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-TNC: Add Flags field into fragment acknowledgement
authorJouni Malinen <j@w1.fi>
Sun, 14 Feb 2010 14:08:15 +0000 (16:08 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 14 Feb 2010 14:08:15 +0000 (16:08 +0200)
TNC IF-T is somewhat unclear on this are, but
draft-hanna-nea-pt-eap-00.txt, which is supposed to define the same
protocol, is clearer on the Flags field being included.

This change breaks interoperability with the old implementation if
EAP-TNC fragmentation is used. The old version would not accept
the acknowledgement message with the added Flags octet while the
new version accepts messagss with with both options.

src/eap_peer/eap_tnc.c
src/eap_server/eap_tnc.c

index 177d432c1c1cc7a2c56b3d438f21f44398c74371..6c95f72c15071b55af51bbb7b6ce1ef994d26317 100644 (file)
@@ -73,12 +73,13 @@ static struct wpabuf * eap_tnc_build_frag_ack(u8 id, u8 code)
 {
        struct wpabuf *msg;
 
-       msg = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_TNC, 0, code, id);
+       msg = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_TNC, 1, code, id);
        if (msg == NULL) {
                wpa_printf(MSG_ERROR, "EAP-TNC: Failed to allocate memory "
                           "for fragment ack");
                return NULL;
        }
+       wpabuf_put_u8(msg, EAP_TNC_VERSION); /* Flags */
 
        wpa_printf(MSG_DEBUG, "EAP-TNC: Send fragment ack");
 
index 4eddf8b25fd95090bfe94cde3cca972c2cf8bea8..b4fd49523cdc068f7a5b7095d1af4e09eec0af7d 100644 (file)
@@ -173,12 +173,13 @@ static struct wpabuf * eap_tnc_build_frag_ack(u8 id, u8 code)
 {
        struct wpabuf *msg;
 
-       msg = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_TNC, 0, code, id);
+       msg = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_TNC, 1, code, id);
        if (msg == NULL) {
                wpa_printf(MSG_ERROR, "EAP-TNC: Failed to allocate memory "
                           "for fragment ack");
                return NULL;
        }
+       wpabuf_put_u8(msg, EAP_TNC_VERSION); /* Flags */
 
        wpa_printf(MSG_DEBUG, "EAP-TNC: Send fragment ack");