Skip to content

Commit c23b5d5

Browse files
committed
Use list addition instead of .append() for to_sign
The signing code expects a flattened list of tuples, not a list which contains a list of tuples. For example, in my case I had: to_sign = [('urn:oasis:names:tc:SAML:2.0:assertion:Assertion', 'id-2d44a290a77c9fe7b50899eea96aa183'), [('urn:oasis:names:tc:SAML:2.0:protocol:Response', 'id-7416bafb9df777c1c1151b6f1ce471bb')]] Fixes: File "/usr/local/lib/python2.7/dist-packages/pysaml2-1.0.2-py2.7.egg/saml2/ent ity.py", line 458, in _response return self.sign(response, to_sign=to_sign) File "/usr/local/lib/python2.7/dist-packages/pysaml2-1.0.2-py2.7.egg/saml2/ent ity.py", line 347, in sign return signed_instance_factory(msg, self.sec, to_sign) File "/usr/local/lib/python2.7/dist-packages/pysaml2-1.0.2-py2.7.egg/saml2/sig ver.py", line 264, in signed_instance_factory for (node_name, nodeid) in elements_to_sign: ValueError: need more than 1 value to unpack
1 parent ab843f5 commit c23b5d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/saml2/entity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def sign(self, msg, mid=None, to_sign=None, sign_prepare=False):
339339
mid = msg.id
340340

341341
try:
342-
to_sign.append([(class_name(msg), mid)])
342+
to_sign += [(class_name(msg), mid)]
343343
except AttributeError:
344344
to_sign = [(class_name(msg), mid)]
345345

0 commit comments

Comments
 (0)