diff options
author | Rob Austein <sra@hactrn.net> | 2010-03-14 22:41:37 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2010-03-14 22:41:37 +0000 |
commit | 5511a9b6b601f55cbe1b776b3edbb96a308f4178 (patch) | |
tree | 8f5db441c2dc0d0267be6b05f998672b7bc75cec /myrpki.rototill | |
parent | 7b3aabb27eea488b7e6e16270a487bc795957a66 (diff) |
Cleanup
svn path=/myrpki.rototill/convert-from-csv-to-entitydb.py; revision=3092
Diffstat (limited to 'myrpki.rototill')
-rw-r--r-- | myrpki.rototill/convert-from-csv-to-entitydb.py | 2 | ||||
-rw-r--r-- | myrpki.rototill/myrpki.py | 3 | ||||
-rw-r--r-- | myrpki.rototill/myrpki.rnc | 57 | ||||
-rw-r--r-- | myrpki.rototill/myrpki.rng | 123 |
4 files changed, 74 insertions, 111 deletions
diff --git a/myrpki.rototill/convert-from-csv-to-entitydb.py b/myrpki.rototill/convert-from-csv-to-entitydb.py index cb49c7a9..7f7ede15 100644 --- a/myrpki.rototill/convert-from-csv-to-entitydb.py +++ b/myrpki.rototill/convert-from-csv-to-entitydb.py @@ -88,7 +88,6 @@ if os.path.exists("parents.csv"): client_handle = client_handle, service_uri = "https://%s:%s/client/%s" % (pubd_server_host, pubd_server_port, client_handle), sia_base = parent_sia_base, - repository_handle = client_handle.split("/")[0], type = "confirmed") myrpki.PEMElement(e, "bpki_server_ta", repository_bpki_certificate) myrpki.PEMElement(e, "bpki_client_ta", bpki_resources_pemfile) @@ -105,7 +104,6 @@ if os.path.exists("pubclients.csv"): client_handle = client_handle, service_uri = "https://%s:%s/client/%s" % (pubd_server_host, pubd_server_port, client_handle), sia_base = client_sia_base, - repository_handle = client_handle.split("/")[0], type = "confirmed") myrpki.PEMElement(e, "bpki_server_ta", bpki_servers_pemfile) myrpki.PEMElement(e, "bpki_client_ta", client_resource_pemfile) diff --git a/myrpki.rototill/myrpki.py b/myrpki.rototill/myrpki.py index eec0fd74..60312bd0 100644 --- a/myrpki.rototill/myrpki.py +++ b/myrpki.rototill/myrpki.py @@ -1132,7 +1132,6 @@ class main(rpki.cli.Cmd): self.bpki_servers.fxcert(client.findtext("bpki_client_ta")) e = Element("repository", type = "confirmed", - repository_handle = self.handle, client_handle = client_handle, parent_handle = parent_handle, sia_base = sia_base, @@ -1165,7 +1164,7 @@ class main(rpki.cli.Cmd): parent_handle = r.get("parent_handle") - print "Repository calls itself %r, calls us %r" % (r.get("repository_handle"), r.get("client_handle")) + print "Repository calls us %r" % (r.get("client_handle")) print "Repository response associated with parent_handle %r" % parent_handle etree_write(r, self.entitydb("repositories", "%s.xml" % parent_handle)) diff --git a/myrpki.rototill/myrpki.rnc b/myrpki.rototill/myrpki.rnc index 5f3c5077..0a752571 100644 --- a/myrpki.rototill/myrpki.rnc +++ b/myrpki.rototill/myrpki.rnc @@ -19,16 +19,6 @@ ipv4_list = xsd:string { maxLength="512000" pattern="[\-,0-9/.]*" } ipv6_list = xsd:string { maxLength="512000" pattern="[\-,0-9/:a-fA-F]*" } timestamp = xsd:dateTime { pattern=".*Z" } -authorization = element authorization { - attribute referrer { pubd_handle }, - base64 -} - -contact_info = element contact_info { - attribute uri { uri }?, - xsd:string -} - start |= element myrpki { attribute version { version }, attribute handle { object_handle }, @@ -72,6 +62,21 @@ start |= element identity { element bpki_ta { base64 } } +authorization = element authorization { + attribute referrer { pubd_handle }, + base64 +} + +contact_info = element contact_info { + attribute uri { uri }?, + xsd:string +} + +repository_payload = ( + (attribute type { "offer" }) | + (attribute type { "referral" }, authorization, contact_info) +) + start |= element parent { attribute version { version }, attribute valid_until { timestamp }, @@ -81,41 +86,27 @@ start |= element parent { element bpki_resource_ta { base64 }, element bpki_server_ta { base64 }, element bpki_child_ta { base64 }, - element repository { - (attribute type { "offer" }) | - (attribute type { "referral" }, authorization, contact_info) - }? + element repository { repository_payload }? } start |= element repository { attribute version { version }, - attribute type { "confirmed" }, - attribute parent_handle { object_handle }, - attribute client_handle { pubd_handle }, - attribute service_uri { uri }, - attribute sia_base { uri }, - attribute repository_handle { object_handle }, - element bpki_server_ta { base64 }, - element bpki_client_ta { base64 }, - contact_info? -} - -start |= element repository { - attribute version { version }, - attribute type { "offer" }, attribute handle { object_handle }, attribute parent_handle { object_handle }, + repository_payload, element bpki_client_ta { base64 } } start |= element repository { attribute version { version }, - attribute type { "referral" }, - attribute handle { object_handle }, + attribute type { "confirmed" }, attribute parent_handle { object_handle }, - authorization, - contact_info?, - element bpki_client_ta { base64 } + attribute client_handle { pubd_handle }, + attribute service_uri { uri }, + attribute sia_base { uri }, + element bpki_server_ta { base64 }, + element bpki_client_ta { base64 }, + contact_info? } start |= element referral { diff --git a/myrpki.rototill/myrpki.rng b/myrpki.rototill/myrpki.rng index b5aa96ae..e9c958ff 100644 --- a/myrpki.rototill/myrpki.rng +++ b/myrpki.rototill/myrpki.rng @@ -59,24 +59,6 @@ <param name="pattern">.*Z</param> </data> </define> - <define name="authorization"> - <element name="authorization"> - <attribute name="referrer"> - <ref name="pubd_handle"/> - </attribute> - <ref name="base64"/> - </element> - </define> - <define name="contact_info"> - <element name="contact_info"> - <optional> - <attribute name="uri"> - <ref name="uri"/> - </attribute> - </optional> - <data type="string"/> - </element> - </define> <start combine="choice"> <element name="myrpki"> <attribute name="version"> @@ -222,6 +204,38 @@ </element> </element> </start> + <define name="authorization"> + <element name="authorization"> + <attribute name="referrer"> + <ref name="pubd_handle"/> + </attribute> + <ref name="base64"/> + </element> + </define> + <define name="contact_info"> + <element name="contact_info"> + <optional> + <attribute name="uri"> + <ref name="uri"/> + </attribute> + </optional> + <data type="string"/> + </element> + </define> + <define name="repository_payload"> + <choice> + <attribute name="type"> + <value>offer</value> + </attribute> + <group> + <attribute name="type"> + <value>referral</value> + </attribute> + <ref name="authorization"/> + <ref name="contact_info"/> + </group> + </choice> + </define> <start combine="choice"> <element name="parent"> <attribute name="version"> @@ -252,18 +266,7 @@ </element> <optional> <element name="repository"> - <choice> - <attribute name="type"> - <value>offer</value> - </attribute> - <group> - <attribute name="type"> - <value>referral</value> - </attribute> - <ref name="authorization"/> - <ref name="contact_info"/> - </group> - </choice> + <ref name="repository_payload"/> </element> </optional> </element> @@ -273,33 +276,16 @@ <attribute name="version"> <ref name="version"/> </attribute> - <attribute name="type"> - <value>confirmed</value> - </attribute> - <attribute name="parent_handle"> + <attribute name="handle"> <ref name="object_handle"/> </attribute> - <attribute name="client_handle"> - <ref name="pubd_handle"/> - </attribute> - <attribute name="service_uri"> - <ref name="uri"/> - </attribute> - <attribute name="sia_base"> - <ref name="uri"/> - </attribute> - <attribute name="repository_handle"> + <attribute name="parent_handle"> <ref name="object_handle"/> </attribute> - <element name="bpki_server_ta"> - <ref name="base64"/> - </element> + <ref name="repository_payload"/> <element name="bpki_client_ta"> <ref name="base64"/> </element> - <optional> - <ref name="contact_info"/> - </optional> </element> </start> <start combine="choice"> @@ -308,40 +294,29 @@ <ref name="version"/> </attribute> <attribute name="type"> - <value>offer</value> - </attribute> - <attribute name="handle"> - <ref name="object_handle"/> + <value>confirmed</value> </attribute> <attribute name="parent_handle"> <ref name="object_handle"/> </attribute> - <element name="bpki_client_ta"> - <ref name="base64"/> - </element> - </element> - </start> - <start combine="choice"> - <element name="repository"> - <attribute name="version"> - <ref name="version"/> - </attribute> - <attribute name="type"> - <value>referral</value> + <attribute name="client_handle"> + <ref name="pubd_handle"/> </attribute> - <attribute name="handle"> - <ref name="object_handle"/> + <attribute name="service_uri"> + <ref name="uri"/> </attribute> - <attribute name="parent_handle"> - <ref name="object_handle"/> + <attribute name="sia_base"> + <ref name="uri"/> </attribute> - <ref name="authorization"/> - <optional> - <ref name="contact_info"/> - </optional> + <element name="bpki_server_ta"> + <ref name="base64"/> + </element> <element name="bpki_client_ta"> <ref name="base64"/> </element> + <optional> + <ref name="contact_info"/> + </optional> </element> </start> <start combine="choice"> |