diff options
-rw-r--r-- | rpki/left_right.py | 3 | ||||
-rw-r--r-- | rpki/log.py | 14 | ||||
-rw-r--r-- | rpki/publication.py | 2 | ||||
-rw-r--r-- | rpki/x509.py | 5 |
4 files changed, 22 insertions, 2 deletions
diff --git a/rpki/left_right.py b/rpki/left_right.py index 46aafc6a..ed344a0a 100644 --- a/rpki/left_right.py +++ b/rpki/left_right.py @@ -903,7 +903,8 @@ class parent_elt(data_elt): keypair = ca_detail.private_key_id, is_ca = True, caRepository = ca.sia_uri, - rpkiManifest = ca_detail.manifest_uri) + rpkiManifest = ca_detail.manifest_uri, + rpkiNotify = rpki.publication.rrdp_sia_uri_kludge) q_msg = self._compose_up_down_query("issue") q_pdu = SubElement(q_msg, rpki.up_down.tag_request, class_name = ca.parent_resource_class) q_pdu.text = pkcs10.get_Base64() diff --git a/rpki/log.py b/rpki/log.py index 0794a68f..43561463 100644 --- a/rpki/log.py +++ b/rpki/log.py @@ -265,3 +265,17 @@ def log_repr(obj, *tokens): words.append(" at %#x" % id(obj)) return "<" + " ".join(words) + ">" + + +def show_stack(stack_logger = None): + """ + Log a stack trace. + """ + + if stack_logger is None: + stack_logger = logger + + for frame in tb.format_stack(): + for line in frame.split("\n"): + if line: + stack_logger.debug("%s", line.rstrip()) diff --git a/rpki/publication.py b/rpki/publication.py index 524b5a53..be12ce8a 100644 --- a/rpki/publication.py +++ b/rpki/publication.py @@ -50,7 +50,7 @@ tag_withdraw = rpki.relaxng.publication.xmlns + "withdraw" tag_report_error = rpki.relaxng.publication.xmlns + "report_error" -logger.warning("Horrible kludge: static RRDP URI for testing, this needs to be fixed") +# Horrible kludge: static RRDP URI for testing, this needs to be fixed from socket import getfqdn rrdp_sia_uri_kludge = "http://%s/rrdp/notify.xml" % getfqdn() diff --git a/rpki/x509.py b/rpki/x509.py index 9bc34e19..1b1dafba 100644 --- a/rpki/x509.py +++ b/rpki/x509.py @@ -739,6 +739,10 @@ class X509(DER_object): Common code to issue an RPKI certificate. """ + if not sia or len(sia) != 4 or not sia[3]: + logger.debug("Oops! _issue() sia: %r", sia) + log.show_stack(logger) + now = rpki.sundial.now() ski = subject_key.get_SKI() @@ -784,6 +788,7 @@ class X509(DER_object): assert sia is not None or not is_ca if sia is not None: + logger.debug("_issue() sia: %r", sia) caRepository, rpkiManifest, signedObject, rpkiNotify = sia cert.setSIA( (caRepository,) if isinstance(caRepository, str) else caRepository, |