77use DOMElement ;
88use PHPUnit \Framework \TestCase ;
99use SimpleSAML \XML \DOMDocumentFactory ;
10+ use SimpleSAML \XMLSchema \Type \AnyURIValue ;
1011use SimpleSAML \XMLSecurity \Alg \Encryption \EncryptionAlgorithmFactory ;
1112use SimpleSAML \XMLSecurity \Alg \KeyTransport \KeyTransportAlgorithmFactory ;
1213use SimpleSAML \XMLSecurity \Alg \Signature \SignatureAlgorithmFactory ;
@@ -60,7 +61,9 @@ public function testEncryptAndDecryptSharedSecret(): void
6061 // encrypt
6162 $ factory = new EncryptionAlgorithmFactory ();
6263 $ encryptor = $ factory ->getAlgorithm (C::BLOCK_ENC_AES128 , $ sharedKey );
63- $ encryptedCustom = new EncryptedCustom ($ customSigned ->encrypt ($ encryptor ));
64+ $ encryptedCustom = new EncryptedCustom (
65+ $ customSigned ->encrypt ($ encryptor , AnyURIValue::fromString (C::XMLENC_ELEMENT )),
66+ );
6467
6568 // decrypt
6669 $ decryptedCustom = $ encryptedCustom ->decrypt ($ encryptor );
@@ -80,7 +83,9 @@ public function testEncryptAndDecryptSessionKey(): void
8083 // encrypt
8184 $ factory = new KeyTransportAlgorithmFactory ();
8285 $ encryptor = $ factory ->getAlgorithm (C::KEY_TRANSPORT_OAEP_MGF1P , $ this ->pubKey );
83- $ encryptedCustom = new EncryptedCustom ($ customSigned ->encrypt ($ encryptor ));
86+ $ encryptedCustom = new EncryptedCustom (
87+ $ customSigned ->encrypt ($ encryptor , AnyURIValue::fromString (C::XMLENC_ELEMENT )),
88+ );
8489
8590 // decrypt
8691 $ decryptor = $ factory ->getAlgorithm (C::KEY_TRANSPORT_OAEP_MGF1P , $ this ->privKey );
@@ -110,7 +115,9 @@ public function testSignatureVerifiesAfterEncryptionAndDecryption(): void
110115 // encrypt
111116 $ factory = new KeyTransportAlgorithmFactory ();
112117 $ encryptor = $ factory ->getAlgorithm (C::KEY_TRANSPORT_OAEP_MGF1P , $ this ->pubKey );
113- $ encryptedCustom = new EncryptedCustom ($ customSigned ->encrypt ($ encryptor ));
118+ $ encryptedCustom = new EncryptedCustom (
119+ $ customSigned ->encrypt ($ encryptor , AnyURIValue::fromString (C::XMLENC_ELEMENT )),
120+ );
114121
115122 // decrypt
116123 $ decryptor = $ factory ->getAlgorithm (C::KEY_TRANSPORT_OAEP_MGF1P , $ this ->privKey );
0 commit comments