Coverage Report

Created: 2026-05-14 06:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-wps.c
Line
Count
Source
1
/* packet-wps.c
2
 *
3
 * Wifi Simple Config aka Wifi Protected Setup
4
 *
5
 * Written by Jens Braeuer using WiFi-Alliance Spec 1.0h and
6
 * parts of a patch by JP Jiang and Philippe Teuwen. November 2007
7
 *
8
 * Spec:
9
 * https://www.wi-fi.org/knowledge_center_overview.php?type=4
10
 * Patch:
11
 * http://wireshark.digimirror.nl/lists/wireshark-dev/200703/msg00121.html
12
 *
13
 * Copyright 2007 Jens Braeuer <jensb@cs.tu-berlin.de>
14
 *
15
 * Wireshark - Network traffic analyzer
16
 * By Gerald Combs <gerald@wireshark.org>
17
 * Copyright 1998 Gerald Combs
18
 *
19
 * SPDX-License-Identifier: GPL-2.0-or-later
20
 *
21
 */
22
23
#include "config.h"
24
25
#include <epan/packet.h>
26
#include <epan/expert.h>
27
#include <epan/sminmpec.h>
28
#include <epan/tfs.h>
29
#include <wsutil/array.h>
30
31
#include "packet-wps.h"
32
#include "packet-ieee80211.h"
33
34
void proto_register_wps(void);
35
void proto_reg_handoff_wps(void);
36
37
static int  hf_eapwps_opcode;
38
static int  hf_eapwps_flags;
39
static int  hf_eapwps_flag_mf;
40
static int  hf_eapwps_flag_lf;
41
static int  hf_eapwps_msglen;
42
43
static int ett_eap_wps_attr;
44
static int ett_eap_wps_flags;
45
46
static expert_field ei_eapwps_packet_too_short;
47
static expert_field ei_eapwps_fmt_warn_too_long;
48
static expert_field ei_eapwps_fmt_length_warn;
49
50
static dissector_handle_t wps_handle;
51
52
/* OPCodes */
53
#define OPC_WSC_START    0x01   /* WPS OPCODE WSC_Start */
54
#define OPC_WSC_ACK      0x02   /* WPS OPCODE WSC_ACK */
55
#define OPC_WSC_NACK     0x03   /* WPS OPCODE WSC_NACK */
56
#define OPC_WSC_MSG      0x04   /* WPS OPCODE WSC_MSG */
57
#define OPC_WSC_DONE     0x05   /* WPS OPCODE WSC_Done */
58
#define OPC_WSC_FRAG_ACK 0x06   /* WPS OPCODE WSC_FRAG_ACK */
59
60
static const value_string eapwps_opcode_vals[] = {
61
  { OPC_WSC_START,    "WSC Start"},
62
  { OPC_WSC_ACK,      "WSC Ack"},
63
  { OPC_WSC_NACK,     "WSC Nack" },
64
  { OPC_WSC_MSG,      "WSC Msg" },
65
  { OPC_WSC_DONE,     "WSC Done" },
66
  { OPC_WSC_FRAG_ACK, "WSC Frag Ack" },
67
  { 0, NULL }
68
};
69
70
/*  Flag-Field masks  */
71
15
#define MASK_WSC_FLAG_MF   0x01 /* WPS Flag more frag */
72
15
#define MASK_WSC_FLAG_LF   0x02 /* WPS flag length field */
73
74
0
#define WPS_TLV_TYPE_AP_CHANNEL                         0x1001
75
0
#define WPS_TLV_TYPE_ASSOCIATION_STATE                  0x1002
76
0
#define WPS_TLV_TYPE_AUTHENTICATION_TYPE                0x1003
77
0
#define WPS_TLV_TYPE_AUTHENTICATION_TYPE_FLAGS          0x1004
78
0
#define WPS_TLV_TYPE_AUTHENTICATOR                      0x1005
79
0
#define WPS_TLV_TYPE_CONFIG_METHODS                     0x1008
80
0
#define WPS_TLV_TYPE_CONFIGURATION_ERROR                0x1009
81
0
#define WPS_TLV_TYPE_CONFIRMATION_URL4                  0x100a
82
0
#define WPS_TLV_TYPE_CONFIRMATION_URL6                  0x100b
83
0
#define WPS_TLV_TYPE_CONNECTION_TYPE                    0x100c
84
0
#define WPS_TLV_TYPE_CONNECTION_TYPE_FLAGS              0x100d
85
0
#define WPS_TLV_TYPE_CREDENTIAL                         0x100e
86
0
#define WPS_TLV_TYPE_DEVICE_NAME                        0x1011
87
0
#define WPS_TLV_TYPE_DEVICE_PASSWORD_ID                 0x1012
88
0
#define WPS_TLV_TYPE_E_HASH1                            0X1014
89
0
#define WPS_TLV_TYPE_E_HASH2                            0x1015
90
0
#define WPS_TLV_TYPE_E_SNONCE1                          0x1016
91
0
#define WPS_TLV_TYPE_E_SNONCE2                          0x1017
92
0
#define WPS_TLV_TYPE_ENCRYPTED_SETTINGS                 0x1018
93
0
#define WPS_TLV_TYPE_ENCRYPTION_TYPE                    0x100f
94
1
#define WPS_TLV_TYPE_ENCRYPTION_TYPE_FLAGS              0x1010
95
0
#define WPS_TLV_TYPE_ENROLLEE_NONCE                     0x101a
96
0
#define WPS_TLV_TYPE_FEATURE_ID                         0x101b
97
0
#define WPS_TLV_TYPE_IDENTITY                           0x101c
98
0
#define WPS_TLV_TYPE_IDENTITY_PROOF                     0x101d
99
0
#define WPS_TLV_TYPE_KEY_WRAP_AUTHENTICATOR             0x101e
100
0
#define WPS_TLV_TYPE_KEY_IDENTIFIER                     0x101f
101
0
#define WPS_TLV_TYPE_MAC_ADDRESS                        0x1020
102
0
#define WPS_TLV_TYPE_MANUFACTURER                       0x1021
103
0
#define WPS_TLV_TYPE_MESSAGE_TYPE                       0x1022
104
0
#define WPS_TLV_TYPE_MODEL_NAME                         0x1023
105
0
#define WPS_TLV_TYPE_MODEL_NUMBER                       0x1024
106
0
#define WPS_TLV_TYPE_NETWORK_INDEX                      0x1026
107
0
#define WPS_TLV_TYPE_NETWORK_KEY                        0x1027
108
0
#define WPS_TLV_TYPE_NETWORK_KEY_INDEX                  0x1028
109
0
#define WPS_TLV_TYPE_NEW_DEVICE_NAME                    0x1029
110
0
#define WPS_TLV_TYPE_NEW_PASSWORD                       0x102a
111
0
#define WPS_TLV_TYPE_OOB_DEVICE_PASSWORD                0x102c
112
0
#define WPS_TLV_TYPE_OS_VERSION                         0x102d
113
0
#define WPS_TLV_TYPE_POWER_LEVEL                        0x102f
114
0
#define WPS_TLV_TYPE_PSK_CURRENT                        0x1030
115
0
#define WPS_TLV_TYPE_PSK_MAX                            0x1031
116
0
#define WPS_TLV_TYPE_PUBLIC_KEY                         0x1032
117
0
#define WPS_TLV_TYPE_RADIO_ENABLED                      0x1033
118
0
#define WPS_TLV_TYPE_REBOOT                             0x1034
119
0
#define WPS_TLV_TYPE_REGISTRAR_CURRENT                  0x1035
120
0
#define WPS_TLV_TYPE_REGISTRAR_ESTABLISHED              0x1036
121
0
#define WPS_TLV_TYPE_REGISTRAR_LIST                     0x1037
122
0
#define WPS_TLV_TYPE_REGISTRAR_MAX                      0x1038
123
0
#define WPS_TLV_TYPE_REGISTRAR_NONCE                    0x1039
124
0
#define WPS_TLV_TYPE_REQUEST_TYPE                       0x103a
125
0
#define WPS_TLV_TYPE_RESPONSE_TYPE                      0x103b
126
0
#define WPS_TLV_TYPE_RF_BANDS                           0x103c
127
0
#define WPS_TLV_TYPE_R_HASH1                            0x103d
128
0
#define WPS_TLV_TYPE_R_HASH2                            0x103e
129
0
#define WPS_TLV_TYPE_R_SNONCE1                          0x103f
130
0
#define WPS_TLV_TYPE_R_SNONCE2                          0x1040
131
0
#define WPS_TLV_TYPE_SELECTED_REGISTRAR                 0x1041
132
0
#define WPS_TLV_TYPE_SERIAL_NUMBER                      0x1042
133
0
#define WPS_TLV_TYPE_WIFI_PROTECTED_SETUP_STATE         0x1044
134
0
#define WPS_TLV_TYPE_SSID                               0x1045
135
0
#define WPS_TLV_TYPE_TOTAL_NETWORKS                     0x1046
136
0
#define WPS_TLV_TYPE_UUID_E                             0x1047
137
0
#define WPS_TLV_TYPE_UUID_R                             0x1048
138
26
#define WPS_TLV_TYPE_VENDOR_EXTENSION                   0x1049
139
0
#define WPS_TLV_TYPE_VERSION                            0x104a
140
0
#define WPS_TLV_TYPE_X509_CERTIFICATE_REQUEST           0x104b
141
0
#define WPS_TLV_TYPE_X509_CERTIFICATE                   0x104c
142
0
#define WPS_TLV_TYPE_EAP_IDENTITY                       0x104d
143
0
#define WPS_TLV_TYPE_MESSAGE_COUNTER                    0x104e
144
0
#define WPS_TLV_TYPE_PUBLIC_KEY_HASH                    0x104f
145
0
#define WPS_TLV_TYPE_REKEY_KEY                          0x1050
146
0
#define WPS_TLV_TYPE_KEY_LIFETIME                       0x1051
147
0
#define WPS_TLV_TYPE_PERMITTED_CONFIG_METHODS           0x1052
148
0
#define WPS_TLV_TYPE_SELECTED_REGISTRAR_CONFIG_METHODS  0x1053
149
0
#define WPS_TLV_TYPE_PRIMARY_DEVICE_TYPE                0x1054
150
0
#define WPS_TLV_TYPE_SECONDARY_DEVICE_TYPE_LIST         0x1055
151
0
#define WPS_TLV_TYPE_PORTABLE_DEVICE                    0x1056
152
0
#define WPS_TLV_TYPE_AP_SETUP_LOCKED                    0x1057
153
0
#define WPS_TLV_TYPE_APPLICATION_EXTENSION              0x1058
154
0
#define WPS_TLV_TYPE_EAP_TYPE                           0x1059
155
0
#define WPS_TLV_TYPE_INITIALIZATION_VECTOR              0x1060
156
0
#define WPS_TLV_TYPE_KEY_PROVIDED_AUTOMATICALLY         0x1061
157
0
#define WPS_TLV_TYPE_8021X_ENABLED                      0x1062
158
0
#define WPS_TLV_TYPE_APPSESSIONKEY                      0x1063
159
0
#define WPS_TLV_TYPE_WEPTRANSMITKEY                     0x1064
160
0
#define WPS_TLV_TYPE_REQUESTED_DEV_TYPE                 0x106a
161
162
163
static const value_string eapwps_tlv_types[] = {
164
  { WPS_TLV_TYPE_AP_CHANNEL,                        "AP Channel" },
165
  { WPS_TLV_TYPE_ASSOCIATION_STATE,                 "Association State" },
166
  { WPS_TLV_TYPE_AUTHENTICATION_TYPE,               "Authentication Type" },
167
  { WPS_TLV_TYPE_AUTHENTICATION_TYPE_FLAGS,         "Authentication Type Flags" },
168
  { WPS_TLV_TYPE_AUTHENTICATOR,                     "Authenticator" },
169
  { WPS_TLV_TYPE_CONFIG_METHODS,                    "Config Methods" },
170
  { WPS_TLV_TYPE_CONFIGURATION_ERROR,               "Configuration Error" },
171
  { WPS_TLV_TYPE_CONFIRMATION_URL4,                 "Confirmation URL4" },
172
  { WPS_TLV_TYPE_CONFIRMATION_URL6,                 "Confirmation URL6" },
173
  { WPS_TLV_TYPE_CONNECTION_TYPE,                   "Connection Type" },
174
  { WPS_TLV_TYPE_CONNECTION_TYPE_FLAGS,             "Connection Type Flags" },
175
  { WPS_TLV_TYPE_CREDENTIAL,                        "Credential" },
176
  { WPS_TLV_TYPE_DEVICE_NAME,                       "Device Name" },
177
  { WPS_TLV_TYPE_DEVICE_PASSWORD_ID,                "Device Password ID" },
178
  { WPS_TLV_TYPE_E_HASH1,                           "E Hash1" },
179
  { WPS_TLV_TYPE_E_HASH2,                           "E Hash2" },
180
  { WPS_TLV_TYPE_E_SNONCE1,                         "E SNonce1" },
181
  { WPS_TLV_TYPE_E_SNONCE2,                         "E SNonce2" },
182
  { WPS_TLV_TYPE_ENCRYPTED_SETTINGS,                "Encrypted Settings" },
183
  { WPS_TLV_TYPE_ENCRYPTION_TYPE,                   "Encryption Type" },
184
  { WPS_TLV_TYPE_ENCRYPTION_TYPE_FLAGS,             "Encryption Type Flags" },
185
  { WPS_TLV_TYPE_ENROLLEE_NONCE,                    "Enrollee Nonce" },
186
  { WPS_TLV_TYPE_FEATURE_ID,                        "Feature Id" },
187
  { WPS_TLV_TYPE_IDENTITY,                          "Identity" },
188
  { WPS_TLV_TYPE_IDENTITY_PROOF,                    "Identity Proof" },
189
  { WPS_TLV_TYPE_KEY_WRAP_AUTHENTICATOR,            "Key Wrap Authenticator" },
190
  { WPS_TLV_TYPE_KEY_IDENTIFIER,                    "Key Identifier" },
191
  { WPS_TLV_TYPE_MAC_ADDRESS,                       "MAC Address" },
192
  { WPS_TLV_TYPE_MANUFACTURER,                      "Manufacturer" },
193
  { WPS_TLV_TYPE_MESSAGE_TYPE,                      "Message Type" },
194
  { WPS_TLV_TYPE_MODEL_NAME,                        "Model Name" },
195
  { WPS_TLV_TYPE_MODEL_NUMBER,                      "Model Number" },
196
  { WPS_TLV_TYPE_NETWORK_INDEX,                     "Network Index" },
197
  { WPS_TLV_TYPE_NETWORK_KEY,                       "Network Key" },
198
  { WPS_TLV_TYPE_NETWORK_KEY_INDEX,                 "Network Key Index" },
199
  { WPS_TLV_TYPE_NEW_DEVICE_NAME,                   "New Device Name" },
200
  { WPS_TLV_TYPE_NEW_PASSWORD,                      "New Password" },
201
  { WPS_TLV_TYPE_OOB_DEVICE_PASSWORD,               "OOB Device Password" },
202
  { WPS_TLV_TYPE_OS_VERSION,                        "OS Version" },
203
  { WPS_TLV_TYPE_POWER_LEVEL,                       "Power Level" },
204
  { WPS_TLV_TYPE_PSK_CURRENT,                       "PSK Current" },
205
  { WPS_TLV_TYPE_PSK_MAX,                           "PSK Max" },
206
  { WPS_TLV_TYPE_PUBLIC_KEY,                        "Public Key" },
207
  { WPS_TLV_TYPE_RADIO_ENABLED,                     "Radio Enabled" },
208
  { WPS_TLV_TYPE_REBOOT,                            "Reboot" },
209
  { WPS_TLV_TYPE_REGISTRAR_CURRENT,                 "Registrar Current" },
210
  { WPS_TLV_TYPE_REGISTRAR_ESTABLISHED,             "Registrar Established" },
211
  { WPS_TLV_TYPE_REGISTRAR_LIST,                    "Registrar List" },
212
  { WPS_TLV_TYPE_REGISTRAR_MAX,                     "registrar_max" },
213
  { WPS_TLV_TYPE_REGISTRAR_NONCE,                   "Registrar Nonce" },
214
  { WPS_TLV_TYPE_REQUEST_TYPE,                      "Request Type" },
215
  { WPS_TLV_TYPE_RESPONSE_TYPE,                     "Response Type" },
216
  { WPS_TLV_TYPE_RF_BANDS,                          "RF Bands" },
217
  { WPS_TLV_TYPE_R_HASH1,                           "R Hash1" },
218
  { WPS_TLV_TYPE_R_HASH2,                           "R Hash2" },
219
  { WPS_TLV_TYPE_R_SNONCE1,                         "R Snonce1" },
220
  { WPS_TLV_TYPE_R_SNONCE2,                         "R Snonce2" },
221
  { WPS_TLV_TYPE_SELECTED_REGISTRAR,                "Selected Registrar" },
222
  { WPS_TLV_TYPE_SERIAL_NUMBER,                     "Serial Number" },
223
  { WPS_TLV_TYPE_WIFI_PROTECTED_SETUP_STATE,        "Wifi Protected Setup State" },
224
  { WPS_TLV_TYPE_SSID,                              "SSID" },
225
  { WPS_TLV_TYPE_TOTAL_NETWORKS,                    "Total Networks" },
226
  { WPS_TLV_TYPE_UUID_E,                            "UUID E" },
227
  { WPS_TLV_TYPE_UUID_R,                            "UUID R" },
228
  { WPS_TLV_TYPE_VENDOR_EXTENSION,                  "Vendor Extension" },
229
  { WPS_TLV_TYPE_VERSION,                           "Version" },
230
  { WPS_TLV_TYPE_X509_CERTIFICATE_REQUEST,          "X509 Certificate Request" },
231
  { WPS_TLV_TYPE_X509_CERTIFICATE,                  "X509 Certificate" },
232
  { WPS_TLV_TYPE_EAP_IDENTITY,                      "EAP Identity" },
233
  { WPS_TLV_TYPE_MESSAGE_COUNTER,                   "Message Counter" },
234
  { WPS_TLV_TYPE_PUBLIC_KEY_HASH,                   "Public Key Hash" },
235
  { WPS_TLV_TYPE_REKEY_KEY,                         "Rekey Key" },
236
  { WPS_TLV_TYPE_KEY_LIFETIME,                      "Key Lifetime" },
237
  { WPS_TLV_TYPE_PERMITTED_CONFIG_METHODS,          "Permitted Config Methods" },
238
  { WPS_TLV_TYPE_SELECTED_REGISTRAR_CONFIG_METHODS, "Selected Registrar Config Methods" },
239
  { WPS_TLV_TYPE_PRIMARY_DEVICE_TYPE,               "Primary Device Type" },
240
  { WPS_TLV_TYPE_SECONDARY_DEVICE_TYPE_LIST,        "Secondary Device Type List" },
241
  { WPS_TLV_TYPE_PORTABLE_DEVICE,                   "Portable Device" },
242
  { WPS_TLV_TYPE_AP_SETUP_LOCKED,                   "Ap Setup Locked" },
243
  { WPS_TLV_TYPE_APPLICATION_EXTENSION,             "Application Extension" },
244
  { WPS_TLV_TYPE_EAP_TYPE,                          "EAP Type" },
245
  { WPS_TLV_TYPE_INITIALIZATION_VECTOR,             "Initialization Vector" },
246
  { WPS_TLV_TYPE_KEY_PROVIDED_AUTOMATICALLY,        "Key Provided Automatically" },
247
  { WPS_TLV_TYPE_8021X_ENABLED,                     "8021x Enabled" },
248
  { WPS_TLV_TYPE_APPSESSIONKEY,                     "AppSessionKey" },
249
  { WPS_TLV_TYPE_WEPTRANSMITKEY,                    "WEPTransmitKey" },
250
  { WPS_TLV_TYPE_REQUESTED_DEV_TYPE,                "Requested Device Type" },
251
  { 0, NULL }
252
};
253
254
255
/* WFA Vendor Extension */
256
257
0
#define WPS_WFA_EXT_VERSION2              0x00
258
0
#define WPS_WFA_EXT_AUTHORIZEDMACS        0x01
259
0
#define WPS_WFA_EXT_NETWORK_KEY_SHAREABLE 0x02
260
0
#define WPS_WFA_EXT_REQUEST_TO_ENROLL     0x03
261
0
#define WPS_WFA_EXT_SETTINGS_DELAY_TIME   0x04
262
#define WPS_WFA_EXT_REG_CFG_METHODS       0x05
263
0
#define WPS_WFA_EXT_MULTI_AP              0x06
264
0
#define WPS_WFA_EXT_MULTI_AP_PROFILE      0x07
265
0
#define WPS_WFA_EXT_MULTI_AP_8021Q        0x08
266
267
268
static const value_string eapwps_wfa_ext_types[] = {
269
  { WPS_WFA_EXT_VERSION2,              "Version2" },
270
  { WPS_WFA_EXT_AUTHORIZEDMACS,        "AuthorizedMACs" },
271
  { WPS_WFA_EXT_NETWORK_KEY_SHAREABLE, "Network Key Shareable" },
272
  { WPS_WFA_EXT_REQUEST_TO_ENROLL,     "Request to Enroll" },
273
  { WPS_WFA_EXT_SETTINGS_DELAY_TIME,   "Settings Delay Time" },
274
  { WPS_WFA_EXT_REG_CFG_METHODS,       "Register configuration methods" },
275
  { WPS_WFA_EXT_MULTI_AP,              "Multi-AP Extension" },
276
  { WPS_WFA_EXT_MULTI_AP_PROFILE,      "Multi-AP Profile" },
277
  { WPS_WFA_EXT_MULTI_AP_8021Q,        "Multi-AP Profile 8021Q Settings" },
278
  { 0, NULL }
279
};
280
281
static const value_string wps_wfa_ext_multi_ap_profiles_vals[] = {
282
  { 0x01, "Multi-AP Profile-1" },
283
  { 0x02, "Multi-AP Profile-2" },
284
  { 0x03, "Multi-AP Profile-3" },
285
  { 0, NULL }
286
};
287
0
#define WFA_OUI             0x0050F204
288
289
static int proto_wps;
290
291
static int hf_eapwps_tlv_type;
292
static int hf_eapwps_tlv_len;
293
294
static int hf_eapwps_tlv_ap_channel;
295
static int hf_eapwps_tlv_association_state;
296
static int hf_eapwps_tlv_authentication_type;
297
static int hf_eapwps_tlv_authentication_type_flags;
298
static int hf_eapwps_tlv_authentication_type_flags_open;
299
static int hf_eapwps_tlv_authentication_type_flags_wpapsk;
300
static int hf_eapwps_tlv_authentication_type_flags_shared;
301
static int hf_eapwps_tlv_authentication_type_flags_wpa;
302
static int hf_eapwps_tlv_authentication_type_flags_wpa2;
303
static int hf_eapwps_tlv_authentication_type_flags_wpa2psk;
304
static int hf_eapwps_tlv_authenticator;
305
static int hf_eapwps_tlv_config_methods;
306
static int hf_eapwps_tlv_config_methods_usba;
307
static int hf_eapwps_tlv_config_methods_ethernet;
308
static int hf_eapwps_tlv_config_methods_label;
309
static int hf_eapwps_tlv_config_methods_display;
310
static int hf_eapwps_tlv_config_methods_phy_display;
311
static int hf_eapwps_tlv_config_methods_virt_display;
312
static int hf_eapwps_tlv_config_methods_nfcext;
313
static int hf_eapwps_tlv_config_methods_nfcint;
314
static int hf_eapwps_tlv_config_methods_nfcinf;
315
static int hf_eapwps_tlv_config_methods_pushbutton;
316
static int hf_eapwps_tlv_config_methods_phy_pushbutton;
317
static int hf_eapwps_tlv_config_methods_virt_pushbutton;
318
static int hf_eapwps_tlv_config_methods_keypad;
319
static int hf_eapwps_tlv_configuration_error;
320
static int hf_eapwps_tlv_confirmation_url4;
321
static int hf_eapwps_tlv_confirmation_url6;
322
static int hf_eapwps_tlv_connection_type;
323
static int hf_eapwps_tlv_connection_type_flags;
324
static int hf_eapwps_tlv_connection_type_flags_ess;
325
static int hf_eapwps_tlv_connection_type_flags_ibss;
326
static int hf_eapwps_tlv_credential;
327
static int hf_eapwps_tlv_device_name;
328
static int hf_eapwps_tlv_device_password_id;
329
static int hf_eapwps_tlv_e_hash1;
330
static int hf_eapwps_tlv_e_hash2;
331
static int hf_eapwps_tlv_e_snonce1;
332
static int hf_eapwps_tlv_e_snonce2;
333
static int hf_eapwps_tlv_encrypted_settings;
334
static int hf_eapwps_tlv_encryption_type;
335
static int hf_eapwps_tlv_encryption_type_flags;
336
static int hf_eapwps_tlv_encryption_type_flags_none;
337
static int hf_eapwps_tlv_encryption_type_flags_wep;
338
static int hf_eapwps_tlv_encryption_type_flags_tkip;
339
static int hf_eapwps_tlv_encryption_type_flags_aes;
340
static int hf_eapwps_tlv_enrollee_nonce;
341
static int hf_eapwps_tlv_feature_id;
342
static int hf_eapwps_tlv_identity;
343
static int hf_eapwps_tlv_identity_proof;
344
static int hf_eapwps_tlv_key_wrap_authenticator;
345
static int hf_eapwps_tlv_key_identifier;
346
static int hf_eapwps_tlv_mac_address;
347
static int hf_eapwps_tlv_manufacturer;
348
static int hf_eapwps_tlv_message_type;
349
static int hf_eapwps_tlv_model_name;
350
static int hf_eapwps_tlv_model_number;
351
static int hf_eapwps_tlv_network_index;
352
static int hf_eapwps_tlv_network_key;
353
static int hf_eapwps_tlv_network_key_index;
354
static int hf_eapwps_tlv_new_device_name;
355
static int hf_eapwps_tlv_new_password;
356
static int hf_eapwps_tlv_oob_device_password;
357
static int hf_eapwps_tlv_os_version;
358
static int hf_eapwps_tlv_power_level;
359
static int hf_eapwps_tlv_psk_current;
360
static int hf_eapwps_tlv_psk_max;
361
static int hf_eapwps_tlv_public_key;
362
static int hf_eapwps_tlv_radio_enabled;
363
static int hf_eapwps_tlv_reboot;
364
static int hf_eapwps_tlv_registrar_current;
365
static int hf_eapwps_tlv_registrar_established;
366
static int hf_eapwps_tlv_registrar_list;
367
static int hf_eapwps_tlv_registrar_max;
368
static int hf_eapwps_tlv_registrar_nonce;
369
static int hf_eapwps_tlv_request_type;
370
static int hf_eapwps_tlv_response_type;
371
static int hf_eapwps_tlv_rf_bands;
372
static int hf_eapwps_tlv_r_hash1;
373
static int hf_eapwps_tlv_r_hash2;
374
static int hf_eapwps_tlv_r_snonce1;
375
static int hf_eapwps_tlv_r_snonce2;
376
static int hf_eapwps_tlv_selected_registrar;
377
static int hf_eapwps_tlv_serial_number;
378
static int hf_eapwps_tlv_wifi_protected_setup_state;
379
static int hf_eapwps_tlv_ssid;
380
static int hf_eapwps_tlv_total_networks;
381
static int hf_eapwps_tlv_uuid_e;
382
static int hf_eapwps_tlv_uuid_r;
383
static int hf_eapwps_tlv_vendor_extension;
384
static int hf_eapwps_tlv_version;
385
static int hf_eapwps_tlv_x509_certificate_request;
386
static int hf_eapwps_tlv_x509_certificate;
387
static int hf_eapwps_tlv_eap_identity;
388
static int hf_eapwps_tlv_message_counter;
389
static int hf_eapwps_tlv_public_key_hash;
390
static int hf_eapwps_tlv_rekey_key;
391
static int hf_eapwps_tlv_key_lifetime;
392
static int hf_eapwps_tlv_permitted_config_methods;
393
static int hf_eapwps_tlv_permitted_config_methods_usba;
394
static int hf_eapwps_tlv_permitted_config_methods_ethernet;
395
static int hf_eapwps_tlv_permitted_config_methods_label;
396
static int hf_eapwps_tlv_permitted_config_methods_display;
397
static int hf_eapwps_tlv_permitted_config_methods_phy_display;
398
static int hf_eapwps_tlv_permitted_config_methods_virt_display;
399
static int hf_eapwps_tlv_permitted_config_methods_nfcext;
400
static int hf_eapwps_tlv_permitted_config_methods_nfcint;
401
static int hf_eapwps_tlv_permitted_config_methods_nfcinf;
402
static int hf_eapwps_tlv_permitted_config_methods_pushbutton;
403
static int hf_eapwps_tlv_permitted_config_methods_phy_pushbutton;
404
static int hf_eapwps_tlv_permitted_config_methods_virt_pushbutton;
405
static int hf_eapwps_tlv_permitted_config_methods_keypad;
406
static int hf_eapwps_tlv_selected_registrar_config_methods;
407
static int hf_eapwps_tlv_selected_registrar_config_methods_usba;
408
static int hf_eapwps_tlv_selected_registrar_config_methods_ethernet;
409
static int hf_eapwps_tlv_selected_registrar_config_methods_label;
410
static int hf_eapwps_tlv_selected_registrar_config_methods_display;
411
static int hf_eapwps_tlv_selected_registrar_config_methods_phy_display;
412
static int hf_eapwps_tlv_selected_registrar_config_methods_virt_display;
413
static int hf_eapwps_tlv_selected_registrar_config_methods_nfcext;
414
static int hf_eapwps_tlv_selected_registrar_config_methods_nfcint;
415
static int hf_eapwps_tlv_selected_registrar_config_methods_nfcinf;
416
static int hf_eapwps_tlv_selected_registrar_config_methods_pushbutton;
417
static int hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton;
418
static int hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton;
419
static int hf_eapwps_tlv_selected_registrar_config_methods_keypad;
420
static int hf_eapwps_tlv_primary_device_type;
421
static int hf_eapwps_tlv_primary_device_type_category;
422
0
#define WPS_DEVICE_TYPE_CATEGORY_MAX 11
423
static int hf_eapwps_tlv_primary_device_type_subcategory[WPS_DEVICE_TYPE_CATEGORY_MAX];
424
static int hf_eapwps_tlv_secondary_device_type_list;
425
static int hf_eapwps_tlv_portable_device;
426
static int hf_eapwps_tlv_ap_setup_locked;
427
static int hf_eapwps_tlv_application_extension;
428
static int hf_eapwps_tlv_eap_type;
429
static int hf_eapwps_tlv_initialization_vector;
430
static int hf_eapwps_tlv_key_provided_automatically;
431
static int hf_eapwps_tlv_8021x_enabled;
432
static int hf_eapwps_tlv_appsessionkey;
433
static int hf_eapwps_tlv_weptransmitkey;
434
static int hf_eapwps_tlv_requested_dev_type;
435
436
static int hf_eapwps_vendor_id;
437
static int hf_eapwps_wfa_ext_id;
438
static int hf_eapwps_wfa_ext_len;
439
440
static int hf_eapwps_wfa_ext_version2;
441
static int hf_eapwps_wfa_ext_authorizedmacs;
442
static int hf_eapwps_wfa_ext_network_key_shareable;
443
static int hf_eapwps_wfa_ext_request_to_enroll;
444
static int hf_eapwps_wfa_ext_settings_delay_time;
445
static int hf_multi_ap_backhaul_sta;
446
static int hf_multi_ap_backhaul_bss;
447
static int hf_multi_ap_fronthaul_bss;
448
static int hf_multi_ap_teardown_bsses;
449
static int hf_multi_ap_profile1_backhaul_sta_assoc_disallowed;
450
static int hf_multi_ap_profile2_backhaul_sta_assoc_disallowed;
451
static int hf_multi_ap_reserved;
452
static int hf_multi_ap_flags;
453
static int hf_multi_ap_profiles;
454
static int hf_multi_ap_8021q;
455
456
static int ett_wps_tlv;
457
static int ett_eap_wps_ap_channel;
458
static int ett_eap_wps_association_state;
459
static int ett_eap_wps_authentication_type;
460
static int ett_eap_wps_authentication_type_flags;
461
static int ett_eap_wps_authenticator;
462
static int ett_eap_wps_config_methods;
463
static int ett_eap_wps_configuration_error;
464
static int ett_eap_wps_confirmation_url4;
465
static int ett_eap_wps_confirmation_url6;
466
static int ett_eap_wps_connection_type;
467
static int ett_eap_wps_connection_type_flags;
468
static int ett_eap_wps_credential;
469
static int ett_eap_wps_device_name;
470
static int ett_eap_wps_device_password_id;
471
static int ett_eap_wps_e_hash1;
472
static int ett_eap_wps_e_hash2;
473
static int ett_eap_wps_e_snonce1;
474
static int ett_eap_wps_e_snonce2;
475
static int ett_eap_wps_encrypted_settings;
476
static int ett_eap_wps_encryption_type;
477
static int ett_eap_wps_encryption_type_flags;
478
static int ett_eap_wps_enrollee_nonce;
479
static int ett_eap_wps_feature_id;
480
static int ett_eap_wps_identity;
481
static int ett_eap_wps_identity_proof;
482
static int ett_eap_wps_key_wrap_authenticator;
483
static int ett_eap_wps_key_identifier;
484
static int ett_eap_wps_mac_address;
485
static int ett_eap_wps_manufacturer;
486
static int ett_eap_wps_message_type;
487
static int ett_eap_wps_model_name;
488
static int ett_eap_wps_model_number;
489
static int ett_eap_wps_network_index;
490
static int ett_eap_wps_network_key;
491
static int ett_eap_wps_network_key_index;
492
static int ett_eap_wps_new_device_name;
493
static int ett_eap_wps_new_password;
494
static int ett_eap_wps_oob_device_password;
495
static int ett_eap_wps_os_version;
496
static int ett_eap_wps_power_level;
497
static int ett_eap_wps_psk_current;
498
static int ett_eap_wps_psk_max;
499
static int ett_eap_wps_public_key;
500
static int ett_eap_wps_radio_enabled;
501
static int ett_eap_wps_reboot;
502
static int ett_eap_wps_registrar_current;
503
static int ett_eap_wps_registrar_established;
504
static int ett_eap_wps_registrar_list;
505
static int ett_eap_wps_registrar_max;
506
static int ett_eap_wps_registrar_nonce;
507
static int ett_eap_wps_request_type;
508
static int ett_eap_wps_response_type;
509
static int ett_eap_wps_rf_bands;
510
static int ett_eap_wps_r_hash1;
511
static int ett_eap_wps_r_hash2;
512
static int ett_eap_wps_r_snonce1;
513
static int ett_eap_wps_r_snonce2;
514
static int ett_eap_wps_selected_registrar;
515
static int ett_eap_wps_serial_number;
516
static int ett_eap_wps_wifi_protected_setup_state;
517
static int ett_eap_wps_ssid;
518
static int ett_eap_wps_total_networks;
519
static int ett_eap_wps_uuid_e;
520
static int ett_eap_wps_uuid_r;
521
static int ett_eap_wps_vendor_extension;
522
static int ett_eap_wps_version;
523
static int ett_eap_wps_x509_certificate_request;
524
static int ett_eap_wps_x509_certificate;
525
static int ett_eap_wps_eap_identity;
526
static int ett_eap_wps_message_counter;
527
static int ett_eap_wps_public_key_hash;
528
static int ett_eap_wps_rekey_key;
529
static int ett_eap_wps_key_lifetime;
530
static int ett_eap_wps_permitted_config_methods;
531
static int ett_eap_wps_selected_registrar_config_methods;
532
static int ett_eap_wps_primary_device_type;
533
static int ett_eap_wps_secondary_device_type_list;
534
static int ett_eap_wps_portable_device;
535
static int ett_eap_wps_ap_setup_locked;
536
static int ett_eap_wps_application_extension;
537
static int ett_eap_wps_eap_type;
538
static int ett_eap_wps_initialization_vector;
539
static int ett_eap_wps_key_provided_automatically;
540
static int ett_eap_wps_8021x_enabled;
541
static int ett_eap_wps_appsessionkey;
542
static int ett_eap_wps_weptransmitkey;
543
static int ett_wps_wfa_ext;
544
static int ett_multi_ap_flags;
545
546
static const value_string eapwps_tlv_association_state_vals[] = {
547
  { 0, "Not associated" },
548
  { 1, "Connection success" },
549
  { 2, "Configuration Failure" },
550
  { 3, "Association Failure" },
551
  { 4, "IP Failure" },
552
  { 0, NULL }
553
};
554
555
15
#define EAPWPS_AUTHTYPE_OPEN    0x01
556
15
#define EAPWPS_AUTHTYPE_WPAPSK  0x02
557
15
#define EAPWPS_AUTHTYPE_SHARED  0x04
558
15
#define EAPWPS_AUTHTYPE_WPA     0x08
559
15
#define EAPWPS_AUTHTYPE_WPA2    0x10
560
15
#define EAPWPS_AUTHTYPE_WPA2PSK 0x20
561
562
static const value_string eapwps_tlv_authentication_type_vals[] = {
563
  { EAPWPS_AUTHTYPE_OPEN,    "Open" },
564
  { EAPWPS_AUTHTYPE_WPAPSK,  "WPA PSK" },
565
  { EAPWPS_AUTHTYPE_SHARED,  "Shared" },
566
  { EAPWPS_AUTHTYPE_WPA,     "WPA" },
567
  { EAPWPS_AUTHTYPE_WPA2,    "WPA2" },
568
  { EAPWPS_AUTHTYPE_WPA2PSK, "WPA2 PSK" },
569
  { 0, NULL }
570
};
571
572
45
#define EAPWPS_CONFMETH_USBA             0x0001
573
45
#define EAPWPS_CONFMETH_ETHERNET         0x0002
574
45
#define EAPWPS_CONFMETH_LABEL            0x0004
575
45
#define EAPWPS_CONFMETH_DISPLAY          0x0008
576
45
#define EAPWPS_CONFMETH_VIRT_DISPLAY     0x2000
577
45
#define EAPWPS_CONFMETH_PHY_DISPLAY      0x4000
578
45
#define EAPWPS_CONFMETH_NFCEXT           0x0010
579
45
#define EAPWPS_CONFMETH_NFCINT           0x0020
580
45
#define EAPWPS_CONFMETH_NFCINF           0x0040
581
45
#define EAPWPS_CONFMETH_PUSHBUTTON       0x0080
582
45
#define EAPWPS_CONFMETH_VIRT_PUSHBUTTON  0x0200
583
45
#define EAPWPS_CONFMETH_PHY_PUSHBUTTON   0x0400
584
45
#define EAPWPS_CONFMETH_KEYPAD           0x0100
585
586
static const value_string eapwps_tlv_configuration_error_vals[] = {
587
  {  0, "No Error" },
588
  {  1, "OOB Interface Read Error" },
589
  {  2, "Decryption CRC Failure" },
590
  {  3, "2.4 channel not supported" },
591
  {  4, "5.0 channel not supported" },
592
  {  5, "Signal too weak" },
593
  {  6, "Network auth failure" },
594
  {  7, "Network association failure" },
595
  {  8, "No DHCP response" },
596
  {  9, "Failed DHCP config" },
597
  { 10, "IP address conflict" },
598
  { 11, "Couldn't connect to Registrar" },
599
  { 12, "Multiple PBC sessions detected" },
600
  { 13, "Rogue activity suspected" },
601
  { 14, "Device busy" },
602
  { 15, "Setup locked" },
603
  { 16, "Message Timeout" },
604
  { 17, "Registration Session Timeout" },
605
  { 18, "Device Password Auth Failure" },
606
  { 0, NULL }
607
};
608
609
15
#define EAPWPS_CONNTYPE_ESS  0x1
610
15
#define EAPWPS_CONNTYPE_IBSS 0x2
611
612
static const value_string eapwps_tlv_connection_type_vals[] = {
613
  { EAPWPS_CONNTYPE_ESS,  "ESS" },
614
  { EAPWPS_CONNTYPE_IBSS, "IBSS" },
615
  { 0, NULL}
616
};
617
618
#define EAPWPS_DEVPW_PIN 0x0
619
#define EAPWPS_DEVPW_USER 0x1
620
#define EAPWPS_DEVPW_MACHINE 0x2
621
#define EAPWPS_DEVPW_REKEY 0x3
622
#define EAPWPS_DEVPW_PUSHBUTTON 0x4
623
#define EAPWPS_DEVPW_REGISTRAR 0x5
624
625
static const value_string eapwps_tlv_device_password_id_vals[] = {
626
  { EAPWPS_DEVPW_PIN,        "PIN (default)" },
627
  { EAPWPS_DEVPW_USER,       "User specified" },
628
  { EAPWPS_DEVPW_MACHINE,    "Machine specified" },
629
  { EAPWPS_DEVPW_REKEY,      "Rekey" },
630
  { EAPWPS_DEVPW_PUSHBUTTON, "PushButton" },
631
  { EAPWPS_DEVPW_REGISTRAR,  "Registrar specified" },
632
  { 0, NULL }
633
};
634
635
15
#define EAPWPS_ENCTYPE_NONE 0x1
636
15
#define EAPWPS_ENCTYPE_WEP  0x2
637
15
#define EAPWPS_ENCTYPE_TKIP 0x4
638
15
#define EAPWPS_ENCTYPE_AES  0x8
639
640
static const value_string eapwps_tlv_encryption_type_vals[] = {
641
  { EAPWPS_ENCTYPE_NONE, "none" },
642
  { EAPWPS_ENCTYPE_WEP,  "WEP" },
643
  { EAPWPS_ENCTYPE_TKIP, "TKIP" },
644
  { EAPWPS_ENCTYPE_AES,  "AES" },
645
  { 0, NULL }
646
};
647
648
static const value_string eapwps_tlv_message_type_vals[] = {
649
  { 0x01, "Beacon" },
650
  { 0x02, "Probe Request" },
651
  { 0x03, "Probe Response" },
652
  { 0x04, "M1" },
653
  { 0x05, "M2" },
654
  { 0x06, "M2D" },
655
  { 0x07, "M3" },
656
  { 0x08, "M4" },
657
  { 0x09, "M5" },
658
  { 0x0A, "M6" },
659
  { 0x0B, "M7" },
660
  { 0x0C, "M8" },
661
  { 0x0D, "WSC_ACK" },
662
  { 0x0E, "WSC_NACK" },
663
  { 0x0F, "WSC_DONE" },
664
  { 0, NULL }
665
};
666
667
668
static const value_string eapwps_tlv_request_type_vals[] = {
669
  { 0x00, "Enrollee, Info only" },
670
  { 0x01, "Enrollee, open 802.1X" },
671
  { 0x02, "Registrar" },
672
  { 0x03, "WLAN Manager Registrar" },
673
  { 0, NULL }
674
};
675
676
static const value_string eapwps_tlv_response_type_vals[] = {
677
  { 0x00, "Enrollee, Info only" },
678
  { 0x01, "Enrollee, open 802.1X" },
679
  { 0x02, "Registrar" },
680
  { 0x03, "AP" },
681
  { 0, NULL }
682
};
683
684
static const value_string eapwps_tlv_rf_bands_vals[] = {
685
  { 0x01, "2.4 GHz" },
686
  { 0x02, "5 GHz" },
687
  { 0x03, "2.4 and 5 GHz" },
688
  { 0, NULL }
689
};
690
691
static const value_string eapwps_tlv_wifi_protected_setup_state[] = {
692
  { 0x00, "Reserved" },
693
  { 0x01, "Not configured" },
694
  { 0x02, "Configured" },
695
  { 0, NULL }
696
};
697
698
static const value_string eapwps_tlv_primary_device_type_category[] = {
699
  { 0x01, "Computer" },
700
  { 0x02, "Input Device" },
701
  { 0x03, "Printers, Scanners, Faxes and Copiers" },
702
  { 0x04, "Camera" },
703
  { 0x05, "Storage" },
704
  { 0x06, "Network Infrastructure" },
705
  { 0x07, "Displays" },
706
  { 0x08, "Multimedia Devices" },
707
  { 0x09, "Gaming Devices" },
708
  { 0x0A, "Telephone" },
709
  { 0x0B, "Audio Devices" },
710
  { 0, NULL }
711
};
712
713
static const value_string eapwps_tlv_computer_subcategory[] = {
714
  { 0x01, "PC" },
715
  { 0x02, "Server" },
716
  { 0x03, "Media Center" },
717
  { 0x04, "Ultra-mobile PC" },
718
  { 0x05, "Notebook" },
719
  { 0x06, "Desktop" },
720
  { 0x07, "MID (Mobile Internet Device)" },
721
  { 0x08, "Netbook" },
722
  { 0, NULL }
723
};
724
725
static const value_string eapwps_tlv_input_device_subcategory[] = {
726
  { 0x01, "Keyboard" },
727
  { 0x02, "Mouse" },
728
  { 0x03, "Joystick" },
729
  { 0x04, "Trackball" },
730
  { 0x05, "Gaming controller" },
731
  { 0x06, "Remote" },
732
  { 0x07, "Touchscreen" },
733
  { 0x08, "Biometric reader" },
734
  { 0x09, "Barcode reader" },
735
  { 0, NULL }
736
};
737
738
static const value_string eapwps_tlv_printers_scanners_faxes_copiers_subcategory[] = {
739
  { 0x01, "Printer or Print Server" },
740
  { 0x02, "Scanner" },
741
  { 0x03, "Fax" },
742
  { 0x04, "Copier" },
743
  { 0x05, "All-in-one (Printer, Scanner, Fax, Copier)" },
744
  { 0, NULL }
745
};
746
747
static const value_string eapwps_tlv_camera_subcategory[] = {
748
  { 0x01, "Digital Still Camera" },
749
  { 0x02, "Video Camera" },
750
  { 0x03, "Web Camera" },
751
  { 0x04, "Security Camera" },
752
  { 0, NULL }
753
};
754
755
static const value_string eapwps_tlv_storage_subcategory[] = {
756
  { 0x01, "NAS" },
757
  { 0, NULL }
758
};
759
760
static const value_string eapwps_tlv_network_infrastructure_subcategory[] = {
761
  { 0x01, "AP" },
762
  { 0x02, "Router" },
763
  { 0x03, "Switch" },
764
  { 0x04, "Gateway" },
765
  { 0x05, "Bridge" },
766
  { 0, NULL }
767
};
768
769
static const value_string eapwps_tlv_displays_subcategory[] = {
770
  { 0x01, "Television" },
771
  { 0x02, "Electronic Picture Frame" },
772
  { 0x03, "Projector" },
773
  { 0x04, "Monitor" },
774
  { 0, NULL }
775
};
776
777
static const value_string eapwps_tlv_multimedia_devices_subcategory[] = {
778
  { 0x01, "DAR" },
779
  { 0x02, "PVR" },
780
  { 0x03, "MCX" },
781
  { 0x04, "Set-top box" },
782
  { 0x05, "Media Server/Media Adapter/Media Extender" },
783
  { 0x06, "Portable Video Player" },
784
  { 0, NULL }
785
};
786
787
static const value_string eapwps_tlv_gaming_devices_subcategory[] = {
788
  { 0x01, "Xbox" },
789
  { 0x02, "Xbox360" },
790
  { 0x03, "Playstation" },
791
  { 0x04, "Game Console/Game Console Adapter" },
792
  { 0x05, "Portable Gaming Device" },
793
  { 0, NULL }
794
};
795
796
static const value_string eapwps_tlv_telephone_subcategory[] = {
797
  { 0x01, "Windows Mobile" },
798
  { 0x02, "Phone - single mode" },
799
  { 0x03, "Phone - dual mode" },
800
  { 0x04, "Smartphone - single mode" },
801
  { 0x05, "Smartphone - dual mode" },
802
  { 0, NULL }
803
};
804
805
static const value_string eapwps_tlv_audio_devices_subcategory[] = {
806
  { 0x01, "Audio tuner/receiver" },
807
  { 0x02, "Speakers" },
808
  { 0x03, "Portable Music Player (PMP)" },
809
  { 0x04, "Headset (headphones + microphone)" },
810
  { 0x05, "Headphones" },
811
  { 0x06, "Microphone" },
812
  { 0x07, "Home Theater Systems" },
813
  { 0, NULL }
814
};
815
816
817
static void
818
add_wps_wfa_ext(uint8_t id, proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
819
                int offset, int size)
