shill: Move Populate8021xProperties() to wpa_supplicant
In anticipation of using wpa_supplicant in other places than WiFi,
allow 802.1x configuration for wpa_supplicant to be used in other
places than WiFi Services. This involves the following steps:
- Change shill:wpa_supplicant namespace into a shill::WPASupplicant
class. There's a lot of rote renaming as a result of this.
- Move the EAPCredentials struct out of Service, and into its own
top level. A few bits of renaming here too.
- Move Populate8021xProperties() out of WiFiService and into
a static method in WPASupplicant.
- Make a unit test for WPASupplicant and move the Populate* tests
from WiFiServiceTest into it.
BUG=chromium:224090
TEST=Unit tests, USE=clang FEATURES=test emerge-lumpy shill,
amd64-generic-asan trybot
Change-Id: Icdd5316d77a13e75c3ae164ace02508d00933131
Reviewed-on: https://gerrit.chromium.org/gerrit/46679
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
diff --git a/service.h b/service.h
index c0f1272..3569a2c 100644
--- a/service.h
+++ b/service.h
@@ -22,6 +22,7 @@
#include "shill/adaptor_interfaces.h"
#include "shill/accessor_interface.h"
#include "shill/callbacks.h"
+#include "shill/eap_credentials.h"
#include "shill/property_store.h"
#include "shill/refptr_types.h"
#include "shill/shill_time.h"
@@ -136,47 +137,6 @@
kCryptoRc4,
kCryptoAes
};
- struct EapCredentials {
- EapCredentials() : use_system_cas(true) {}
- // Who we identify ourselves as to the EAP authenticator.
- std::string identity;
- // The outer or only EAP authetnication type.
- std::string eap;
- // The inner EAP authentication type.
- std::string inner_eap;
- // When there is an inner EAP type, use this identity for the outer.
- std::string anonymous_identity;
- // Filename of the client certificate.
- std::string client_cert;
- // Locator for the client certificate within the security token.
- std::string cert_id;
- // Filename of the client private key.
- std::string private_key;
- // Password for decrypting the client private key file.
- std::string private_key_password;
- // Locator for the client private key within the security token.
- std::string key_id;
- // Filename of the certificate authority (CA) certificate.
- std::string ca_cert;
- // Locator for the CA certificate within the security token.
- std::string ca_cert_id;
- // Locator for the CA certificate within the user NSS database.
- std::string ca_cert_nss;
- // Raw PEM contents of the CA certificate.
- std::string ca_cert_pem;
- // If true, use the system-wide CA database to authenticate the remote.
- bool use_system_cas;
- // PIN code for accessing the security token.
- std::string pin;
- // Password to use for EAP methods which require one.
- std::string password;
- // Key management algorithm to use after EAP succeeds.
- std::string key_management;
- // If non-empty, string to match remote subject against before connecting.
- std::string subject_match;
- // List of subject names reported by remote entity during TLS setup.
- std::vector<std::string> remote_certification;
- };
static const int kPriorityNone;