aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2008-03-03 23:50:22 +0000
committerRob Austein <sra@hactrn.net>2008-03-03 23:50:22 +0000
commit6a44193684736e4c9b363543d05e4895fac03cf7 (patch)
tree95f5e4dcb55022314961cb7a3a4c716ca77d56f2
parent63b77270a6657a1ca091e147c535851e795b710b (diff)
Checkpoint
svn path=/rpkid/rpki/left_right.py; revision=1544
-rw-r--r--rpkid/rpki/left_right.py13
-rw-r--r--rpkid/rpki/roa.py20
2 files changed, 32 insertions, 1 deletions
diff --git a/rpkid/rpki/left_right.py b/rpkid/rpki/left_right.py
index 8a5e3433..66bfa8d1 100644
--- a/rpkid/rpki/left_right.py
+++ b/rpkid/rpki/left_right.py
@@ -855,6 +855,19 @@ class route_origin_elt(data_elt):
"""Generate <route_origin/> element."""
return self.make_elt()
+ def generate_roa(self, gctx):
+ """Generate a ROA based on this <route_origin/> object."""
+ content = rpki.roa.RouteOriginAttestation()
+ content.version.set(0)
+ content.asID.set(self.as_number)
+ content.exactMatch.set(self.exact_match)
+
+ # Probably want to (tags-query-replace "to_tuple" "to_rfc3779_tuple")
+ # then create parallel functions "to_roa_tuple" (or whatever) for
+ # use here, since syntax is similar but not identical.
+
+ raise rpki.exceptions.NotImplementedYet
+
class list_resources_elt(base_elt):
"""<list_resources/> element."""
diff --git a/rpkid/rpki/roa.py b/rpkid/rpki/roa.py
index d139c7c3..4c59e654 100644
--- a/rpkid/rpki/roa.py
+++ b/rpkid/rpki/roa.py
@@ -18,12 +18,30 @@
At the moment this is just the ASN.1 encoder.
-This corresponds to draft-ietf-sidr-roa-format-01, which is a work in
+This corresponds to draft-ietf-sidr-roa-format-02, which is a work in
progress, so this may need updating later.
"""
from POW._der import *
+# draft-ietf-sidr-roa-format-02 2.1.3.2
+#
+# RouteOriginAttestation ::= SEQUENCE {
+# version [0] INTEGER DEFAULT 0,
+# asID ASID,
+# exactMatch BOOLEAN
+# ipAddrBlocks ROAIPAddrBlocks }
+#
+# ASID ::= INTEGER
+#
+# ROAIPAddrBlocks ::= SEQUENCE of ROAIPAddressFamily
+#
+# ROAIPAddressFamily ::= SEQUENCE {
+# addressFamily OCTET STRING (SIZE (2..3)),
+# addresses SEQUENCE OF IPAddress }
+#
+# IPAddress ::= BIT STRING
+
class IPAddresses(SequenceOf):
def __init__(self, optional=0, default=''):
SequenceOf.__init__(self, BitString, optional, default)