820
0
{
821
0
  proto_item *item;
822
0
  proto_tree *elem;
823
0
  uint8_t     val8;
824
0
  static int * const flags[] = {
825
0
    &hf_multi_ap_backhaul_sta,
826
0
    &hf_multi_ap_backhaul_bss,
827
0
    &hf_multi_ap_fronthaul_bss,
828
0
    &hf_multi_ap_teardown_bsses,
829
0
    &hf_multi_ap_profile1_backhaul_sta_assoc_disallowed,
830
0
    &hf_multi_ap_profile2_backhaul_sta_assoc_disallowed,
831
0
    &hf_multi_ap_reserved,
832
0
    NULL
833
0
  };
834
835
0
  elem = proto_tree_add_subtree(tree, tvb, offset - 2, 2 + size, ett_wps_wfa_ext, &item,
836
0
                             val_to_str(pinfo->pool, id, eapwps_wfa_ext_types, "Unknown (%u)"));
837
0
  proto_tree_add_item(elem, hf_eapwps_wfa_ext_id,  tvb, offset - 2, 1, ENC_BIG_ENDIAN);
838
0
  proto_tree_add_item(elem, hf_eapwps_wfa_ext_len, tvb, offset - 1, 1, ENC_BIG_ENDIAN);
839
840
0
  switch (id) {
841
0
  case WPS_WFA_EXT_VERSION2:
842
0
    val8 = tvb_get_uint8(tvb, offset);
843
0
    proto_item_append_text(item, ": %d.%d", val8 >> 4, val8 & 0x0f);
844
0
    proto_tree_add_item(elem, hf_eapwps_wfa_ext_version2, tvb,
845
0
                        offset, 1, ENC_BIG_ENDIAN);
846
0
    break;
847
0
  case WPS_WFA_EXT_AUTHORIZEDMACS:
848
0
    proto_tree_add_item(elem, hf_eapwps_wfa_ext_authorizedmacs,
849
0
                        tvb, offset, size, ENC_NA);
850
0
    break;
851
0
  case WPS_WFA_EXT_NETWORK_KEY_SHAREABLE:
852
0
    val8 = tvb_get_uint8(tvb, offset);
853
0
    proto_item_append_text(item, ": %s", val8 ? "TRUE" : "FALSE");
854
0
    proto_tree_add_item(elem, hf_eapwps_wfa_ext_network_key_shareable,
855
0
                        tvb, offset, 1, ENC_BIG_ENDIAN);
856
0
    break;
857
0
  case WPS_WFA_EXT_REQUEST_TO_ENROLL:
858
0
    val8 = tvb_get_uint8(tvb, offset);
859
0
    proto_item_append_text(item, ": %s", val8 ? "TRUE" : "FALSE");
860
0
    proto_tree_add_item(elem, hf_eapwps_wfa_ext_request_to_enroll,
861
0
                        tvb, offset, 1, ENC_BIG_ENDIAN);
862
0
    break;
863
0
  case WPS_WFA_EXT_SETTINGS_DELAY_TIME:
864
0
    val8 = tvb_get_uint8(tvb, offset);
865
0
    proto_item_append_text(item, ": %d second(s)", val8);
866
0
    proto_tree_add_item(elem, hf_eapwps_wfa_ext_settings_delay_time,
867
0
                        tvb, offset, 1, ENC_BIG_ENDIAN);
868
0
    break;
869
0
  case WPS_WFA_EXT_MULTI_AP:
870
0
    proto_tree_add_bitmask(elem, tvb, offset, hf_multi_ap_flags, ett_multi_ap_flags,
871
0
                           flags, ENC_NA);
872
0
    offset++;
873
0
    break;
874
0
  case WPS_WFA_EXT_MULTI_AP_PROFILE:
875
0
    proto_tree_add_item(elem, hf_multi_ap_profiles, tvb, offset, 1,
876
0
                                                    ENC_BIG_ENDIAN);
877
0
    break;
878
0
  case WPS_WFA_EXT_MULTI_AP_8021Q:
879
0
    proto_tree_add_item(elem, hf_multi_ap_8021q, tvb, offset, 2,
880
0
                                                ENC_LITTLE_ENDIAN);
881
0
    break;
882
0
  default:
883
0
    break;
884
0
  }
885
0
}
886
887
static void
888
dissect_wps_wfa_ext(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
889
                    int offset, int size)
