Work around a Portal bug that littered some credential files with cruft in front...
authorDan Breslau <dbreslau@painless-security.com>
Tue, 25 Oct 2016 21:24:30 +0000 (17:24 -0400)
committerDan Breslau <dbreslau@painless-security.com>
Tue, 25 Oct 2016 21:24:30 +0000 (17:24 -0400)
src/moonshot-id.vala

index 3a0f960..dec6777 100644 (file)
@@ -66,6 +66,13 @@ public class TrustAnchor : Object
 
         // If we're reading from store, this will be overridden (see set_datetime_added)
         _datetime_added = "";
+
+        // Work around a Portal bug that littered some credential files with this cruft.
+        string cruft = 
+"""<!-- Remove the begin and end lines from the PEM output of
+openssl to produce this format.  Alternatively, base64 encode a DER format certificate -->""";
+        _ca_cert = _ca_cert.replace(cruft, "");
+        stdout.printf("ca_cert is now " + _ca_cert + "\n");
     }
 
     public TrustAnchor.empty() {