diff options
Diffstat (limited to 'scripts/rpki')
-rw-r--r-- | scripts/rpki/left_right.py | 7 | ||||
-rw-r--r-- | scripts/rpki/up_down.py | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/scripts/rpki/left_right.py b/scripts/rpki/left_right.py index 94022985..e1ab3e2a 100644 --- a/scripts/rpki/left_right.py +++ b/scripts/rpki/left_right.py @@ -582,7 +582,12 @@ class parent_elt(data_elt): sender = self.sender_name, recipient = self.recipient_name) q_elt = q_msg.toXML() - rpki.relaxng.up_down.assertValid(q_elt) + try: + rpki.relaxng.up_down.assertValid(q_elt) + except lxml.etree.DocumentInvalid: + print "Message does not pass schema check:" + print lxml.etree.tostring(q_elt, pretty_print = True) + raise q_cms = rpki.cms.xml_sign(q_elt, bsc.private_key_id, bsc.signing_cert, encoding = "UTF-8") r_cms = rpki.https.client(x509TrustList = rpki.x509.X509_chain(self.https_ta), privateKey = gctx.https_key, diff --git a/scripts/rpki/up_down.py b/scripts/rpki/up_down.py index 1e14a422..b8a267ef 100644 --- a/scripts/rpki/up_down.py +++ b/scripts/rpki/up_down.py @@ -481,6 +481,10 @@ class message_pdu(base_elt): def make_query(cls, payload, sender, recipient): """Construct one message PDU.""" assert not cls.type2name[type(payload)].endswith("_response") + if sender is None: + sender = "tweedledee" + if recipient is None: + recipient = "tweedledum" self = cls() self.sender = sender self.recipient = recipient |