diff options
author | Rob Austein <sra@hactrn.net> | 2015-10-19 23:25:00 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2015-10-19 23:25:00 +0000 |
commit | eaac28dcf97164e51dca26018c83688cf230d8e7 (patch) | |
tree | a96ca5eaf9b80fcdd3b99e3db848f64fdcc461ab /potpourri | |
parent | 3c3d720c291158ddcba476c43da5fc9de4e1c136 (diff) |
XSL transform to translate basic subset of OOB prototocol from old
"myrpki" to new IETF standards track I-D syntax.
svn path=/branches/tk705/; revision=6131
Diffstat (limited to 'potpourri')
-rw-r--r-- | potpourri/oob-translate.xsl | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/potpourri/oob-translate.xsl b/potpourri/oob-translate.xsl new file mode 100644 index 00000000..b1c7590c --- /dev/null +++ b/potpourri/oob-translate.xsl @@ -0,0 +1,78 @@ +<!-- $Id$ --> +<!-- + - Translate between old "myrpki" XML and current IETF standards + - track out-of-band-setup protocol XML. Well, partially. Much of + - the old protocol is either irrelevant or can't be translated due + - to embedded signatures, but the subset that other implementations + - implement is small enough that we can fake something workable. + --> + +<xsl:transform xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" + xmlns:myrpki = "http://www.hactrn.net/uris/rpki/myrpki/" + xmlns:oob = "http://www.hactrn.net/uris/rpki/rpki-setup/" + version = "1.0"> + + <xsl:output omit-xml-declaration = "yes" + indent = "yes" + method = "xml" + encoding = "US-ASCII"/> + + <!-- Versions of the respective protocols --> + + <xsl:param name = "myrpki-version" select = "2"/> + <xsl:param name = "oob-version" select = "1"/> + + <!-- Translate an old-style identity to a new-style child_request --> + + <xsl:template match = "/myrpki:identity"> + <oob:child_request version = "{$oob-version}" child_handle = "{@handle}"> + <oob:child_bpki_ta> + <xsl:value-of select = "myrpki:bpki_ta"/> + </oob:child_bpki_ta> + </oob:child_request> + </xsl:template> + + <!-- Translate a new-style child_request to an old style identity --> + + <xsl:template match = "/oob:child_request"> + <myrpki:identity version = "{$myrpki-version}" handle = "{@child_handle}"> + <myrpki:bpki_ta> + <xsl:value-of select = "oob:child_bpki_ta"/> + </myrpki:bpki_ta> + </myrpki:identity> + </xsl:template> + + <!-- Translate an old-style parent response to a new-style parent_response --> + <!-- Referrals are not translatable due to embedded signatures --> + + <xsl:template match = "/myrpki:parent"> + <oob:parent_response version = "{$oob-version}" + service_uri = "{@service_uri}" + child_handle = "{@child_handle}" + parent_handle = "{@parent_handle}"> + <oob:parent_bpki_ta> + <xsl:value-of select = "myrpki:bpki_resource_ta"/> + </oob:parent_bpki_ta> + <xsl:if test = "repository[@type = 'offer']"> + <oob:offer/> + </xsl:if> + </oob:parent_response> + </xsl:template> + + <!-- Translate a new-style parent_response to an old-style parent response --> + <!-- Referrals are not translatable due to embedded signatures --> + + <xsl:template match = "/oob:parent_response"> + <myrpki:parent version = "{$myrpki-version}" + service_uri = "{@service_uri}" + child_handle = "{@child_handle}" + parent_handle = "{@parent_handle}"> + <myrpki:bpki_resource_ta> + <xsl:value-of select = "oob:parent_bpki_ta"/> + </myrpki:bpki_resource_ta> + <myrpki:bpki_child_ta/> + <myrpki:repository type = "none"/> + </myrpki:parent> + </xsl:template> + +</xsl:transform> |