}
-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";
/* MS-Packet-Info */
wpabuf_put_u8(buf, SSOH_MS_PACKET_INFO);
- /* FIX: What is correct value here? IF-TNCCS-SOH v1.0 r8 claims this
- * field to be: Reserved(4 bits) r(1 bit) Vers(3 bits), but Windows XP
+ /* Note: IF-TNCCS-SOH v1.0 r8 claims this field to be:
+ * Reserved(4 bits) r(1 bit) Vers(3 bits), but Windows XP
* SP3 seems to be sending 0x11 for SSoH, i.e., r(request/response) bit
* would not be in the specified location.
+ * [MS-SOH] 4.0.2: Reserved(3 bits) r(1 bit) Vers(4 bits)
*/
wpabuf_put_u8(buf, 0x11); /* r=request, vers=1 */
wpabuf_put_be16(buf, 1); /* Flags: ExtState=0, f=0, qState=1 */
wpabuf_put_be32(buf, 0xffffffff); /* ProbTime (hi) */
wpabuf_put_be32(buf, 0xffffffff); /* ProbTime (lo) */
- wpabuf_put_be16(buf, 0); /* urlLenInBytes */
- /* followed by url */
+ wpabuf_put_be16(buf, 1); /* urlLenInBytes */
+ wpabuf_put_u8(buf, 0); /* null termination for the url */
/* MS-Machine-Inventory-Ex */
wpabuf_put_u8(buf, SSOH_MS_MACHINE_INVENTORY_EX);
}
-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;
wpa_printf(MSG_DEBUG, "TNC: SoH Request TLV received");
- return tncc_build_soh();
+ return tncc_build_soh(2);
}