strip leading and trailing whitespace from cacert on id card load
authorKevin Wasserman <krwasserman@painless-security.com>
Wed, 25 Mar 2015 04:33:38 +0000 (00:33 -0400)
committerKevin Wasserman <krwasserman@painless-security.com>
Wed, 25 Mar 2015 04:33:38 +0000 (00:33 -0400)
src/moonshot-keyring-store.vala
src/moonshot-local-flat-file-store.vala

index f211bd2..ab1ff1e 100644 (file)
@@ -111,7 +111,7 @@ public class KeyringStore : Object, IIdentityCardStore {
                 } else if (attribute.name == "Rules-AlwaysConfirm") {
                     rules_always_confirm_index = i;
                 } else if (attribute.name == "CA-Cert") {
-                    id_card.trust_anchor.ca_cert = value;
+                    id_card.trust_anchor.ca_cert = value.strip();
                 } else if (attribute.name == "Server-Cert") {
                     id_card.trust_anchor.server_cert = value;
                 } else if (attribute.name == "Subject") {
index 0946316..8e4db0a 100644 (file)
@@ -111,7 +111,7 @@ public class LocalFlatFileStore : Object, IIdentityCardStore {
                 }
                 
                 // Trust anchor 
-                id_card.trust_anchor.ca_cert = key_file.get_string (identity, "CA-Cert");
+                id_card.trust_anchor.ca_cert = key_file.get_string (identity, "CA-Cert").strip();
                 id_card.trust_anchor.subject = key_file.get_string (identity, "Subject");
                 id_card.trust_anchor.subject_alt = key_file.get_string (identity, "SubjectAlt");
                 id_card.trust_anchor.server_cert = key_file.get_string (identity, "ServerCert");