From 9f06f4314f1a0480e22992bbb8209a71bc581e05 Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Wed, 24 Apr 2024 07:47:50 -0700 Subject: [PATCH] Add assertion in X509Data construction --- signxml/signer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/signxml/signer.py b/signxml/signer.py index 60708f4..67b4f6f 100644 --- a/signxml/signer.py +++ b/signxml/signer.py @@ -306,6 +306,7 @@ def _add_key_info(self, sig_root, signing_settings: SigningSettings): self._serialize_key_value(signing_settings.key, key_info) if signing_settings.cert_chain is not None: + assert len(signing_settings.cert_chain) > 0 x509_data = SubElement(key_info, ds_tag("X509Data")) for cert in signing_settings.cert_chain: x509_certificate = SubElement(x509_data, ds_tag("X509Certificate"))