[webp] Trust anchor information in.
authorAlberto Ruiz <aruiz@gnome.org>
Wed, 6 Jul 2011 11:36:38 +0000 (12:36 +0100)
committerAlberto Ruiz <aruiz@gnome.org>
Wed, 6 Jul 2011 11:38:00 +0000 (12:38 +0100)
example/sample.xml
src/moonshot-webp-parser.vala

index 50feee4..432c429 100644 (file)
@@ -23,7 +23,7 @@
       <subject>Foo</subject>
       <subject-alt>Bar</subject-alt>
       <!-- Or alternatively -->
-      <srv-cert>ABCDEFGHIJKLMNOPQRSTUVWXYZ123455678910</srv-cert>
+      <server-cert>ABCDEFGHIJKLMNOPQRSTUVWXYZ123455678910</server-cert>
     </trust-anchor>
   </identity>
 </identities> 
index 70eee92..4d7969c 100644 (file)
@@ -18,6 +18,14 @@ namespace WebProvisioning
   }
 
   bool
+  server_cert_handler (SList<string> stack)
+  {
+    string[] server_cert_path = {"server-cert", "trust-anchor", "identity", "identities"};
+    
+    return check_stack (stack, server_cert_path);
+  }
+
+  bool
   subject_alt_handler (SList<string> stack)
   {
     string[] subject_alt_path = {"subject-alt", "trust-anchor", "identity", "identities"};
@@ -123,9 +131,15 @@ namespace WebProvisioning
     }
     else if (stack.nth_data(0) == "subject" && subject_handler (stack))
     {
+      card.trust_anchor.subject = text;
     }
     else if (stack.nth_data(0) == "subject-alt" && subject_alt_handler (stack))
     {
+      card.trust_anchor.subject_alt = text;
+    }
+    else if (stack.nth_data(0) == "server-cert" && server_cert_handler (stack))
+    {
+      card.trust_anchor.server_cert = text;
     }
   }