shill: L2TPIpsecDriver: Use PEM arrays for CACertPEM

Switch the "CACertPEM" option to use a string array of PEM.
strongSwan is equally capable of accepting PEM and DER
certificates in its CA certificate store.  Since it's not easy
to export multiple certificates in a single DER file, use
a PEM file instead of DER for the output file in the CaCertPEM
case.  Since this is the last user of CreateDERFromString(),
remove this method from CertificateFile.  Since we no longer
generate DER, there is no longer a need for CertificateFile
to hold a GLib instance.

CQ-DEPEND=CL:60542
BUG=chromium:249363
TEST=Unit tests.

Change-Id: I9acde1f165006458ea0e1cd34e5037fad4784feb
Reviewed-on: https://gerrit.chromium.org/gerrit/60557
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/l2tp_ipsec_driver_unittest.cc b/l2tp_ipsec_driver_unittest.cc
index fb3f61b..7de16b0 100644
--- a/l2tp_ipsec_driver_unittest.cc
+++ b/l2tp_ipsec_driver_unittest.cc
@@ -79,6 +79,10 @@
     driver_->args()->SetString(arg, value);
   }
 
+  void SetArgArray(const string &arg, const vector<string> &value) {
+    driver_->args()->SetStrings(arg, value);
+  }
+
   KeyValueStore *GetArgs() {
     return driver_->args();
   }
@@ -300,12 +304,12 @@
 }
 
 TEST_F(L2TPIPSecDriverTest, InitPEMOptions) {
-  static const char kCaCertPEM[] = "Insert PEM encoded data here";
+  const vector<string> kCaCertPEM{ "Insert PEM encoded data here" };
   static const char kPEMCertfile[] = "/tmp/der-file-from-pem-cert";
   FilePath empty_cert;
   FilePath pem_cert(kPEMCertfile);
-  SetArg(kL2tpIpsecCaCertPemProperty, kCaCertPEM);
-  EXPECT_CALL(*certificate_file_, CreateDERFromString(kCaCertPEM))
+  SetArgArray(kL2tpIpsecCaCertPemProperty, kCaCertPEM);
+  EXPECT_CALL(*certificate_file_, CreatePEMFromStrings(kCaCertPEM))
       .WillOnce(Return(empty_cert))
       .WillOnce(Return(pem_cert));