890
0
{
891
0
  int    pos = offset;
892
0
  int    end = offset + size;
893
0
  uint8_t id, len;
894
895
0
  while (pos + 2 < end) {
896
0
    id = tvb_get_uint8(tvb, pos);
897
0
    len = tvb_get_uint8(tvb, pos + 1);
898
0
    if ((pos + 2 + len) > end)
899
0
      break;
900
0
    pos += 2;
901
0
    add_wps_wfa_ext(id, tree, pinfo, tvb, pos, len);
902
0
    pos += len;
903
0
  }
904
0
}
905
906
static int
907
dissect_wps_wfa_ext_via_dt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
908
        void *data _U_)
909
0
{
910
0
  int size = tvb_reported_length(tvb);
911
912
0
  dissect_wps_wfa_ext(tree, pinfo, tvb, 0, size);
913
914
0
  return size;
915
0
}
916
917
static void
918
dissect_wps_vendor_ext(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
919
                       int offset, int size)
920
0
{
921
0
  uint32_t vendor_id;
922
923
0
  if (size < 3)
924
0
    return;
925
0
  vendor_id = tvb_get_ntoh24(tvb, offset);
926
0
  proto_tree_add_item(tree, hf_eapwps_vendor_id, tvb, offset, 3, ENC_BIG_ENDIAN);
927
0
  if (vendor_id == VENDOR_WIFI_ALLIANCE)
928
0
    dissect_wps_wfa_ext(tree, pinfo, tvb, offset + 3, size - 3);
929
0
}
930
931
void
932
dissect_wps_tlvs(proto_tree *eap_tree, tvbuff_t *tvb, int offset,
933
                int size, packet_info *pinfo, bool add_details)
