File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 66
77use SimpleSAML \Assert \Assert ;
88use SimpleSAML \SAML2 \Compat \ContainerSingleton ;
9+ use SimpleSAML \SAML2 \Exception \ProtocolViolationException ;
910use SimpleSAML \XMLSecurity \Exception \ReferenceValidationFailedException ;
1011use SimpleSAML \XMLSecurity \XML \ds \Signature ;
1112use SimpleSAML \XMLSecurity \XML \SignedElementTrait as BaseSignedElementTrait ;
@@ -46,6 +47,18 @@ protected function setSignature(Signature $signature): void
4647 ReferenceValidationFailedException::class,
4748 );
4849
50+ /**
51+ * E91: Disallow <ds:Object> element in signatures
52+ *
53+ * The <ds:Object> element is not defined for use with SAML signatures, and SHOULD NOT be present.
54+ */
55+
56+ Assert::isEmpty (
57+ $ signature ->getObjects (),
58+ ProtocolViolationException::class,
59+ 'The <ds:Object> element is not defined for use with SAML signatures, and SHOULD NOT be present. ' ,
60+ );
61+
4962 $ this ->signature = $ signature ;
5063 }
5164
You can’t perform that action at this time.
0 commit comments