shill: WiFi: Support cached credentials

Adopt a more "lazy" approach to removing wpa_supplicant network
entries for EAP-TLS networks, so that credential information can
be cached.  This speeds up the re-authentication process for some
network types.  To do this, we disable the network entries instead
of removing them from the wpa_supplicant interface.  To re-connect
we simply re-select the saved network block.

If any credentials are changed in the WiFi service, these cached
credentials should be removed, with the side effect of disconnecting
the network.

As a part of this change, we remove the now deprecated
ClearCachedCredentials wpa_supplicant interface API function which
is a since-reverted local modification.

BUG=chromium-os:25670,chrome-os-partner:15005
TEST=New unit tests.  Manually tested using a pair of scenarios
where there is both a user-profile-hosted network and a
default-profile-hosted network.  The two test scenarios begin by
establishing connections to both networks.  In one scenario,
leave the user-profile network connected.  In the other scenario
leave the default-profile network connected.  Use the "list"
command in wpa_cli to monitor what network entries are present
before and after logout.

In both cases, before logout, ensure that the connected network is
marked "ACTIVE" and the other network is marked "DISABLED",
indicating that wpa_supplicant will not automatically switch to
the un-selected network.

In the first scenario (user-profile network connected), after
logout, the user-profile network disappears.  The default-profile
network loses the "DISABLED" flag, as this network is now being
actively connected to.  Shortly after, it is labeled as "ACTIVE".

In the second scenario (default-profile network connected),
after logout the user-profile network disappears.  The default-profile
network remains ACTIVE and is not disconnected.

New autotest under development:
network_WiFiRoaming/network_WiFiRoaming.011PMKSA_Caching, which
tests that on re-association, the EAP-TLS step is bypassed, and
RSN PMKSA caching is used instead.  Tested using packet-capture
that an PMKID appears in the RSN IE in the association request.

Verified during the test using the wpa_cli "pmksa" command that
two PMKIDs appear, one for each of the APs used in the test, and
that at test completion they are both removed.