934
14
{
935
14
  static const char *fmt_warn_too_long = "Value too long (max. %d)";
936
14
  static const char *fmt_length_warn   = "Value length not %d";
937
938
14
  unsigned   tlv_len;
939
14
  uint16_t tlv_type;
940
941
14
  proto_item *tlv_item = NULL; /* the root item */
942
14
  proto_tree *tlv_root = NULL;
943
14
  proto_item *tmp_item = NULL;
944
945
14
  int hfindex = -1;
946
947
40
  while(size > 0) {
948
949
    /* incomplete tlv-entry case */
950
29
    if (size < 4) {
951
2
      if ((tmp_item != NULL) && add_details)
952
0
        expert_add_info(pinfo, tmp_item, &ei_eapwps_packet_too_short);
953
2
      break;
954
2
    }
955
956
27
    tmp_item = NULL;
957
958
27
    tlv_type = tvb_get_ntohs(tvb, offset);
959
27
    tlv_len  = tvb_get_ntohs(tvb, offset+2);
960
961
    /* TOP Node for each TLV-item */
962
27
    tlv_root = proto_tree_add_subtree_format(eap_tree, tvb, offset, tlv_len+4,
963
27
                        ett_wps_tlv, &tlv_item, "Unknown Type (0x%04x)", tlv_type);
964
965
    /* analog to Tagged parameters in 802.11 */
966
27
    proto_tree_add_item(tlv_root, hf_eapwps_tlv_type, tvb, offset,   2, ENC_BIG_ENDIAN);
967
27
    proto_tree_add_item(tlv_root, hf_eapwps_tlv_len,  tvb, offset+2, 2, ENC_BIG_ENDIAN);
968
969
27
    switch(tlv_type) {
970
0
    case WPS_TLV_TYPE_AP_CHANNEL:
971
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_ap_channel, tvb, offset+4, 2, ENC_BIG_ENDIAN);
972
0
      hfindex = hf_eapwps_tlv_ap_channel;
973
974
0
      break;
975
976
0
    case WPS_TLV_TYPE_ASSOCIATION_STATE:
977
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_association_state, tvb, offset+4, 2, ENC_BIG_ENDIAN);
978
0
      hfindex = hf_eapwps_tlv_association_state;
979
980
0
      break;
981
982
0
    case WPS_TLV_TYPE_AUTHENTICATION_TYPE:
983
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type, tvb, offset+4, 2, ENC_BIG_ENDIAN);
984
0
      hfindex = hf_eapwps_tlv_authentication_type;
985
986
0
      break;
987
988
0
    case WPS_TLV_TYPE_AUTHENTICATION_TYPE_FLAGS:
989
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags, tvb, offset+4, 2, ENC_BIG_ENDIAN);
990
0
      hfindex = hf_eapwps_tlv_authentication_type_flags;
991
992
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_open,    tvb, offset+4, 2, ENC_BIG_ENDIAN);
993
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpapsk,  tvb, offset+4, 2, ENC_BIG_ENDIAN);
994
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_shared,  tvb, offset+4, 2, ENC_BIG_ENDIAN);
995
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpa,     tvb, offset+4, 2, ENC_BIG_ENDIAN);
996
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpa2,    tvb, offset+4, 2, ENC_BIG_ENDIAN);
997
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_authentication_type_flags_wpa2psk, tvb, offset+4, 2, ENC_BIG_ENDIAN);
998
999
0
      break;
1000
1001
0
    case WPS_TLV_TYPE_AUTHENTICATOR:
1002
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_authenticator, tvb, offset+4, 8, ENC_NA);
1003
0
      hfindex = hf_eapwps_tlv_authenticator;
1004
1005
0
      proto_item_append_text(tmp_item, " (1st 64 bits of HMAC)");
1006
0
      break;
1007
1008
0
    case WPS_TLV_TYPE_CONFIG_METHODS:
1009
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1010
0
      hfindex = hf_eapwps_tlv_config_methods;
1011
1012
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_usba,            tvb, offset+4, 2, ENC_BIG_ENDIAN);
1013
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_ethernet,        tvb, offset+4, 2, ENC_BIG_ENDIAN);
1014
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_label,           tvb, offset+4, 2, ENC_BIG_ENDIAN);
1015
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_display,         tvb, offset+4, 2, ENC_BIG_ENDIAN);
1016
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_virt_display,    tvb, offset+4, 2, ENC_BIG_ENDIAN);
1017
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_phy_display,     tvb, offset+4, 2, ENC_BIG_ENDIAN);
1018
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_nfcext,          tvb, offset+4, 2, ENC_BIG_ENDIAN);
1019
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_nfcint,          tvb, offset+4, 2, ENC_BIG_ENDIAN);
1020
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_nfcinf,          tvb, offset+4, 2, ENC_BIG_ENDIAN);
1021
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_pushbutton,      tvb, offset+4, 2, ENC_BIG_ENDIAN);
1022
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1023
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_phy_pushbutton,  tvb, offset+4, 2, ENC_BIG_ENDIAN);
1024
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_config_methods_keypad,          tvb, offset+4, 2, ENC_BIG_ENDIAN);
1025
1026
0
      break;
1027
1028
0
    case WPS_TLV_TYPE_CONFIGURATION_ERROR:
1029
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_configuration_error, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1030
0
      hfindex = hf_eapwps_tlv_configuration_error;
1031
1032
0
      break;
1033
1034
0
    case WPS_TLV_TYPE_CONFIRMATION_URL4: /* max len is 64 */
1035
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_confirmation_url4, tvb, offset+4, tlv_len, ENC_ASCII);
1036
0
      hfindex = hf_eapwps_tlv_confirmation_url4;
1037
0
      if ((tlv_len > 64) && add_details)
1038
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1039
1040
0
      break;
1041
1042
0
    case WPS_TLV_TYPE_CONFIRMATION_URL6: /* max len is 76 */
1043
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_confirmation_url6, tvb, offset+4, tlv_len, ENC_ASCII);
1044
0
      hfindex = hf_eapwps_tlv_confirmation_url6;
1045
0
      if ((tlv_len > 76) && add_details)
1046
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1047
1048
0
      break;
1049
1050
0
    case WPS_TLV_TYPE_CONNECTION_TYPE:
1051
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1052
0
      hfindex = hf_eapwps_tlv_connection_type;
1053
1054
0
      break;
1055
1056
0
    case WPS_TLV_TYPE_CONNECTION_TYPE_FLAGS:
1057
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type_flags, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1058
0
      hfindex = hf_eapwps_tlv_connection_type_flags;
1059
1060
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type_flags_ess,  tvb, offset+4, 1, ENC_BIG_ENDIAN);
1061
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_connection_type_flags_ibss, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1062
1063
0
      break;
1064
1065
0
    case WPS_TLV_TYPE_CREDENTIAL:
1066
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_credential, tvb, offset+4, tlv_len, ENC_NA);
1067
0
      hfindex = hf_eapwps_tlv_credential;
1068
1069
0
      break;
1070
1071
0
    case WPS_TLV_TYPE_DEVICE_NAME: /* len <= 32, check !  */
1072
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_device_name, tvb, offset+4, tlv_len, ENC_ASCII);
1073
0
      hfindex = hf_eapwps_tlv_device_name;
1074
0
      if ((tlv_len > 32) && add_details)
1075
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1076
1077
0
      break;
1078
1079
0
    case WPS_TLV_TYPE_DEVICE_PASSWORD_ID:
1080
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_device_password_id, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1081
0
      hfindex = hf_eapwps_tlv_device_password_id;
1082
1083
0
      break;
1084
1085
0
    case WPS_TLV_TYPE_E_HASH1:
1086
      /* assert tlv_len == 32  */
1087
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_hash1, tvb, offset+4, 32, ENC_NA);
1088
0
      hfindex = hf_eapwps_tlv_e_hash1;
1089
0
      if ((tlv_len != 32) && add_details)
1090
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 32);
1091
1092
0
      break;
1093
1094
0
    case WPS_TLV_TYPE_E_HASH2:
1095
      /* assert tlv_len == 32  */
1096
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_hash2, tvb, offset+4, 32, ENC_NA);
1097
0
      hfindex = hf_eapwps_tlv_e_hash2;
1098
0
      if ((tlv_len != 32) && add_details)
1099
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 32);
1100
1101
0
      break;
1102
1103
0
    case WPS_TLV_TYPE_E_SNONCE1:
1104
      /* assert tlv_len == 16  */
1105
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_snonce1, tvb, offset+4, 16, ENC_NA);
1106
0
      hfindex = hf_eapwps_tlv_e_snonce1;
1107
0
      if ((tlv_len != 16) && add_details)
1108
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 16);
1109
1110
0
      break;
1111
1112
0
    case WPS_TLV_TYPE_E_SNONCE2:
1113
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_e_snonce2, tvb, offset+4, 16, ENC_NA);
1114
0
      hfindex = hf_eapwps_tlv_e_snonce2;
1115
0
      if ((tlv_len != 16) && add_details)
1116
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 16);
1117
1118
0
      break;
1119
1120
0
    case WPS_TLV_TYPE_ENCRYPTED_SETTINGS:
1121
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_encrypted_settings, tvb, offset+4, tlv_len, ENC_NA);
1122
0
      hfindex = hf_eapwps_tlv_encrypted_settings;
1123
1124
0
      break;
1125
1126
0
    case WPS_TLV_TYPE_ENCRYPTION_TYPE:
1127
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1128
0
      hfindex = hf_eapwps_tlv_encryption_type;
1129
1130
0
      break;
1131
1132
1
    case WPS_TLV_TYPE_ENCRYPTION_TYPE_FLAGS:
1133
1
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1134
1
      hfindex = hf_eapwps_tlv_encryption_type_flags;
1135
1136
1
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_none,    tvb, offset+4, 2, ENC_BIG_ENDIAN);
1137
1
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_wep,     tvb, offset+4, 2, ENC_BIG_ENDIAN);
1138
1
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_tkip,    tvb, offset+4, 2, ENC_BIG_ENDIAN);
1139
1
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_encryption_type_flags_aes,     tvb, offset+4, 2, ENC_BIG_ENDIAN);
1140
1141
1
      break;
1142
1143
0
    case WPS_TLV_TYPE_ENROLLEE_NONCE:
1144
      /* assert tlv_len == 16  */
