shill: vpn: Add PKCS#11 to OpenVPN.
This includes both setting up relevant openvpn options and passing a TPM token /
pin through the management interface. Also, refactor a bit the InitOptions code
to ease testing and readability and some OpenVPNDriver unit test cleanup.
BUG=chromium-os:28948
TEST=unit tests
Change-Id: Iff65d9b4ae29defdf02f1da4ebb4845d1050e144
Reviewed-on: https://gerrit.chromium.org/gerrit/19587
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/openvpn_driver.h b/openvpn_driver.h
index 7d657de..c325b10 100644
--- a/openvpn_driver.h
+++ b/openvpn_driver.h
@@ -90,8 +90,11 @@
FRIEND_TEST(OpenVPNDriverTest, ConnectTunnelFailure);
FRIEND_TEST(OpenVPNDriverTest, Disconnect);
FRIEND_TEST(OpenVPNDriverTest, GetRouteOptionEntry);
+ FRIEND_TEST(OpenVPNDriverTest, InitManagementChannelOptions);
+ FRIEND_TEST(OpenVPNDriverTest, InitNSSOptions);
FRIEND_TEST(OpenVPNDriverTest, InitOptions);
FRIEND_TEST(OpenVPNDriverTest, InitOptionsNoHost);
+ FRIEND_TEST(OpenVPNDriverTest, InitPKCS11Options);
FRIEND_TEST(OpenVPNDriverTest, Notify);
FRIEND_TEST(OpenVPNDriverTest, NotifyFail);
FRIEND_TEST(OpenVPNDriverTest, OnOpenVPNDied);
@@ -136,6 +139,10 @@
IPConfig::Properties *properties);
void InitOptions(std::vector<std::string> *options, Error *error);
+ bool InitNSSOptions(std::vector<std::string> *options, Error *error);
+ void InitPKCS11Options(std::vector<std::string> *options);
+ bool InitManagementChannelOptions(
+ std::vector<std::string> *options, Error *error);
bool PinHostRoute(const IPConfig::Properties &properties);