File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -855,18 +855,19 @@ public function testGenerateNameIdWithSPNameQualifier()
855855 $ this ->assertContains ($ nameidExpectedEnc , $ nameIdEnc );
856856
857857 // Check AES128_GCM support
858-
859- $ nameidExpectedEnc = '<saml:EncryptedID><xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Type="http://www.w3.org/2001/04/xmlenc#Element"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2009/xmlenc11#aes128-gcm"/><dsig:KeyInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><xenc:EncryptedKey><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/><xenc:CipherData><xenc:CipherValue> ' ;
860-
861- $ nameIdEnc = Utils::generateNameId (
862- $ nameIdValue ,
863- $ entityId ,
864- $ nameIDFormat ,
865- $ key ,
866- null ,
867- XMLSecurityKey::AES128_GCM
868- );
869- $ this ->assertContains ($ nameidExpectedEnc , $ nameIdEnc );
858+ if (in_array ("aes-128-gcm " , openssl_get_cipher_methods ())) {
859+ $ nameidExpectedEnc = '<saml:EncryptedID><xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Type="http://www.w3.org/2001/04/xmlenc#Element"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2009/xmlenc11#aes128-gcm"/><dsig:KeyInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><xenc:EncryptedKey><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/><xenc:CipherData><xenc:CipherValue> ' ;
860+
861+ $ nameIdEnc = Utils::generateNameId (
862+ $ nameIdValue ,
863+ $ entityId ,
864+ $ nameIDFormat ,
865+ $ key ,
866+ null ,
867+ XMLSecurityKey::AES128_GCM
868+ );
869+ $ this ->assertContains ($ nameidExpectedEnc , $ nameIdEnc );
870+ }
870871 }
871872
872873 /**
You can’t perform that action at this time.
0 commit comments