1145
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_enrollee_nonce, tvb, offset+4, 16, ENC_NA);
1146
0
      hfindex = hf_eapwps_tlv_enrollee_nonce;
1147
0
      if ((tlv_len != 16) && add_details)
1148
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 16);
1149
1150
0
      break;
1151
1152
0
    case WPS_TLV_TYPE_FEATURE_ID:
1153
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_feature_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1154
0
      hfindex = hf_eapwps_tlv_feature_id;
1155
1156
0
      break;
1157
1158
0
    case WPS_TLV_TYPE_IDENTITY:
1159
      /* check that tlv_len <= 80  */
1160
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_identity, tvb, offset+4, tlv_len, ENC_ASCII);
1161
0
      hfindex = hf_eapwps_tlv_identity;
1162
0
      if ((tlv_len > 80) && add_details)
1163
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1164
1165
0
      break;
1166
1167
0
    case WPS_TLV_TYPE_IDENTITY_PROOF:
1168
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_identity_proof, tvb, offset+4, tlv_len, ENC_NA);
1169
0
      hfindex = hf_eapwps_tlv_identity_proof;
1170
1171
0
      break;
1172
1173
0
    case WPS_TLV_TYPE_KEY_WRAP_AUTHENTICATOR:
1174
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_wrap_authenticator, tvb, offset+4, 8, ENC_NA);
1175
0
      hfindex = hf_eapwps_tlv_key_wrap_authenticator;
1176
1177
0
      break;
1178
1179
0
    case WPS_TLV_TYPE_KEY_IDENTIFIER:
1180
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_identifier, tvb, offset+4, 16, ENC_NA);
1181
0
      hfindex = hf_eapwps_tlv_key_identifier;
1182
1183
0
      break;
1184
1185
0
    case WPS_TLV_TYPE_MAC_ADDRESS:
1186
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_mac_address, tvb, offset+4, 6, ENC_NA);
1187
0
      hfindex = hf_eapwps_tlv_mac_address;
1188
1189
0
      break;
1190
1191
0
    case WPS_TLV_TYPE_MANUFACTURER:
1192
      /* check tlv_len <= 64 byte  */
1193
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_manufacturer, tvb, offset+4, tlv_len, ENC_ASCII);
1194
0
      hfindex = hf_eapwps_tlv_manufacturer;
1195
0
      if ((tlv_len > 64) && add_details)
1196
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1197
1198
0
      break;
1199
1200
0
    case WPS_TLV_TYPE_MESSAGE_TYPE:
1201
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_message_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1202
0
      hfindex = hf_eapwps_tlv_message_type;
1203
0
      if (add_details)
1204
0
        col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str(pinfo->pool, tvb_get_uint8(tvb, offset+4),
1205
0
                                                                   eapwps_tlv_message_type_vals,
1206
0
                                                                   "Unknown (0x%02x)"));
1207
0
      break;
1208
1209
0
    case WPS_TLV_TYPE_MODEL_NAME:
1210
      /* check tlv_len <= 32 byte  */
1211
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_model_name, tvb, offset+4, tlv_len, ENC_ASCII);
1212
0
      hfindex = hf_eapwps_tlv_model_name;
1213
0
      if ((tlv_len > 32) && add_details)
1214
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1215
1216
0
      break;
1217
1218
0
    case WPS_TLV_TYPE_MODEL_NUMBER:
1219
      /* check tlv_len <= 32 byte  */
1220
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_model_number, tvb, offset+4, tlv_len, ENC_ASCII);
1221
0
      hfindex = hf_eapwps_tlv_model_number;
1222
0
      if ((tlv_len > 32) && add_details)
1223
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1224
1225
0
      break;
1226
1227
0
    case WPS_TLV_TYPE_NETWORK_INDEX:
1228
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_network_index, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1229
0
      hfindex = hf_eapwps_tlv_network_index;
1230
1231
0
      break;
1232
1233
0
    case WPS_TLV_TYPE_NETWORK_KEY:
1234
      /* check tlv_len <= 64 byte  */
1235
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_network_key, tvb, offset+4, tlv_len, ENC_NA);
1236
0
      hfindex = hf_eapwps_tlv_network_key;
1237
0
      if ((tlv_len > 64) && add_details)
1238
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1239
1240
0
      break;
1241
1242
0
    case WPS_TLV_TYPE_NETWORK_KEY_INDEX:
1243
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_network_key_index, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1244
0
      hfindex = hf_eapwps_tlv_network_key_index;
1245
1246
0
      break;
1247
1248
0
    case WPS_TLV_TYPE_NEW_DEVICE_NAME:
1249
      /* check tlv_len <= 32 byte  */
1250
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_new_device_name, tvb, offset+4, tlv_len, ENC_NA);
1251
0
      hfindex = hf_eapwps_tlv_new_device_name;
1252
0
      if ((tlv_len > 32) && add_details)
1253
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1254
1255
0
      break;
1256
1257
0
    case WPS_TLV_TYPE_NEW_PASSWORD:
1258
      /* check tlv_len <= 64 byte  */
1259
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_new_password, tvb, offset+4, tlv_len, ENC_NA);
1260
0
      hfindex = hf_eapwps_tlv_new_password;
1261
0
      if ((tlv_len > 64) && add_details)
1262
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1263
1264
0
      break;
1265
1266
0
    case WPS_TLV_TYPE_OOB_DEVICE_PASSWORD:
1267
      /* check tlv_len <= 56 byte  */
1268
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_oob_device_password, tvb, offset+4, tlv_len, ENC_NA);
1269
0
      hfindex = hf_eapwps_tlv_oob_device_password;
1270
0
      if ((tlv_len > 56) && add_details)
1271
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1272
1273
0
      break;
1274
1275
0
    case WPS_TLV_TYPE_OS_VERSION:
1276
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_os_version, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1277
0
      hfindex = hf_eapwps_tlv_os_version;
1278
1279
0
      break;
1280
1281
0
    case WPS_TLV_TYPE_POWER_LEVEL:
1282
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_power_level, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1283
0
      hfindex = hf_eapwps_tlv_power_level;
1284
1285
0
      break;
1286
1287
0
    case WPS_TLV_TYPE_PSK_CURRENT:
1288
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_psk_current, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1289
0
      hfindex = hf_eapwps_tlv_psk_current;
1290
1291
0
      break;
1292
1293
0
    case WPS_TLV_TYPE_PSK_MAX:
1294
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_psk_max, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1295
0
      hfindex = hf_eapwps_tlv_psk_max;
1296
1297
0
      break;
1298
1299
0
    case WPS_TLV_TYPE_PUBLIC_KEY:
1300
      /* check tlv_len == 192 byte  */
1301
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_public_key, tvb, offset+4, 192, ENC_NA);
1302
0
      hfindex = hf_eapwps_tlv_public_key;
1303
0
      if ((tlv_len != 192) && add_details)
1304
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_length_warn, fmt_length_warn, 192);
1305
1306
0
      break;
1307
1308
0
    case WPS_TLV_TYPE_RADIO_ENABLED:
1309
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_radio_enabled, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1310
0
      hfindex = hf_eapwps_tlv_radio_enabled;
1311
1312
0
      break;
1313
1314
0
    case WPS_TLV_TYPE_REBOOT:
1315
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_reboot, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1316
0
      hfindex = hf_eapwps_tlv_reboot;
1317
1318
0
      break;
1319
1320
0
    case WPS_TLV_TYPE_REGISTRAR_CURRENT:
1321
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_current, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1322
0
      hfindex = hf_eapwps_tlv_registrar_current;
1323
1324
0
      break;
1325
1326
0
    case WPS_TLV_TYPE_REGISTRAR_ESTABLISHED:
1327
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_established, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1328
0
      hfindex = hf_eapwps_tlv_registrar_established;
1329
1330
0
      break;
1331
1332
0
    case WPS_TLV_TYPE_REGISTRAR_LIST:
1333
      /* NYI: list is */
1334
      /* - 16 bytes uuid */
1335
      /* - NULL-Terminated device name string  */
1336
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_list, tvb, offset+4, tlv_len, ENC_NA);
1337
0
      hfindex = hf_eapwps_tlv_registrar_list;
1338
1339
0
      break;
1340
1341
0
    case WPS_TLV_TYPE_REGISTRAR_MAX:
1342
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_max, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1343
0
      hfindex = hf_eapwps_tlv_registrar_max;
1344
1345
0
      break;
1346
1347
0
    case WPS_TLV_TYPE_REGISTRAR_NONCE:
1348
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_registrar_nonce, tvb, offset+4, 16, ENC_NA);
1349
0
      hfindex = hf_eapwps_tlv_registrar_nonce;
1350
1351
0
      break;
1352
1353
0
    case WPS_TLV_TYPE_REQUEST_TYPE:
1354
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_request_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1355
0
      hfindex = hf_eapwps_tlv_request_type;
1356
1357
0
      break;
1358
1359
0
    case WPS_TLV_TYPE_RESPONSE_TYPE:
1360
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_response_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1361
0
      hfindex = hf_eapwps_tlv_response_type;
1362
1363
0
      break;
1364
1365
0
    case WPS_TLV_TYPE_RF_BANDS:
1366
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_rf_bands, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1367
0
      hfindex = hf_eapwps_tlv_rf_bands;
1368
1369
0
      break;
1370
1371
0
    case WPS_TLV_TYPE_R_HASH1:
1372
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_hash1, tvb, offset+4, 32, ENC_NA);
1373
0
      hfindex = hf_eapwps_tlv_r_hash1;
1374
1375
0
      break;
1376
1377
0
    case WPS_TLV_TYPE_R_HASH2:
1378
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_hash2, tvb, offset+4, 32, ENC_NA);
1379
0
      hfindex = hf_eapwps_tlv_r_hash2;
1380
1381
0
      break;
1382
1383
0
    case WPS_TLV_TYPE_R_SNONCE1:
1384
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_snonce1, tvb, offset+4, 16, ENC_NA);
1385
0
      hfindex = hf_eapwps_tlv_r_snonce1;
1386
1387
0
      break;
1388
1389
0
    case WPS_TLV_TYPE_R_SNONCE2:
1390
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_r_snonce2, tvb, offset+4, 16, ENC_NA);
1391
0
      hfindex = hf_eapwps_tlv_r_snonce2;
1392
1393
0
      break;
1394
1395
0
    case WPS_TLV_TYPE_SELECTED_REGISTRAR:
1396
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1397
0
      hfindex = hf_eapwps_tlv_selected_registrar;
1398
1399
0
      break;
1400
1401
0
    case WPS_TLV_TYPE_SERIAL_NUMBER:
1402
      /* check tlv_len <= 32 bytes  */
1403
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_serial_number, tvb, offset+4, tlv_len, ENC_ASCII);
1404
0
      hfindex = hf_eapwps_tlv_serial_number;
1405
0
      if ((tlv_len > 32) && add_details)
1406
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1407
1408
0
      break;
1409
1410
0
    case WPS_TLV_TYPE_WIFI_PROTECTED_SETUP_STATE:
1411
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_wifi_protected_setup_state, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1412
0
      hfindex = hf_eapwps_tlv_wifi_protected_setup_state;
1413
1414
0
      break;
1415
1416
0
    case WPS_TLV_TYPE_SSID:
1417
      /* check tlv_len <= 32 bytes  */
1418
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_ssid, tvb, offset+4, tlv_len, ENC_ASCII);
1419
0
      hfindex = hf_eapwps_tlv_ssid;
1420
0
      if ((tlv_len > 32) && add_details)
1421
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1422
1423
0
      break;
1424
1425
0
    case WPS_TLV_TYPE_TOTAL_NETWORKS:
1426
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_total_networks, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1427
0
      hfindex = hf_eapwps_tlv_total_networks;
1428
1429
0
      break;
1430
1431
0
    case WPS_TLV_TYPE_UUID_E:
1432
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_uuid_e, tvb, offset+4, tlv_len, ENC_NA);
1433
0
      hfindex = hf_eapwps_tlv_uuid_e;
1434
0
      if ((tlv_len > 16) && add_details)
1435
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1436
1437
0
      break;
1438
1439
0
    case WPS_TLV_TYPE_UUID_R:
1440
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_uuid_r, tvb, offset+4, tlv_len, ENC_NA);
1441
0
      hfindex = hf_eapwps_tlv_uuid_r;
1442
0
      if ((tlv_len > 16) && add_details)
1443
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1444
1445
0
      break;
1446
1447
0
    case WPS_TLV_TYPE_VENDOR_EXTENSION:
1448
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_vendor_extension, tvb, offset+4, tlv_len, ENC_NA);
1449
0
      hfindex = hf_eapwps_tlv_vendor_extension;
1450
1451
0
      break;
1452
1453
0
    case WPS_TLV_TYPE_VERSION:
1454
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_version, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1455
0
      hfindex = hf_eapwps_tlv_version;
1456
1457
0
      break;
1458
1459
0
    case WPS_TLV_TYPE_X509_CERTIFICATE_REQUEST:
1460
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_x509_certificate_request, tvb, offset+4, tlv_len, ENC_NA);
1461
0
      hfindex = hf_eapwps_tlv_x509_certificate_request;
1462
1463
0
      break;
1464
1465
0
    case WPS_TLV_TYPE_X509_CERTIFICATE:
1466
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_x509_certificate, tvb, offset+4, tlv_len, ENC_NA);
1467
0
      hfindex = hf_eapwps_tlv_x509_certificate;
1468
1469
0
      break;
1470
1471
0
    case WPS_TLV_TYPE_EAP_IDENTITY:
1472
      /* check tlv_len <= 64 byte  */
1473
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_eap_identity, tvb, offset+4, tlv_len, ENC_NA);
1474
0
      hfindex = hf_eapwps_tlv_eap_identity;
1475
0
      if ((tlv_len > 64) && add_details)
1476
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1477
1478
0
      break;
1479
1480
0
    case WPS_TLV_TYPE_MESSAGE_COUNTER:
1481
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_message_counter, tvb, offset+4, 8, ENC_BIG_ENDIAN);
1482
0
      hfindex = hf_eapwps_tlv_message_counter;
1483
1484
0
      break;
1485
1486
0
    case WPS_TLV_TYPE_PUBLIC_KEY_HASH:
1487
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_public_key_hash, tvb, offset+4, 20, ENC_NA);
1488
0
      hfindex = hf_eapwps_tlv_public_key_hash;
1489
1490
0
      break;
1491
1492
0
    case WPS_TLV_TYPE_REKEY_KEY:
1493
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_rekey_key, tvb, offset+4, 32, ENC_NA);
1494
0
      hfindex = hf_eapwps_tlv_rekey_key;
1495
1496
0
      break;
1497
1498
0
    case WPS_TLV_TYPE_KEY_LIFETIME:
1499
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_lifetime, tvb, offset+4, 4, ENC_BIG_ENDIAN);
1500
0
      hfindex = hf_eapwps_tlv_key_lifetime;
1501
1502
0
      break;
1503
1504
0
    case WPS_TLV_TYPE_PERMITTED_CONFIG_METHODS:
1505
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1506
0
      hfindex = hf_eapwps_tlv_permitted_config_methods;
1507
1508
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1509
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1510
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1511
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1512
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1513
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1514
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1515
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1516
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1517
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1518
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1519
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1520
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1521
1522
0
      break;
1523
1524
0
    case WPS_TLV_TYPE_SELECTED_REGISTRAR_CONFIG_METHODS:
1525
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1526
0
      hfindex = hf_eapwps_tlv_selected_registrar_config_methods;
1527
1528
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1529
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1530
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1531
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1532
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1533
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1534
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1535
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1536
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1537
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1538
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1539
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1540
0
      proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1541
1542
0
      break;
1543
1544
0
    case WPS_TLV_TYPE_PRIMARY_DEVICE_TYPE:
1545
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_primary_device_type, tvb, offset+4, 8, ENC_NA);
1546
0
      hfindex = hf_eapwps_tlv_primary_device_type;
1547
0
      if (tvb_get_ntohl(tvb, offset+6) == WFA_OUI) {
1548
0
        uint16_t dev_cat = tvb_get_ntohs(tvb, offset+4);
1549
0
        if ((dev_cat > 0) && (dev_cat <= WPS_DEVICE_TYPE_CATEGORY_MAX)) {
1550
0
          proto_tree_add_item(tlv_root, hf_eapwps_tlv_primary_device_type_category, tvb, offset+4, 2, ENC_BIG_ENDIAN);
1551
0
          proto_tree_add_item(tlv_root, hf_eapwps_tlv_primary_device_type_subcategory[dev_cat-1], tvb, offset+10, 2, ENC_BIG_ENDIAN);
1552
0
        }
1553
0
      }
