335 } |
338 } |
336 |
339 |
337 addr = iap_blacklist_m.next(); |
340 addr = iap_blacklist_m.next(); |
338 } |
341 } |
339 } |
342 } |
|
343 |
|
344 // --------------------------------------------------------------------------- |
|
345 // --------------------------------------------------------------------------- |
|
346 // |
|
347 bool_t core_iap_data_c::is_valid() const |
|
348 { |
|
349 if( iap_data_m.security_mode == core_security_mode_wep ) |
|
350 { |
|
351 if( !iap_data_m.wep_key1.key_length && |
|
352 !iap_data_m.wep_key2.key_length && |
|
353 !iap_data_m.wep_key3.key_length && |
|
354 !iap_data_m.wep_key4.key_length ) |
|
355 { |
|
356 DEBUG( "core_iap_data_c::is_valid() - security mode is WEP but no keys defined" ); |
|
357 |
|
358 return false_t; |
|
359 } |
|
360 |
|
361 if( ( iap_data_m.default_wep_key > WEP_KEY4 ) || |
|
362 ( iap_data_m.default_wep_key == WEP_KEY1 && |
|
363 !iap_data_m.wep_key1.key_length ) || |
|
364 ( iap_data_m.default_wep_key == WEP_KEY2 && |
|
365 !iap_data_m.wep_key2.key_length ) || |
|
366 ( iap_data_m.default_wep_key == WEP_KEY3 && |
|
367 !iap_data_m.wep_key3.key_length ) || |
|
368 ( iap_data_m.default_wep_key == WEP_KEY4 && |
|
369 !iap_data_m.wep_key4.key_length ) ) |
|
370 { |
|
371 DEBUG( "core_iap_data_c::is_valid() - security mode is WEP but default key not defined" ); |
|
372 |
|
373 return false_t; |
|
374 } |
|
375 } |
|
376 |
|
377 if( iap_data_m.wpa_preshared_key_in_use && |
|
378 !iap_data_m.wpa_preshared_key.key_length ) |
|
379 { |
|
380 DEBUG( "core_iap_data_c::is_valid() - security mode is WPA-PSK but key is not defined" ); |
|
381 |
|
382 return false_t; |
|
383 } |
|
384 |
|
385 if( iap_data_m.op_mode == core_operating_mode_ibss && |
|
386 ( iap_data_m.security_mode != core_security_mode_allow_unsecure && |
|
387 iap_data_m.security_mode != core_security_mode_wep ) ) |
|
388 { |
|
389 DEBUG1( "core_iap_data_c::is_valid() - IBSS mode with security mode %u not supported", |
|
390 iap_data_m.security_mode ); |
|
391 |
|
392 return false_t; |
|
393 } |
|
394 |
|
395 return true_t; |
|
396 } |