Change-Id: I0c45662716dcc35c89f1277c4d7949909003e13a
Reviewed-on: https://gerrit.chromium.org/gerrit/39676
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
19 files changed
tree: a3418a060b7245175ccbfd72848b8698451d90f7
  1. bin/
  2. data/
  3. dbus_bindings/
  4. doc/
  5. shims/
  6. .gitignore
  7. accessor_interface.h
  8. adaptor_interfaces.h
  9. arp_client.cc
  10. arp_client.h
  11. arp_client_unittest.cc
  12. arp_packet.cc
  13. arp_packet.h
  14. arp_packet_unittest.cc
  15. async_connection.cc
  16. async_connection.h
  17. async_connection_unittest.cc
  18. byte_string.cc
  19. byte_string.h
  20. byte_string_unittest.cc
  21. callback80211_metrics.cc
  22. callback80211_metrics.h
  23. callback80211_object.cc
  24. callback80211_object.h
  25. callbacks.h
  26. cellular.cc
  27. cellular.h
  28. cellular_capability.cc
  29. cellular_capability.h
  30. cellular_capability_cdma.cc
  31. cellular_capability_cdma.h
  32. cellular_capability_cdma_unittest.cc
  33. cellular_capability_classic.cc
  34. cellular_capability_classic.h
  35. cellular_capability_classic_unittest.cc
  36. cellular_capability_gsm.cc
  37. cellular_capability_gsm.h
  38. cellular_capability_gsm_unittest.cc
  39. cellular_capability_universal.cc
  40. cellular_capability_universal.h
  41. cellular_capability_universal_unittest.cc
  42. cellular_error.cc
  43. cellular_error.h
  44. cellular_operator_info.cc
  45. cellular_operator_info.h
  46. cellular_operator_info_unittest.cc
  47. cellular_service.cc
  48. cellular_service.h
  49. cellular_service_unittest.cc
  50. cellular_unittest.cc
  51. config80211.cc
  52. config80211.h
  53. config80211_unittest.cc
  54. connection.cc
  55. connection.h
  56. connection_unittest.cc
  57. control_interface.h
  58. crypto_des_cbc.cc
  59. crypto_des_cbc.h
  60. crypto_des_cbc_unittest.cc
  61. crypto_interface.h
  62. crypto_provider.cc
  63. crypto_provider.h
  64. crypto_provider_unittest.cc
  65. crypto_rot47.cc
  66. crypto_rot47.h
  67. crypto_rot47_unittest.cc
  68. dbus_adaptor.cc
  69. dbus_adaptor.h
  70. dbus_adaptor_unittest.cc
  71. dbus_control.cc
  72. dbus_control.h
  73. dbus_manager.cc
  74. dbus_manager.h
  75. dbus_manager_unittest.cc
  76. dbus_objectmanager_proxy.cc
  77. dbus_objectmanager_proxy.h
  78. dbus_objectmanager_proxy_interface.h
  79. dbus_properties.cc
  80. dbus_properties.h
  81. dbus_properties_proxy.cc
  82. dbus_properties_proxy.h
  83. dbus_properties_proxy_interface.h
  84. dbus_properties_unittest.cc
  85. dbus_property_matchers.h
  86. dbus_service_proxy.cc
  87. dbus_service_proxy.h
  88. dbus_service_proxy_interface.h
  89. default_profile.cc
  90. default_profile.h
  91. default_profile_unittest.cc
  92. device.cc
  93. device.h
  94. device_dbus_adaptor.cc
  95. device_dbus_adaptor.h
  96. device_info.cc
  97. device_info.h
  98. device_info_unittest.cc
  99. device_stub.h
  100. device_unittest.cc
  101. dhcp_config.cc
  102. dhcp_config.h
  103. dhcp_config_unittest.cc
  104. dhcp_provider.cc
  105. dhcp_provider.h
  106. dhcp_provider_unittest.cc
  107. dhcp_proxy_interface.h
  108. dhcpcd_proxy.cc
  109. dhcpcd_proxy.h
  110. diagnostics_reporter.cc
  111. diagnostics_reporter.h
  112. diagnostics_reporter_unittest.cc
  113. dns_client.cc
  114. dns_client.h
  115. dns_client_unittest.cc
  116. endpoint.cc
  117. endpoint.h
  118. ephemeral_profile.cc
  119. ephemeral_profile.h
  120. error.cc
  121. error.h
  122. error_unittest.cc
  123. ethernet.cc
  124. ethernet.h
  125. ethernet_service.cc
  126. ethernet_service.h
  127. ethernet_service_unittest.cc
  128. event_dispatcher.cc
  129. event_dispatcher.h
  130. geolocation_info.cc
  131. geolocation_info.h
  132. glib.cc
  133. glib.h
  134. glib_io_input_handler.cc
  135. glib_io_input_handler.h
  136. glib_io_ready_handler.cc
  137. glib_io_ready_handler.h
  138. HACKING
  139. hook_table.cc
  140. hook_table.h
  141. hook_table_unittest.cc
  142. http_proxy.cc
  143. http_proxy.h
  144. http_proxy_unittest.cc
  145. http_request.cc
  146. http_request.h
  147. http_request_unittest.cc
  148. http_url.cc
  149. http_url.h
  150. http_url_unittest.cc
  151. ieee80211.h
  152. io_handler.h
  153. ip_address.cc
  154. ip_address.h
  155. ip_address_unittest.cc
  156. ipconfig.cc
  157. ipconfig.h
  158. ipconfig_dbus_adaptor.cc
  159. ipconfig_dbus_adaptor.h
  160. ipconfig_unittest.cc
  161. kernel_bound_nlmessage.cc
  162. kernel_bound_nlmessage.h
  163. key_file_store.cc
  164. key_file_store.h
  165. key_file_store_unittest.cc
  166. key_value_store.cc
  167. key_value_store.h
  168. key_value_store_matcher.h
  169. key_value_store_unittest.cc
  170. l2tp_ipsec_driver.cc
  171. l2tp_ipsec_driver.h
  172. l2tp_ipsec_driver_unittest.cc
  173. LICENSE
  174. link_monitor.cc
  175. link_monitor.h
  176. link_monitor_unittest.cc
  177. logging.h
  178. Makefile
  179. manager.cc
  180. manager.h
  181. manager_dbus_adaptor.cc
  182. manager_dbus_adaptor.h
  183. manager_unittest.cc
  184. memory_log.cc
  185. memory_log.h
  186. memory_log_unittest.cc
  187. metrics.cc
  188. metrics.h
  189. metrics_unittest.cc
  190. minijail.cc
  191. minijail.h
  192. mm1_bearer_proxy.cc
  193. mm1_bearer_proxy.h
  194. mm1_bearer_proxy_interface.h
  195. mm1_modem_location_proxy.cc
  196. mm1_modem_location_proxy.h
  197. mm1_modem_location_proxy_interface.h
  198. mm1_modem_modem3gpp_proxy.cc
  199. mm1_modem_modem3gpp_proxy.h
  200. mm1_modem_modem3gpp_proxy_interface.h
  201. mm1_modem_modemcdma_proxy.cc
  202. mm1_modem_modemcdma_proxy.h
  203. mm1_modem_modemcdma_proxy_interface.h
  204. mm1_modem_proxy.cc
  205. mm1_modem_proxy.h
  206. mm1_modem_proxy_interface.h
  207. mm1_modem_simple_proxy.cc
  208. mm1_modem_simple_proxy.h
  209. mm1_modem_simple_proxy_interface.h
  210. mm1_modem_time_proxy.cc
  211. mm1_modem_time_proxy.h
  212. mm1_modem_time_proxy_interface.h
  213. mm1_sim_proxy.cc
  214. mm1_sim_proxy.h
  215. mm1_sim_proxy_interface.h
  216. mock_adaptors.cc
  217. mock_adaptors.h
  218. mock_ares.cc
  219. mock_ares.h
  220. mock_arp_client.cc
  221. mock_arp_client.h
  222. mock_async_connection.cc
  223. mock_async_connection.h
  224. mock_callback80211_object.h
  225. mock_cellular.cc
  226. mock_cellular.h
  227. mock_cellular_operator_info.cc
  228. mock_cellular_operator_info.h
  229. mock_cellular_service.cc
  230. mock_cellular_service.h
  231. mock_connection.cc
  232. mock_connection.h
  233. mock_control.cc
  234. mock_control.h
  235. mock_dbus_manager.cc
  236. mock_dbus_manager.h
  237. mock_dbus_objectmanager_proxy.cc
  238. mock_dbus_objectmanager_proxy.h
  239. mock_dbus_properties_proxy.cc
  240. mock_dbus_properties_proxy.h
  241. mock_dbus_service_proxy.cc
  242. mock_dbus_service_proxy.h
  243. mock_device.cc
  244. mock_device.h
  245. mock_device_info.cc
  246. mock_device_info.h
  247. mock_dhcp_config.cc
  248. mock_dhcp_config.h
  249. mock_dhcp_provider.cc
  250. mock_dhcp_provider.h
  251. mock_dhcp_proxy.cc
  252. mock_dhcp_proxy.h
  253. mock_diagnostics_reporter.cc
  254. mock_diagnostics_reporter.h
  255. mock_dns_client.cc
  256. mock_dns_client.h
  257. mock_ethernet.cc
  258. mock_ethernet.h
  259. mock_event_dispatcher.cc
  260. mock_event_dispatcher.h
  261. mock_glib.cc
  262. mock_glib.h
  263. mock_http_request.cc
  264. mock_http_request.h
  265. mock_ipconfig.cc
  266. mock_ipconfig.h
  267. mock_link_monitor.cc
  268. mock_link_monitor.h
  269. mock_log.cc
  270. mock_log.h
  271. mock_log_unittest.cc
  272. mock_manager.cc
  273. mock_manager.h
  274. mock_metrics.cc
  275. mock_metrics.h
  276. mock_minijail.cc
  277. mock_minijail.h
  278. mock_mm1_bearer_proxy.cc
  279. mock_mm1_bearer_proxy.h
  280. mock_mm1_modem_location_proxy.cc
  281. mock_mm1_modem_location_proxy.h
  282. mock_mm1_modem_modem3gpp_proxy.cc
  283. mock_mm1_modem_modem3gpp_proxy.h
  284. mock_mm1_modem_modemcdma_proxy.cc
  285. mock_mm1_modem_modemcdma_proxy.h
  286. mock_mm1_modem_proxy.cc
  287. mock_mm1_modem_proxy.h
  288. mock_mm1_modem_simple_proxy.cc
  289. mock_mm1_modem_simple_proxy.h
  290. mock_mm1_modem_time_proxy.cc
  291. mock_mm1_modem_time_proxy.h
  292. mock_mm1_sim_proxy.cc
  293. mock_mm1_sim_proxy.h
  294. mock_modem.cc
  295. mock_modem.h
  296. mock_modem_cdma_proxy.cc
  297. mock_modem_cdma_proxy.h
  298. mock_modem_gobi_proxy.cc
  299. mock_modem_gobi_proxy.h
  300. mock_modem_gsm_card_proxy.cc
  301. mock_modem_gsm_card_proxy.h
  302. mock_modem_gsm_network_proxy.cc
  303. mock_modem_gsm_network_proxy.h
  304. mock_modem_info.cc
  305. mock_modem_info.h
  306. mock_modem_manager_proxy.cc
  307. mock_modem_manager_proxy.h
  308. mock_modem_proxy.cc
  309. mock_modem_proxy.h
  310. mock_modem_simple_proxy.cc
  311. mock_modem_simple_proxy.h
  312. mock_nl80211_socket.h
  313. mock_nss.cc
  314. mock_nss.h
  315. mock_openvpn_driver.cc
  316. mock_openvpn_driver.h
  317. mock_openvpn_management_server.cc
  318. mock_openvpn_management_server.h
  319. mock_portal_detector.cc
  320. mock_portal_detector.h
  321. mock_power_manager.cc
  322. mock_power_manager.h
  323. mock_power_manager_proxy.cc
  324. mock_power_manager_proxy.h
  325. mock_process_killer.cc
  326. mock_process_killer.h
  327. mock_profile.cc
  328. mock_profile.h
  329. mock_property_store.cc
  330. mock_property_store.h
  331. mock_proxy_factory.cc
  332. mock_proxy_factory.h
  333. mock_resolver.cc
  334. mock_resolver.h
  335. mock_routing_table.cc
  336. mock_routing_table.h
  337. mock_rtnl_handler.cc
  338. mock_rtnl_handler.h
  339. mock_service.cc
  340. mock_service.h
  341. mock_sockets.cc
  342. mock_sockets.h
  343. mock_store.cc
  344. mock_store.h
  345. mock_supplicant_bss_proxy.cc
  346. mock_supplicant_bss_proxy.h
  347. mock_supplicant_interface_proxy.cc
  348. mock_supplicant_interface_proxy.h
  349. mock_supplicant_network_proxy.cc
  350. mock_supplicant_network_proxy.h
  351. mock_supplicant_process_proxy.cc
  352. mock_supplicant_process_proxy.h
  353. mock_time.cc
  354. mock_time.h
  355. mock_vpn.cc
  356. mock_vpn.h
  357. mock_vpn_driver.cc
  358. mock_vpn_driver.h
  359. mock_vpn_provider.cc
  360. mock_vpn_provider.h
  361. mock_vpn_service.cc
  362. mock_vpn_service.h
  363. mock_wifi.cc
  364. mock_wifi.h
  365. mock_wifi_service.cc
  366. mock_wifi_service.h
  367. mock_wimax.cc
  368. mock_wimax.h
  369. mock_wimax_device_proxy.cc
  370. mock_wimax_device_proxy.h
  371. mock_wimax_manager_proxy.cc
  372. mock_wimax_manager_proxy.h
  373. mock_wimax_network_proxy.cc
  374. mock_wimax_network_proxy.h
  375. mock_wimax_provider.cc
  376. mock_wimax_provider.h
  377. mock_wimax_service.cc
  378. mock_wimax_service.h
  379. modem.cc
  380. modem.h
  381. modem_1.cc
  382. modem_1_unittest.cc
  383. modem_cdma_proxy.cc
  384. modem_cdma_proxy.h
  385. modem_cdma_proxy_interface.h
  386. modem_classic.cc
  387. modem_gobi_proxy.cc
  388. modem_gobi_proxy.h
  389. modem_gobi_proxy_interface.h
  390. modem_gsm_card_proxy.cc
  391. modem_gsm_card_proxy.h
  392. modem_gsm_card_proxy_interface.h
  393. modem_gsm_network_proxy.cc
  394. modem_gsm_network_proxy.h
  395. modem_gsm_network_proxy_interface.h
  396. modem_info.cc
  397. modem_info.h
  398. modem_info_unittest.cc
  399. modem_manager.cc
  400. modem_manager.h
  401. modem_manager_1.cc
  402. modem_manager_proxy.cc
  403. modem_manager_proxy.h
  404. modem_manager_proxy_interface.h
  405. modem_manager_unittest.cc
  406. modem_proxy.cc
  407. modem_proxy.h
  408. modem_proxy_interface.h
  409. modem_simple_proxy.cc
  410. modem_simple_proxy.h
  411. modem_simple_proxy_interface.h
  412. modem_unittest.cc
  413. netlink_socket.cc
  414. netlink_socket.h
  415. nice_mock_control.cc
  416. nice_mock_control.h
  417. nl80211_attribute.cc
  418. nl80211_attribute.h
  419. nl80211_socket.cc
  420. nl80211_socket.h
  421. nss.cc
  422. nss.h
  423. nss_unittest.cc
  424. openvpn_driver.cc
  425. openvpn_driver.h
  426. openvpn_driver_unittest.cc
  427. openvpn_management_server.cc
  428. openvpn_management_server.h
  429. openvpn_management_server_unittest.cc
  430. portal_detector.cc
  431. portal_detector.h
  432. portal_detector_unittest.cc
  433. power_manager.cc
  434. power_manager.h
  435. power_manager_proxy.cc
  436. power_manager_proxy.h
  437. power_manager_proxy_interface.h
  438. power_manager_unittest.cc
  439. process_killer.cc
  440. process_killer.h
  441. process_killer_unittest.cc
  442. profile.cc
  443. profile.h
  444. profile_dbus_adaptor.cc
  445. profile_dbus_adaptor.h
  446. profile_dbus_property_exporter.cc
  447. profile_dbus_property_exporter.h
  448. profile_dbus_property_exporter_unittest.cc
  449. profile_unittest.cc
  450. property_accessor.h
  451. property_accessor_unittest.cc
  452. property_iterator.h
  453. property_store.cc
  454. property_store.h
  455. property_store_inspector.cc
  456. property_store_inspector.h
  457. property_store_unittest.cc
  458. property_store_unittest.h
  459. provider_db_unittest.bfd
  460. proxy_factory.cc
  461. proxy_factory.h
  462. refptr_types.h
  463. resolver.cc
  464. resolver.h
  465. resolver_unittest.cc
  466. routing_table.cc
  467. routing_table.h
  468. routing_table_entry.h
  469. routing_table_unittest.cc
  470. rpc_task.cc
  471. rpc_task.h
  472. rpc_task_dbus_adaptor.cc
  473. rpc_task_dbus_adaptor.h
  474. rpc_task_unittest.cc
  475. rtnl_handler.cc
  476. rtnl_handler.h
  477. rtnl_handler_unittest.cc
  478. rtnl_listener.cc
  479. rtnl_listener.h
  480. rtnl_listener_unittest.cc
  481. rtnl_message.cc
  482. rtnl_message.h
  483. rtnl_message_unittest.cc
  484. scope_logger.cc
  485. scope_logger.h
  486. scope_logger_unittest.cc
  487. service.cc
  488. service.h
  489. service_dbus_adaptor.cc
  490. service_dbus_adaptor.h
  491. service_sorter.h
  492. service_under_test.cc
  493. service_under_test.h
  494. service_unittest.cc
  495. shill_ares.cc
  496. shill_ares.h
  497. shill_config.cc
  498. shill_config.h
  499. shill_daemon.cc
  500. shill_daemon.h
  501. shill_main.cc
  502. shill_test_config.cc
  503. shill_test_config.h
  504. shill_time.cc
  505. shill_time.h
  506. shill_unittest.cc
  507. sockets.cc
  508. sockets.h
  509. static_ip_parameters.cc
  510. static_ip_parameters.h
  511. static_ip_parameters_unittest.cc
  512. store_interface.h
  513. supplicant_bss_proxy.cc
  514. supplicant_bss_proxy.h
  515. supplicant_bss_proxy_interface.h
  516. supplicant_interface_proxy.cc
  517. supplicant_interface_proxy.h
  518. supplicant_interface_proxy_interface.h
  519. supplicant_network_proxy.cc
  520. supplicant_network_proxy.h
  521. supplicant_network_proxy_interface.h
  522. supplicant_process_proxy.cc
  523. supplicant_process_proxy.h
  524. supplicant_process_proxy_interface.h
  525. technology.cc
  526. technology.h
  527. technology_unittest.cc
  528. TESTING
  529. testrunner.cc
  530. user_bound_nlmessage.cc
  531. user_bound_nlmessage.h
  532. virtio_ethernet.cc
  533. virtio_ethernet.h
  534. vpn.cc
  535. vpn.h
  536. vpn_driver.cc
  537. vpn_driver.h
  538. vpn_driver_unittest.cc
  539. vpn_provider.cc
  540. vpn_provider.h
  541. vpn_provider_unittest.cc
  542. vpn_service.cc
  543. vpn_service.h
  544. vpn_service_unittest.cc
  545. vpn_unittest.cc
  546. wifi.cc
  547. wifi.h
  548. wifi_endpoint.cc
  549. wifi_endpoint.h
  550. wifi_endpoint_unittest.cc
  551. wifi_service.cc
  552. wifi_service.h
  553. wifi_service_unittest.cc
  554. wifi_unittest.cc
  555. wimax.cc
  556. wimax.h
  557. wimax_device_proxy.cc
  558. wimax_device_proxy.h
  559. wimax_device_proxy_interface.h
  560. wimax_manager_proxy.cc
  561. wimax_manager_proxy.h
  562. wimax_manager_proxy_interface.h
  563. wimax_network_proxy.cc
  564. wimax_network_proxy.h
  565. wimax_network_proxy_interface.h
  566. wimax_provider.cc
  567. wimax_provider.h
  568. wimax_provider_unittest.cc
  569. wimax_service.cc
  570. wimax_service.h
  571. wimax_service_unittest.cc
  572. wimax_unittest.cc
  573. wpa_supplicant.cc
  574. wpa_supplicant.h