1554
1555
0
      break;
1556
1557
0
    case WPS_TLV_TYPE_SECONDARY_DEVICE_TYPE_LIST:
1558
      /* check tlv_len <= 128 byte  */
1559
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_secondary_device_type_list, tvb, offset+4, tlv_len, ENC_NA);
1560
0
      hfindex = hf_eapwps_tlv_secondary_device_type_list;
1561
0
      if ((tlv_len > 128) && add_details)
1562
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1563
1564
0
      break;
1565
1566
0
    case WPS_TLV_TYPE_PORTABLE_DEVICE:
1567
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_portable_device, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1568
0
      hfindex = hf_eapwps_tlv_portable_device;
1569
1570
0
      break;
1571
1572
0
    case WPS_TLV_TYPE_AP_SETUP_LOCKED:
1573
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_ap_setup_locked, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1574
0
      hfindex = hf_eapwps_tlv_ap_setup_locked;
1575
1576
0
      break;
1577
1578
0
    case WPS_TLV_TYPE_APPLICATION_EXTENSION:
1579
      /* check tlv_len <= 512 byte  */
1580
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_application_extension, tvb, offset+4, tlv_len, ENC_NA);
1581
0
      hfindex = hf_eapwps_tlv_application_extension;
1582
0
      if ((tlv_len > 512) && add_details)
1583
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1584
1585
0
      break;
1586
1587
0
    case WPS_TLV_TYPE_EAP_TYPE:
1588
      /* check tlv_len <= 8 byte  */
1589
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_eap_type, tvb, offset+4, tlv_len, ENC_NA);
1590
0
      hfindex = hf_eapwps_tlv_eap_type;
1591
0
      if ((tlv_len > 8) && add_details)
1592
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1593
1594
0
      break;
1595
1596
0
    case WPS_TLV_TYPE_INITIALIZATION_VECTOR:
1597
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_initialization_vector, tvb, offset+4, 32, ENC_NA);
1598
0
      hfindex = hf_eapwps_tlv_initialization_vector;
1599
1600
0
      break;
1601
1602
0
    case WPS_TLV_TYPE_KEY_PROVIDED_AUTOMATICALLY:
1603
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_key_provided_automatically, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1604
0
      hfindex = hf_eapwps_tlv_key_provided_automatically;
1605
1606
0
      break;
1607
1608
0
    case WPS_TLV_TYPE_8021X_ENABLED:
1609
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_8021x_enabled, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1610
0
      hfindex = hf_eapwps_tlv_8021x_enabled;
1611
1612
0
      break;
1613
1614
0
    case WPS_TLV_TYPE_APPSESSIONKEY:
1615
      /* check tlv_len <= 128 byte  */
1616
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_appsessionkey, tvb, offset+4, tlv_len, ENC_NA);
1617
0
      hfindex = hf_eapwps_tlv_appsessionkey;
1618
0
      if ((tlv_len > 128) && add_details)
1619
0
        expert_add_info_format(pinfo, tmp_item, &ei_eapwps_fmt_warn_too_long, fmt_warn_too_long, tlv_len);
1620
1621
0
      break;
1622
1623
0
    case WPS_TLV_TYPE_WEPTRANSMITKEY:
1624
0
      tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_weptransmitkey, tvb, offset+4, 1, ENC_BIG_ENDIAN);
1625
0
      hfindex = hf_eapwps_tlv_weptransmitkey;
1626
1627
0
      break;
1628
1629
0
    case WPS_TLV_TYPE_REQUESTED_DEV_TYPE:
1630
0
      tmp_item = proto_tree_add_item(tlv_root,
1631
0
                                     hf_eapwps_tlv_requested_dev_type, tvb,
1632
0
                                     offset + 4, 8, ENC_NA);
1633
0
      hfindex = hf_eapwps_tlv_requested_dev_type;
1634
0
      break;
1635
1636
25
    default:
1637
      /* do something useful ?  */
1638
25
      tmp_item = NULL;
1639
25
      hfindex  = -1;
1640
27
    }
1641
1642
26
    if ((tmp_item != NULL) && (tlv_item != NULL)) {
1643
      /* make the tree look nicer :-)
1644
         tmp_item -> a proto_item specific to the _value_
1645
         tlv_item ->  root-item grouping
1646
                      - "Data Element Type"
1647
                      - "Date Element Length"
1648
                      - tmp_item */
1649
1
      uint32_t           value   = -1;
1650
1
      void              *valuep  = NULL;
1651
1
      header_field_info *hf_info = NULL;
1652
1
      const char        *fmt     = NULL;
1653
1654
1
      proto_item_set_text(tlv_item, "%s",
1655
1
                          val_to_str(pinfo->pool, tlv_type, eapwps_tlv_types, "Unknown (0x%04x)"));
1656
1657
      /* Rendered strings for value. Thanks to Stig Bjorlykke */
1658
1
      hf_info = proto_registrar_get_nth(hfindex);
1659
1
      if (hf_info != NULL) {
1660
1
        switch(hf_info->type) {
1661
0
        case FT_UINT8:
1662
0
          fmt    = hf_info->strings ? ": %s (0x%02x)": ": 0x%02x";
1663
0
          value  = tvb_get_uint8 (tvb, offset+4);
1664
0
          break;
1665
1
        case FT_UINT16:
1666
1
          fmt    = hf_info->strings ? ": %s (0x%04x)": ": 0x%04x";
1667
1
          value  = tvb_get_ntohs (tvb, offset+4);
1668
1
          break;
1669
0
        case FT_UINT32:
1670
0
          fmt    = hf_info->strings ? ": %s (0x%08x)": ": 0x%08x";
1671
0
          value  = tvb_get_ntohl (tvb, offset+4);
1672
0
          break;
1673
0
        case FT_STRING:
1674
0
          fmt    = ": %s";
1675
0
          valuep = tvb_get_string_enc(pinfo->pool, tvb, offset+4, tlv_len, ENC_ASCII);
1676
0
          break;
1677
0
        default:
1678
          /* make compiler happy */
1679
0
          break;
1680
1
        }
1681
1682
1
        if (fmt != NULL) {
1683
1
          if (hf_info->strings) {
1684
            /* item has value_string */
1685
0
            proto_item_append_text(tlv_item, fmt, val_to_str(pinfo->pool, value,
1686
0
                                                             (const value_string *)hf_info->strings,
1687
0
                                                             "Unknown: %d"), value);
1688
1
          } else if (valuep != NULL) {
1689
            /* the string-case */
1690
0
            proto_item_append_text(tlv_item, fmt, valuep);
1691
1
          } else {
1692
            /* field is FT_UINT(8|16|32) but has no value_string */
1693
1
            proto_item_append_text(tlv_item, fmt, value);
1694
1
          }
1695
1
        } /* else field is either FT_ETHER or FT_BYTES (or something else?),
1696
             don't do anything */
1697
1
      }
1698
1699
1
    }
1700
1701
26
    if (tlv_type == WPS_TLV_TYPE_VENDOR_EXTENSION)
1702
0
      dissect_wps_vendor_ext(tlv_root, pinfo, tvb, offset + 4, tlv_len);
1703
1704
26
    offset += tlv_len + 2 + 2;
1705
26
    size   -= tlv_len + 2 + 2;
1706
26
  }
