1111use SimpleSAML \Configuration ;
1212use SimpleSAML \Logger ;
1313use SimpleSAML \Module ;
14+ use SimpleSAML \SAML2 \Constants as C_SAML2 ;
1415use SimpleSAML \SAML2 \Exception \ArrayValidationException ;
1516use SimpleSAML \SAML2 \XML \md \AbstractMetadataDocument ;
1617use SimpleSAML \SAML2 \XML \md \ContactPerson ;
2627use SimpleSAML \SAML2 \XML \saml \AttributeValue ;
2728use SimpleSAML \SAML2 \XML \shibmd \Scope ;
2829use SimpleSAML \Utils ;
29- use SimpleSAML \WSSecurity \Constants as C ;
30- use SimpleSAML \WSSecurity \XML \fed \PassiveRequestorEndpoint ;
31- use SimpleSAML \WSSecurity \XML \fed \SecurityTokenServiceEndpoint ;
32- use SimpleSAML \WSSecurity \XML \fed \SecurityTokenServiceType ;
33- use SimpleSAML \WSSecurity \XML \fed \TokenType ;
34- use SimpleSAML \WSSecurity \XML \fed \TokenTypesOffered ;
35- use SimpleSAML \WSSecurity \XML \wsa_200508 \Address ;
36- use SimpleSAML \WSSecurity \XML \wsa_200508 \EndpointReference ;
30+ use SimpleSAML \WebServices \Addressing \XML \wsa_200508 \Address ;
31+ use SimpleSAML \WebServices \Addressing \XML \wsa_200508 \EndpointReference ;
32+ use SimpleSAML \WebServices \Federation \Constants as C_FED ;
33+ use SimpleSAML \WebServices \Federation \XML \fed \PassiveRequestorEndpoint ;
34+ use SimpleSAML \WebServices \Federation \XML \fed \SecurityTokenServiceEndpoint ;
35+ use SimpleSAML \WebServices \Federation \XML \fed \SecurityTokenServiceType ;
36+ use SimpleSAML \WebServices \Federation \XML \fed \TokenType ;
37+ use SimpleSAML \WebServices \Federation \XML \fed \TokenTypesOffered ;
38+ use SimpleSAML \WebServices \Trust \Constants as C_TRUST ;
3739use SimpleSAML \XML \Chunk ;
40+ use SimpleSAML \XMLSecurity \Constants as C_XMLSEC ;
3841use SimpleSAML \XMLSecurity \Alg \Signature \SignatureAlgorithmFactory ;
3942use SimpleSAML \XMLSecurity \Key \PrivateKey ;
4043use SimpleSAML \XMLSecurity \XML \ds \KeyInfo ;
@@ -110,7 +113,7 @@ protected function signDocument(AbstractMetadataDocument $document): AbstractMet
110113 /** @var array<mixed> $keyArray */
111114 $ keyArray = $ cryptoUtils ->loadPrivateKey ($ this ->config , true , 'metadata.sign. ' );
112115 $ certArray = $ cryptoUtils ->loadPublicKey ($ this ->config , false , 'metadata.sign. ' );
113- $ algo = $ this ->config ->getOptionalString ('metadata.sign.algorithm ' , C ::SIG_RSA_SHA256 );
116+ $ algo = $ this ->config ->getOptionalString ('metadata.sign.algorithm ' , C_XMLSEC ::SIG_RSA_SHA256 );
114117
115118 $ key = PrivateKey::fromFile ($ keyArray ['PEM ' ], $ keyArray ['password ' ] ?? '' );
116119 $ signer = (new SignatureAlgorithmFactory ())->getAlgorithm ($ algo , $ key );
@@ -124,7 +127,7 @@ protected function signDocument(AbstractMetadataDocument $document): AbstractMet
124127 ]);
125128 }
126129
127- $ document ->sign ($ signer , C ::C14N_EXCLUSIVE_WITHOUT_COMMENTS , $ keyInfo );
130+ $ document ->sign ($ signer , C_XMLSEC ::C14N_EXCLUSIVE_WITHOUT_COMMENTS , $ keyInfo );
128131 return $ document ;
129132 }
130133
@@ -197,7 +200,7 @@ public function getSecurityTokenService(): SecurityTokenServiceType
197200 $ defaultEndpoint = Module::getModuleURL ('adfs ' ) . '/idp/prp.php ' ;
198201
199202 return new SecurityTokenServiceType (
200- protocolSupportEnumeration: [C ::NS_TRUST_200512 , C ::NS_TRUST_200502 , C ::NS_FED ],
203+ protocolSupportEnumeration: [C_TRUST ::NS_TRUST_200512 , C_TRUST ::NS_TRUST_200502 , C_FED ::NS_FED ],
201204 keyDescriptors: $ this ->getKeyDescriptor (),
202205 tokenTypesOffered: new TokenTypesOffered ([new TokenType ('urn:oasis:names:tc:SAML:1.0:assertion ' )]),
203206 securityTokenServiceEndpoint: [
@@ -299,13 +302,13 @@ private function getExtensions(): ?Extensions
299302 if (preg_match ('/^\{(.*?)\}(.*)$/ ' , $ attributeName , $ matches )) {
300303 $ attr [] = new Attribute (
301304 name: $ matches [2 ],
302- nameFormat: $ matches [1 ] === C ::NAMEFORMAT_UNSPECIFIED ? null : $ matches [1 ],
305+ nameFormat: $ matches [1 ] === C_SAML2 ::NAMEFORMAT_UNSPECIFIED ? null : $ matches [1 ],
303306 attributeValue: $ attrValues ,
304307 );
305308 } else {
306309 $ attr [] = new Attribute (
307310 name: $ attributeName ,
308- nameFormat: C ::NAMEFORMAT_UNSPECIFIED ,
311+ nameFormat: C_SAML2 ::NAMEFORMAT_UNSPECIFIED ,
309312 attributeValue: $ attrValues ,
310313 );
311314 }
0 commit comments