1707
14
}
1708
1709
/********************************************************************** */
1710
/********************************************************************** */
1711
1712
static int
1713
dissect_wps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1714
0
{
1715
0
  proto_item *pi;
1716
0
  proto_tree *pt;
1717
0
  uint8_t     flags;
1718
0
  int         offset;
1719
0
  int         size;
1720
1721
0
  offset = 0;
1722
0
  size = tvb_captured_length(tvb);
1723
1724
0
  pi = proto_tree_add_item(tree, hf_eapwps_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1725
0
  offset += 1; size -= 1;
1726
1727
0
  pi = proto_item_get_parent(pi);
1728
0
  proto_item_append_text(pi, " (Wifi Alliance, WifiProtectedSetup)");
1729
0
  col_append_str(pinfo->cinfo, COL_INFO, ", WPS");
1730
1731
  /* Flag field, if msg-len flag set, add appropriate field  */
1732
0
  pi = proto_tree_add_item_ret_uint8(tree, hf_eapwps_flags,      tvb, offset, 1, ENC_BIG_ENDIAN, &flags);
1733
0
  pt = proto_item_add_subtree(pi, ett_eap_wps_flags);
1734
1735
0
  proto_tree_add_item(pt, hf_eapwps_flag_mf,    tvb, offset, 1, ENC_BIG_ENDIAN);
1736
0
  proto_tree_add_item(pt, hf_eapwps_flag_lf,    tvb, offset, 1, ENC_BIG_ENDIAN);
1737
0
  offset += 1; size -= 1;
1738
1739
0
  if (flags & MASK_WSC_FLAG_LF) {
1740
    /* length field is present in first eap-packet when msg is fragmented  */
1741
0
    proto_tree_add_item(tree, hf_eapwps_msglen, tvb, offset, 2, ENC_BIG_ENDIAN);
1742
0
    offset += 2; size -= 2;
1743
0
  }
1744
1745
0
  dissect_wps_tlvs(tree, tvb, offset, size, pinfo, true);
1746
1747
0
  return size;
1748
0
}
1749
1750
/********************************************************************** */
1751
/********************************************************************** */
1752
void
1753
proto_register_wps(void)
1754
15
{
1755
15
  static hf_register_info hf[] = {
1756
1757
    /* These data-elements are sent in EAP-Packets using expanded types */
1758
    /* (see RFC3748 Section 5.7) */
1759
    /* Paket dissections is done here and not in (packet-eap) as */
1760
    /* both (tlvs and fields named eap.wps.*) are defined by */
1761
    /* WifiAlliance  */
1762
15
    { &hf_eapwps_opcode,
1763
15
      { "Opcode", "eap.wps.code",
1764
15
        FT_UINT8, BASE_DEC, VALS(eapwps_opcode_vals), 0x0, "WSC Message Type", HFILL }},
1765
1766
15
    { &hf_eapwps_flags,
1767
15
      { "Flags", "eap.wps.flags",
1768
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1769
1770
15
    { &hf_eapwps_flag_mf,
1771
15
      { "More flag", "eap.wps.flags.more",
1772
15
        FT_BOOLEAN, 8, NULL, MASK_WSC_FLAG_MF, NULL, HFILL }},
1773
1774
15
    { &hf_eapwps_flag_lf,
1775
15
      { "Length field present", "eap.wps.flags.length",
1776
15
        FT_BOOLEAN, 8, NULL, MASK_WSC_FLAG_LF, NULL, HFILL }},
1777
1778
15
    { &hf_eapwps_msglen,
1779
15
      { "Length field", "eap.wps.msglen",
1780
15
        FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1781
1782
    /* TLV encoded data which may be contained in */
1783
    /* 802.11 Management frames and EAP-extended type */
1784
15
    { &hf_eapwps_tlv_type,
1785
15
      { "Data Element Type", "wps.type",
1786
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_types), 0x0, NULL, HFILL }},
1787
1788
15
    { &hf_eapwps_tlv_len,
1789
15
      { "Data Element Length", "wps.length",
1790
15
        FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1791
1792
1793
15
    { &hf_eapwps_tlv_ap_channel,
1794
15
      { "AP Channel", "wps.ap_channel",
1795
15
        FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
1796
1797
15
    { &hf_eapwps_tlv_association_state,
1798
15
      { "Association State", "wps.association_state",
1799
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_association_state_vals), 0x0, NULL, HFILL }},
1800
1801
1802
15
    { &hf_eapwps_tlv_authentication_type,
1803
15
      { "Authentication Type", "wps.authentication_type",
1804
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_authentication_type_vals), 0x0, NULL, HFILL }},
1805
1806
15
    { &hf_eapwps_tlv_authentication_type_flags,
1807
15
      { "Authentication Type Flags", "wps.authentication_type_flags",
1808
15
        FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1809
1810
15
    { &hf_eapwps_tlv_authentication_type_flags_open,
1811
15
      { "Open", "wps.authentication_type.open",
1812
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_OPEN, NULL, HFILL }},
1813
1814
15
    { &hf_eapwps_tlv_authentication_type_flags_wpapsk,
1815
15
      { "WPA PSK", "wps.authentication_type.wpapsk",
1816
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPAPSK, NULL, HFILL }},
1817
1818
15
    { &hf_eapwps_tlv_authentication_type_flags_shared,
1819
15
      { "Shared", "wps.authentication_type.shared",
1820
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_SHARED, NULL, HFILL }},
1821
1822
15
    { &hf_eapwps_tlv_authentication_type_flags_wpa,
1823
15
      { "WPA", "wps.authentication_type.wpa",
1824
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPA, NULL, HFILL }},
1825
1826
15
    { &hf_eapwps_tlv_authentication_type_flags_wpa2,
1827
15
      { "WPA2", "wps.authentication_type.wpa2",
1828
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPA2, NULL, HFILL }},
1829
1830
15
    { &hf_eapwps_tlv_authentication_type_flags_wpa2psk,
1831
15
      { "WPA2PSK", "wps.authentication_type.wpa2psk",
1832
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_AUTHTYPE_WPA2PSK, NULL, HFILL }},
1833
1834
1835
15
    { &hf_eapwps_tlv_authenticator,
1836
15
      { "Authenticator", "wps.authenticator",
1837
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1838
1839
1840
15
    { &hf_eapwps_tlv_config_methods,
1841
15
      { "Configuration Methods", "wps.config_methods",
1842
15
        FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1843
1844
15
    { &hf_eapwps_tlv_config_methods_usba,
1845
15
      { "USB", "wps.config_methods.usba",
1846
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }},
1847
1848
15
    { &hf_eapwps_tlv_config_methods_ethernet,
1849
15
      { "Ethernet", "wps.config_methods.ethernet",
1850
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }},
1851
1852
15
    { &hf_eapwps_tlv_config_methods_label,
1853
15
      { "Label", "wps.config_methods.label",
1854
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }},
1855
1856
15
    { &hf_eapwps_tlv_config_methods_display,
1857
15
      { "Display", "wps.config_methods.display",
1858
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }},
1859
1860
15
    { &hf_eapwps_tlv_config_methods_virt_display,
1861
15
      { "Virtual Display", "wps.config_methods.virt_display",
1862
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }},
1863
1864
15
    { &hf_eapwps_tlv_config_methods_phy_display,
1865
15
      { "Physical Display", "wps.config_methods.phy_display",
1866
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }},
1867
1868
15
    { &hf_eapwps_tlv_config_methods_nfcext,
1869
15
      { "External NFC", "wps.config_methods.nfcext",
1870
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }},
1871
1872
15
    { &hf_eapwps_tlv_config_methods_nfcint,
1873
15
      { "Internal NFC", "wps.config_methods.nfcint",
1874
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }},
1875
1876
15
    { &hf_eapwps_tlv_config_methods_nfcinf,
1877
15
      { "NFC Interface", "wps.config_methods.nfcinf",
1878
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }},
1879
1880
15
    { &hf_eapwps_tlv_config_methods_pushbutton,
1881
15
      { "Push Button", "wps.config_methods.pushbutton",
1882
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }},
1883
1884
15
    { &hf_eapwps_tlv_config_methods_virt_pushbutton,
1885
15
      { "Virtual Push Button", "wps.config_methods.virt_pushbutton",
1886
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }},
1887
1888
15
    { &hf_eapwps_tlv_config_methods_phy_pushbutton,
1889
15
      { "Physical Push Button", "wps.config_methods.phy_pushbutton",
1890
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }},
1891
1892
15
    { &hf_eapwps_tlv_config_methods_keypad,
1893
15
      { "Keypad", "wps.config_methods.keypad",
1894
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }},
1895
1896
1897
15
    { &hf_eapwps_tlv_configuration_error,
1898
15
      { "Configuration Error", "wps.configuration_error",
1899
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_configuration_error_vals), 0x0, NULL, HFILL }},
1900
1901
15
    { &hf_eapwps_tlv_confirmation_url4,
1902
15
      { "Confirmation URL4", "wps.confirmation_url4",
1903
15
        FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1904
1905
15
    { &hf_eapwps_tlv_confirmation_url6,
1906
15
      { "Confirmation URL6", "wps.confirmation_url6",
1907
15
        FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1908
1909
1910
15
    { &hf_eapwps_tlv_connection_type,
1911
15
      { "Connection Type", "wps.connection_type",
1912
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1913
1914
15
    { &hf_eapwps_tlv_connection_type_flags,
1915
15
      { "Connection Types", "wps.connection_type_flags",
1916
15
        FT_UINT8, BASE_HEX, VALS(eapwps_tlv_connection_type_vals), 0x0, NULL, HFILL }},
1917
1918
15
    { &hf_eapwps_tlv_connection_type_flags_ess,
1919
15
      { "ESS", "wps.connection_type_flags.ess",
1920
15
        FT_UINT8, BASE_HEX, NULL, EAPWPS_CONNTYPE_ESS, NULL, HFILL }},
1921
1922
15
    { &hf_eapwps_tlv_connection_type_flags_ibss,
1923
15
      { "IBSS", "wps.connection_type_flags.ibss",
1924
15
        FT_UINT8, BASE_HEX, NULL, EAPWPS_CONNTYPE_IBSS, NULL, HFILL }},
1925
1926
1927
15
    { &hf_eapwps_tlv_credential,  /* Encrypted  */
1928
15
      { "Credential", "wps.credential",
1929
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1930
1931
1932
15
    { &hf_eapwps_tlv_device_name,
1933
15
      { "Device Name", "wps.device_name",
1934
15
        FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1935
1936
15
    { &hf_eapwps_tlv_device_password_id,
1937
15
      { "Device Password ID", "wps.device_password_id",
1938
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_device_password_id_vals), 0x0, NULL, HFILL }},
1939
1940
1941
15
    { &hf_eapwps_tlv_e_hash1,
1942
15
      { "Enrollee Hash 1", "wps.e_hash1",
1943
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1944
1945
15
    { &hf_eapwps_tlv_e_hash2,
1946
15
      { "Enrollee Hash 2", "wps.e_hash2",
1947
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1948
1949
15
    { &hf_eapwps_tlv_e_snonce1,
1950
15
      { "Enrollee SNounce 1", "wps.e_snonce1",
1951
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1952
1953
15
    { &hf_eapwps_tlv_e_snonce2,
1954
15
      { "Enrollee SNounce 2", "wps.e_snonce2",
1955
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1956
1957
1958
15
    { &hf_eapwps_tlv_encrypted_settings, /* Encrypted !  */
1959
15
      { "Encrypted Settings", "wps.encrypted_settings",
1960
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1961
1962
1963
15
    { &hf_eapwps_tlv_encryption_type,
1964
15
      { "Encryption Type", "wps.encryption_type",
1965
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_encryption_type_vals), 0x0, NULL, HFILL }},
1966
1967
15
    { &hf_eapwps_tlv_encryption_type_flags,
1968
15
      { "Encryption Type Flags", "wps.encryption_type_flags",
1969
15
        FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1970
1971
15
    { &hf_eapwps_tlv_encryption_type_flags_none,
1972
15
      { "None", "wps.encryption_type_flags.none",
1973
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_NONE, NULL, HFILL }},
1974
1975
15
    { &hf_eapwps_tlv_encryption_type_flags_wep,
1976
15
      { "WEP", "wps.encryption_type_flags.wep",
1977
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_WEP, NULL, HFILL }},
1978
1979
15
    { &hf_eapwps_tlv_encryption_type_flags_tkip,
1980
15
      { "TKIP", "wps.encryption_type_flags.tkip",
1981
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_TKIP, NULL, HFILL }},
1982
1983
15
    { &hf_eapwps_tlv_encryption_type_flags_aes,
1984
15
      { "AES", "wps.encryption_type_flags.aes",
1985
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_ENCTYPE_AES, NULL, HFILL }},
1986
1987
1988
15
    { &hf_eapwps_tlv_enrollee_nonce,
1989
15
      { "Enrollee Nonce", "wps.enrollee_nonce",
1990
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
1991
1992
15
    { &hf_eapwps_tlv_feature_id,
1993
15
      { "Feature ID", "wps.feature_id",
1994
15
        FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
1995
1996
1997
15
    { &hf_eapwps_tlv_identity,
1998
15
      { "Identity", "wps.identity",
1999
15
        FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2000
2001
15
    { &hf_eapwps_tlv_identity_proof, /* Encrypted !  */
2002
15
      { "Identity Proof", "wps.identity_proof",
2003
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2004
2005
2006
15
    { &hf_eapwps_tlv_key_wrap_authenticator,
2007
15
      { "Key Wrap Authenticator", "wps.key_wrap_authenticator",
2008
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2009
2010
15
    { &hf_eapwps_tlv_key_identifier,
2011
15
      { "Key Identifier", "wps.key_identifier",
2012
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2013
2014
2015
15
    { &hf_eapwps_tlv_mac_address,
2016
15
      { "MAC", "wps.mac_address",
2017
15
        FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2018
2019
15
    { &hf_eapwps_tlv_manufacturer,
2020
15
      { "Manufacturer", "wps.manufacturer",
2021
15
        FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2022
2023
15
    { &hf_eapwps_tlv_message_type,
2024
15
      { "Message Type", "wps.message_type",
2025
15
        FT_UINT8, BASE_HEX, VALS(eapwps_tlv_message_type_vals), 0x0, NULL, HFILL }},
2026
2027
2028
15
    { &hf_eapwps_tlv_model_name,
2029
15
      { "Model Name", "wps.model_name",
2030
15
        FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2031
2032
15
    { &hf_eapwps_tlv_model_number,
2033
15
      { "Model Number", "wps.model_number",
2034
15
        FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2035
2036
2037
15
    { &hf_eapwps_tlv_network_index,
2038
15
      { "Network Index", "wps.network_index",
2039
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2040
2041
2042
15
    { &hf_eapwps_tlv_network_key,
2043
15
      { "Network Key", "wps.network_key",
2044
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2045
2046
15
    { &hf_eapwps_tlv_network_key_index,
2047
15
      { "Network Key Index", "wps.network_key_index",
2048
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2049
2050
2051
15
    { &hf_eapwps_tlv_new_device_name,
2052
15
      { "New Device Name", "wps.new_device_name",
2053
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2054
2055
15
    { &hf_eapwps_tlv_new_password,
2056
15
      { "New Password", "wps.new_password",
2057
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2058
2059
15
    { &hf_eapwps_tlv_oob_device_password,
2060
15
      { "OOB Device Password", "wps.oob_device_password",
2061
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2062
2063
2064
15
    { &hf_eapwps_tlv_os_version,
2065
15
      { "OS Version", "wps.os_version",
2066
15
        FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2067
2068
15
    { &hf_eapwps_tlv_power_level,
2069
15
      { "Power Level", "wps.power_level",
2070
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2071
2072
2073
15
    { &hf_eapwps_tlv_psk_current,
2074
15
      { "PSK Current", "wps.psk_current",
2075
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2076
2077
15
    { &hf_eapwps_tlv_psk_max,
2078
15
      { "PSK Max", "wps.psk_max",
2079
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2080
2081
2082
15
    { &hf_eapwps_tlv_public_key,
2083
15
      { "Public Key", "wps.public_key",
2084
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2085
2086
15
    { &hf_eapwps_tlv_radio_enabled, /* Add info  */
2087
15
      { "Radio Enabled", "wps.radio_enabled",
2088
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2089
15
    { &hf_eapwps_tlv_reboot, /* Add info  */
2090
15
      { "Reboot", "wps.reboot",
2091
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2092
2093
15
    { &hf_eapwps_tlv_registrar_current,
2094
15
      { "Registrar current", "wps.registrar_current",
2095
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2096
15
    { &hf_eapwps_tlv_registrar_established, /* Add info  */
2097
15
      { "Registrar established", "wps.registrar_established",
2098
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2099
15
    { &hf_eapwps_tlv_registrar_list,
2100
15
      { "Registrar list", "wps.registrar_list",
2101
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2102
15
    { &hf_eapwps_tlv_registrar_max,
2103
15
      { "Registrar max", "wps.registrar_max",
2104
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2105
15
    { &hf_eapwps_tlv_registrar_nonce,
2106
15
      { "Registrar Nonce", "wps.registrar_nonce",
2107
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2108
2109
15
    { &hf_eapwps_tlv_request_type,
2110
15
      { "Request Type", "wps.request_type",
2111
15
        FT_UINT8, BASE_HEX, VALS(eapwps_tlv_request_type_vals), 0x0, NULL, HFILL }},
2112
15
    { &hf_eapwps_tlv_response_type,
2113
15
      { "Response Type", "wps.response_type",
2114
15
        FT_UINT8, BASE_HEX, VALS(eapwps_tlv_response_type_vals), 0x0, NULL, HFILL }},
2115
2116
15
    { &hf_eapwps_tlv_rf_bands,
2117
15
      { "RF Bands", "wps.rf_bands",
2118
15
        FT_UINT8, BASE_HEX, VALS(eapwps_tlv_rf_bands_vals), 0x0, NULL, HFILL }},
2119
2120
2121
15
    { &hf_eapwps_tlv_r_hash1,
2122
15
      { "Registrar Hash 1", "wps.r_hash1",
2123
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2124
2125
15
    { &hf_eapwps_tlv_r_hash2,
2126
15
      { "Registrar Hash 2", "wps.r_hash2",
2127
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2128
2129
15
    { &hf_eapwps_tlv_r_snonce1,
2130
15
      { "Registrar Snonce1", "wps.r_snonce1",
2131
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2132
2133
15
    { &hf_eapwps_tlv_r_snonce2,
2134
15
      { "Registrar Snonce 2", "wps.r_snonce2",
2135
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2136
2137
2138
15
    { &hf_eapwps_tlv_selected_registrar,
2139
15
      { "Selected Registrar", "wps.selected_registrar",
2140
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2141
2142
15
    { &hf_eapwps_tlv_serial_number,
2143
15
      { "Serial Number", "wps.serial_number",
2144
15
        FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2145
2146
15
    { &hf_eapwps_tlv_wifi_protected_setup_state,
2147
15
      { "Wifi Protected Setup State", "wps.wifi_protected_setup_state",
2148
15
        FT_UINT8, BASE_HEX, VALS(eapwps_tlv_wifi_protected_setup_state), 0x0, NULL, HFILL }},
2149
2150
15
    { &hf_eapwps_tlv_ssid,
2151
15
      { "SSID", "wps.ssid",
2152
15
        FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2153
2154
15
    { &hf_eapwps_tlv_total_networks,
2155
15
      { "Total Networks", "wps.total_networks",
2156
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2157
2158
2159
15
    { &hf_eapwps_tlv_uuid_e,
2160
15
      { "UUID Enrollee", "wps.uuid_e",
2161
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2162
2163
15
    { &hf_eapwps_tlv_uuid_r,
2164
15
      { "UUID Registrar", "wps.uuid_r",
2165
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2166
2167
2168
15
    { &hf_eapwps_tlv_vendor_extension,
2169
15
      { "Vendor Extension", "wps.vendor_extension",
2170
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2171
2172
15
    { &hf_eapwps_tlv_version,
2173
15
      { "Version", "wps.version",
2174
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2175
2176
15
    { &hf_eapwps_tlv_x509_certificate_request,
2177
15
      { "X509 Certificate Request", "wps.x509_certificate_request",
2178
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2179
15
    { &hf_eapwps_tlv_x509_certificate,
2180
15
      { "X509 Certificate", "wps.x509_certificate",
2181
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2182
2183
15
    { &hf_eapwps_tlv_eap_identity,
2184
15
      { "EAP Identity", "wps.eap_identity",
2185
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2186
2187
15
    { &hf_eapwps_tlv_message_counter,
2188
15
      { "Message Counter", "wps.message_counter",
2189
15
        FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2190
2191
15
    { &hf_eapwps_tlv_public_key_hash,
2192
15
      { "Public Key Hash", "wps.public_key_hash",
2193
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2194
2195
15
    { &hf_eapwps_tlv_rekey_key,
2196
15
      { "Rekey Key", "wps.rekey_key",
2197
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2198
15
    { &hf_eapwps_tlv_key_lifetime,
2199
15
      { "Key Lifetime", "wps.key_lifetime",
2200
15
        FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2201
2202
15
    { &hf_eapwps_tlv_permitted_config_methods,
2203
15
      { "Permitted COnfig Methods", "wps.permitted_config_methods",
2204
15
        FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2205
2206
15
    { &hf_eapwps_tlv_permitted_config_methods_usba,
2207
15
      { "USB", "wps.permitted_config_methods.usba",
2208
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }},
2209
2210
15
    { &hf_eapwps_tlv_permitted_config_methods_ethernet,
2211
15
      { "Ethernet", "wps.permitted_config_methods.ethernet",
2212
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }},
2213
2214
15
    { &hf_eapwps_tlv_permitted_config_methods_label,
2215
15
      { "Label", "wps.permitted_config_methods.label",
2216
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }},
2217
2218
15
    { &hf_eapwps_tlv_permitted_config_methods_display,
2219
15
      { "Display", "wps.permitted_config_methods.display",
2220
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }},
2221
2222
15
    { &hf_eapwps_tlv_permitted_config_methods_virt_display,
2223
15
      { "Virtual Display", "wps.permitted_config_methods.virt_display",
2224
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }},
2225
2226
15
    { &hf_eapwps_tlv_permitted_config_methods_phy_display,
2227
15
      { "Physical Display", "wps.permitted_config_methods.phy_display",
2228
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }},
2229
2230
15
    { &hf_eapwps_tlv_permitted_config_methods_nfcext,
2231
15
      { "External NFC", "wps.permitted_config_methods.nfcext",
2232
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }},
2233
2234
15
    { &hf_eapwps_tlv_permitted_config_methods_nfcint,
2235
15
      { "Internal NFC", "wps.permitted_config_methods.nfcint",
2236
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }},
2237
2238
15
    { &hf_eapwps_tlv_permitted_config_methods_nfcinf,
2239
15
      { "NFC Interface", "wps.permitted_config_methods.nfcinf",
2240
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }},
2241
2242
15
    { &hf_eapwps_tlv_permitted_config_methods_pushbutton,
2243
15
      { "Push Button", "wps.permitted_config_methods.pushbutton",
2244
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }},
2245
2246
15
    { &hf_eapwps_tlv_permitted_config_methods_virt_pushbutton,
2247
15
      { "Virtual Push Button", "wps.permitted_config_methods.virt_pushbutton",
2248
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }},
2249
2250
15
    { &hf_eapwps_tlv_permitted_config_methods_phy_pushbutton,
2251
15
      { "Physical Push Button", "wps.permitted_config_methods.phy_pushbutton",
2252
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }},
2253
2254
15
    { &hf_eapwps_tlv_permitted_config_methods_keypad,
2255
15
      { "Keypad", "wps.permitted_config_methods.keypad",
2256
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }},
2257
2258
15
    { &hf_eapwps_tlv_selected_registrar_config_methods,
2259
15
      { "Selected Registrar Config Methods", "wps.selected_registrar_config_methods",
2260
15
        FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2261
2262
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_usba,
2263
15
      { "USB", "wps.selected_registrar_config_methods.usba",
2264
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }},
2265
2266
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_ethernet,
2267
15
      { "Ethernet", "wps.selected_registrar_config_methods.ethernet",
2268
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }},
2269
2270
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_label,
2271
15
      { "Label", "wps.selected_registrar_config_methods.label",
2272
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }},
2273
2274
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_display,
2275
15
      { "Display", "wps.selected_registrar_config_methods.display",
2276
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }},
2277
2278
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_virt_display,
2279
15
      { "Virtual Display", "wps.selected_registrar_config_methods.virt_display",
2280
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }},
2281
2282
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_phy_display,
2283
15
      { "Physical Display", "wps.selected_registrar_config_methods.phy_display",
2284
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }},
2285
2286
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_nfcext,
2287
15
      { "External NFC", "wps.selected_registrar_config_methods.nfcext",
2288
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }},
2289
2290
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_nfcint,
2291
15
      { "Internal NFC", "wps.selected_registrar_config_methods.nfcint",
2292
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }},
2293
2294
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_nfcinf,
2295
15
      { "NFC Interface", "wps.selected_registrar_config_methods.nfcinf",
2296
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }},
2297
2298
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_pushbutton,
2299
15
      { "Push Button", "wps.selected_registrar_config_methods.pushbutton",
2300
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }},
2301
2302
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton,
2303
15
      { "Virtual Push Button", "wps.selected_registrar_config_methods.virt_pushbutton",
2304
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }},
2305
2306
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton,
2307
15
      { "Physical Push Button", "wps.selected_registrar_config_methods.phy_pushbutton",
2308
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }},
2309
2310
15
    { &hf_eapwps_tlv_selected_registrar_config_methods_keypad,
2311
15
      { "Keypad", "wps.selected_registrar_config_methods.keypad",
2312
15
        FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }},
2313
2314
15
    { &hf_eapwps_tlv_primary_device_type,
2315
15
      { "Primary Device Type", "wps.primary_device_type",
2316
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2317
2318
15
    { &hf_eapwps_tlv_primary_device_type_category,
2319
15
      { "Category", "wps.primary_device_type.category",
2320
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_primary_device_type_category), 0x0, NULL, HFILL }},
2321
2322
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[0],
2323
15
      { "Subcategory", "wps.primary_device_type.subcategory_computer",
2324
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_computer_subcategory), 0x0, NULL, HFILL }},
2325
2326
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[1],
2327
15
      { "Subcategory", "wps.primary_device_type.subcategory_input_device",
2328
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_input_device_subcategory), 0x0, NULL, HFILL }},
2329
2330
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[2],
2331
15
      { "Subcategory", "wps.primary_device_type.subcategory_printers_scanners_faxes_copiers",
2332
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_printers_scanners_faxes_copiers_subcategory), 0x0, NULL, HFILL }},
2333
2334
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[3],
2335
15
      { "Subcategory", "wps.primary_device_type.subcategory_camera",
2336
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_camera_subcategory), 0x0, NULL, HFILL }},
2337
2338
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[4],
2339
15
      { "Subcategory", "wps.primary_device_type.subcategory_storage",
2340
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_storage_subcategory), 0x0, NULL, HFILL }},
2341
2342
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[5],
2343
15
      { "Subcategory", "wps.primary_device_type.subcategory_network_infrastructure",
2344
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_network_infrastructure_subcategory), 0x0, NULL, HFILL }},
2345
2346
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[6],
2347
15
      { "Subcategory", "wps.primary_device_type.subcategory_displays",
2348
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_displays_subcategory), 0x0, NULL, HFILL }},
2349
2350
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[7],
2351
15
      { "Subcategory", "wps.primary_device_type.subcategory_multimedia_devices",
2352
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_multimedia_devices_subcategory), 0x0, NULL, HFILL }},
2353
2354
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[8],
2355
15
      { "Subcategory", "wps.primary_device_type.subcategory_gaming_devices",
2356
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_gaming_devices_subcategory), 0x0, NULL, HFILL }},
2357
2358
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[9],
2359
15
      { "Subcategory", "wps.primary_device_type.subcategory_telephone",
2360
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_telephone_subcategory), 0x0, NULL, HFILL }},
2361
2362
15
    { &hf_eapwps_tlv_primary_device_type_subcategory[10],
2363
15
      { "Subcategory", "wps.primary_device_type.subcategory_audio_devices",
2364
15
        FT_UINT16, BASE_HEX, VALS(eapwps_tlv_audio_devices_subcategory), 0x0, NULL, HFILL }},
2365
2366
2367
15
    { &hf_eapwps_tlv_secondary_device_type_list,
2368
15
      { "Secondary Device Type List", "wps.secondary_device_type_list",
2369
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2370
2371
15
    { &hf_eapwps_tlv_portable_device, /* Add info  */
2372
15
      { "Portable Device", "wps.portable_device",
2373
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2374
2375
15
    { &hf_eapwps_tlv_ap_setup_locked, /* Add info  */
2376
15
      { "AP Setup Locked", "wps.ap_setup_locked",
2377
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2378
2379
15
    { &hf_eapwps_tlv_application_extension,
2380
15
      { "Application Extension", "wps.application_extension",
2381
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2382
2383
15
    { &hf_eapwps_tlv_eap_type,
2384
15
      { "EAP Type", "wps.eap_type",
2385
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2386
2387
15
    { &hf_eapwps_tlv_initialization_vector,
2388
15
      { "Initialization Vector", "wps.initialization_vector",
2389
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2390
2391
15
    { &hf_eapwps_tlv_key_provided_automatically, /* Add info  */
2392
15
      { "Key Provided Automatically", "wps.key_provided_automatically",
2393
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2394
2395
15
    { &hf_eapwps_tlv_8021x_enabled, /* Add info  */
2396
15
      { "8021x Enabled", "wps.8021x_enabled",
2397
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2398
2399
15
    { &hf_eapwps_tlv_appsessionkey,
2400
15
      { "AppSessionKey", "wps.appsessionkey",
2401
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2402
2403
15
    { &hf_eapwps_tlv_weptransmitkey,
2404
15
      { "WEP Transmit Key", "wps.weptransmitkey",
2405
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2406
2407
15
    { &hf_eapwps_tlv_requested_dev_type,
2408
15
      { "Requested Device Type", "wps.requested_dev_type",
2409
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2410
2411
15
    { &hf_eapwps_vendor_id,
2412
15
      { "Vendor ID", "wps.vendor_id",
2413
15
        FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2414
2415
15
    { &hf_eapwps_wfa_ext_id,
2416
15
      { "WFA Extension Subelement ID", "wps.ext.id",
2417
15
        FT_UINT8, BASE_DEC, VALS(eapwps_wfa_ext_types), 0x0, NULL, HFILL }},
2418
2419
15
    { &hf_eapwps_wfa_ext_len,
2420
15
      { "WFA Extension Subelement Length", "wps.ext.len",
2421
15
        FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2422
2423
15
    { &hf_eapwps_wfa_ext_version2,
2424
15
      { "Version2", "wps.ext.version2",
2425
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2426
2427
15
    { &hf_eapwps_wfa_ext_authorizedmacs,
2428
15
      { "AuthorizedMACs", "wps.ext.authorizedmacs",
2429
15
        FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
2430
2431
15
    { &hf_eapwps_wfa_ext_network_key_shareable,
2432
15
      { "Network Key Shareable", "wps.ext.network_key_shareable",
2433
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2434
2435
15
    { &hf_eapwps_wfa_ext_request_to_enroll,
2436
15
      { "Request to Enroll", "wps.ext.request_to_enroll",
2437
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2438
2439
15
    { &hf_eapwps_wfa_ext_settings_delay_time,
2440
15
      { "Settings Delay Time", "wps.ext.settings_delay_time",
2441
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2442
2443
15
    { &hf_multi_ap_backhaul_sta,
2444
15
      { "Backhaul STA", "wps.ext.multi_ap.backhaul_sta",
2445
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80, NULL, HFILL }},
2446
2447
15
    { &hf_multi_ap_backhaul_bss,
2448
15
      { "Backhaul BSS", "wps.ext.multi_ap.backhaul_bss",
2449
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40, NULL, HFILL }},
2450
2451
15
    { &hf_multi_ap_fronthaul_bss,
2452
15
      { "Fronthaul BSS", "wps.ext.multi_ap.fronthaul_bss",
2453
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20, NULL, HFILL }},
2454
2455
15
    { &hf_multi_ap_teardown_bsses,
2456
15
      { "Teardown", "wps.ext.multi_ap.teardown",
2457
15
        FT_BOOLEAN, 8, TFS(&tfs_required_not_required), 0x10, NULL, HFILL }},
2458
2459
15
    { &hf_multi_ap_profile1_backhaul_sta_assoc_disallowed,
2460
15
      { "Profile-1 Backhaul STA association disallowed", "wps.ext.multi_ap.profile1_backhaul_sta_disallowed",
2461
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08, NULL, HFILL }},
2462
2463
15
    { &hf_multi_ap_profile2_backhaul_sta_assoc_disallowed,
2464
15
      { "Profile-2 Backhaul STA association disallowed", "wps.ext.multi_ap.profile2_backhaul_sta_disallowed",
2465
15
        FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04, NULL, HFILL }},
2466
2467
15
    { &hf_multi_ap_reserved,
2468
15
      { "Reserved", "wps.ext.multi_ap.reserved",
2469
15
        FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL }},
2470
2471
15
    { &hf_multi_ap_flags,
2472
15
      { "Multi-AP Flags", "wps.ext.multi_ap_flags",
2473
15
        FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
2474
2475
15
    { &hf_multi_ap_profiles,
2476
15
      { "Multi-AP Profile", "wps.ext.multi_ap_profile",
2477
15
        FT_UINT8, BASE_HEX, VALS(wps_wfa_ext_multi_ap_profiles_vals), 0x0, NULL,
2478
15
                                                                    HFILL }},
2479
2480
15
    { &hf_multi_ap_8021q,
2481
15
      { "Primary VLAN ID", "wps.ext.primary_vlan_id",
2482
15
        FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
2483
15
  };
2484
15
  static int *ett[] = {
2485
15
    &ett_eap_wps_attr,
2486
15
    &ett_eap_wps_flags,
2487
    /* EAP WPS  */
2488
15
    &ett_wps_tlv,
2489
15
    &ett_eap_wps_ap_channel,
2490
15
    &ett_eap_wps_association_state,
2491
15
    &ett_eap_wps_authentication_type,
2492
15
    &ett_eap_wps_authentication_type_flags,
2493
15
    &ett_eap_wps_authenticator,
2494
15
    &ett_eap_wps_config_methods,
2495
15
    &ett_eap_wps_configuration_error,
2496
15
    &ett_eap_wps_confirmation_url4,
2497
15
    &ett_eap_wps_confirmation_url6,
2498
15
    &ett_eap_wps_connection_type,
2499
15
    &ett_eap_wps_connection_type_flags,
2500
15
    &ett_eap_wps_credential,
2501
15
    &ett_eap_wps_device_name,
2502
15
    &ett_eap_wps_device_password_id,
2503
15
    &ett_eap_wps_e_hash1,
2504
15
    &ett_eap_wps_e_hash2,
2505
15
    &ett_eap_wps_e_snonce1,
2506
15
    &ett_eap_wps_e_snonce2,
2507
15
    &ett_eap_wps_encrypted_settings,
2508
15
    &ett_eap_wps_encryption_type,
2509
15
    &ett_eap_wps_encryption_type_flags,
2510
15
    &ett_eap_wps_enrollee_nonce,
2511
15
    &ett_eap_wps_feature_id,
2512
15
    &ett_eap_wps_identity,
2513
15
    &ett_eap_wps_identity_proof,
2514
15
    &ett_eap_wps_key_wrap_authenticator,
2515
15
    &ett_eap_wps_key_identifier,
2516
15
    &ett_eap_wps_mac_address,
2517
15
    &ett_eap_wps_manufacturer,
2518
15
    &ett_eap_wps_message_type,
2519
15
    &ett_eap_wps_model_name,
2520
15
    &ett_eap_wps_model_number,
2521
15
    &ett_eap_wps_network_index,
2522
15
    &ett_eap_wps_network_key,
2523
15
    &ett_eap_wps_network_key_index,
2524
15
    &ett_eap_wps_new_device_name,
2525
15
    &ett_eap_wps_new_password,
2526
15
    &ett_eap_wps_oob_device_password,
2527
15
    &ett_eap_wps_os_version,
2528
15
    &ett_eap_wps_power_level,
2529
15
    &ett_eap_wps_psk_current,
2530
15
    &ett_eap_wps_psk_max,
2531
15
    &ett_eap_wps_public_key,
2532
15
    &ett_eap_wps_radio_enabled,
2533
15
    &ett_eap_wps_reboot,
2534
15
    &ett_eap_wps_registrar_current,
2535
15
    &ett_eap_wps_registrar_established,
2536
15
    &ett_eap_wps_registrar_list,
2537
15
    &ett_eap_wps_registrar_max,
2538
15
    &ett_eap_wps_registrar_nonce,
2539
15
    &ett_eap_wps_request_type,
2540
15
    &ett_eap_wps_response_type,
2541
15
    &ett_eap_wps_rf_bands,
2542
15
    &ett_eap_wps_r_hash1,
2543
15
    &ett_eap_wps_r_hash2,
2544
15
    &ett_eap_wps_r_snonce1,
2545
15
    &ett_eap_wps_r_snonce2,
2546
15
    &ett_eap_wps_selected_registrar,
2547
15
    &ett_eap_wps_serial_number,
2548
15
    &ett_eap_wps_wifi_protected_setup_state,
2549
15
    &ett_eap_wps_ssid,
2550
15
    &ett_eap_wps_total_networks,
2551
15
    &ett_eap_wps_uuid_e,
2552
15
    &ett_eap_wps_uuid_r,
2553
15
    &ett_eap_wps_vendor_extension,
2554
15
    &ett_eap_wps_version,
2555
15
    &ett_eap_wps_x509_certificate_request,
2556
15
    &ett_eap_wps_x509_certificate,
2557
15
    &ett_eap_wps_eap_identity,
2558
15
    &ett_eap_wps_message_counter,
2559
15
    &ett_eap_wps_public_key_hash,
2560
15
    &ett_eap_wps_rekey_key,
2561
15
    &ett_eap_wps_key_lifetime,
2562
15
    &ett_eap_wps_permitted_config_methods,
2563
15
    &ett_eap_wps_selected_registrar_config_methods,
2564
15
    &ett_eap_wps_primary_device_type,
2565
15
    &ett_eap_wps_secondary_device_type_list,
2566
15
    &ett_eap_wps_portable_device,
2567
15
    &ett_eap_wps_ap_setup_locked,
2568
15
    &ett_eap_wps_application_extension,
2569
15
    &ett_eap_wps_eap_type,
2570
15
    &ett_eap_wps_initialization_vector,
2571
15
    &ett_eap_wps_key_provided_automatically,
2572
15
    &ett_eap_wps_8021x_enabled,
2573
15
    &ett_eap_wps_appsessionkey,
2574
15
    &ett_eap_wps_weptransmitkey,
2575
15
    &ett_wps_wfa_ext,
2576
15
    &ett_multi_ap_flags,
2577
15
  };
2578
2579
15
  static ei_register_info ei[] = {
2580
15
     { &ei_eapwps_packet_too_short, { "wps.packet_too_short", PI_MALFORMED, PI_ERROR, "Packet too short", EXPFILL }},
2581
15
     { &ei_eapwps_fmt_warn_too_long, { "wps.length.value_too_long", PI_MALFORMED, PI_ERROR, "Value too long", EXPFILL }},
2582
15
     { &ei_eapwps_fmt_length_warn, { "wps.length.too_long", PI_MALFORMED, PI_ERROR, "Value length not X", EXPFILL }},
2583
15
  };
2584
2585
15
  expert_module_t* expert_wps;
2586
2587
15
  proto_wps = proto_register_protocol("Wifi Protected Setup",
2588
15
                                      "WPS", "wps");
2589
15
  proto_register_field_array(proto_wps, hf, array_length(hf));
2590
15
  proto_register_subtree_array(ett, array_length(ett));
2591
15
  expert_wps = expert_register_protocol(proto_wps);
2592
15
  expert_register_field_array(expert_wps, ei, array_length(ei));
2593
2594
15
  wps_handle = register_dissector("wps", dissect_wps, proto_wps);
2595
15
}
2596
2597
void
2598
proto_reg_handoff_wps(void)
2599
15
{
2600
15
  dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_IEEE1905_MULTI_AP, create_dissector_handle(dissect_wps_wfa_ext_via_dt, proto_wps));
2601
15
  dissector_add_uint("eap.ext.vendor_id", WFA_VENDOR_ID, wps_handle);
2602
15
}
2603
2604
/*
2605
 * Editor modelines
2606
 *
2607
 * Local Variables:
2608
 * c-basic-offset: 2
2609
 * tab-width: 8
2610
 * indent-tabs-mode: nil
2611
 * End:
2612
 *
2613
 * ex: set shiftwidth=2 tabstop=8 expandtab:
2614
 * :indentSize=2:tabSize=8:noTabs=true:
2615
 */