Skip to content

Commit 090d35e

Browse files
committed
Move both cipher values, as a caller with the feature on would
The wrapped key's cipher value is written by the key source now, so the harness registers the carriers there too. Without that this row exercised only the content value, which is half the shape a user turning the option on sends.
1 parent 9c71ffd commit 090d35e

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎tests/Wsse/OptimizedCipherBytesInteropTest.php‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,16 @@ private function phpOptimized(): RequestInterface
174174
(string) file_get_contents(dirname(__DIR__, 2).'/samples/request-unsigned-soap11.xml'),
175175
);
176176

177-
(new Outbound\Encryption(new Keys\WrappedSessionKey($this->recipientCertificate())))
178-
->withOptimizedCipherBytes(AttachmentParts::request($storage, ExternalPartCoverage::Content))(
179-
new WsseContext($document, SoapVersion::Soap11, new SecurityProfile()),
180-
);
177+
// Registered on both the key source and the block, which is what moves both cipher values: the wrapped
178+
// key in the header is written by the source, the encrypted content by the block.
179+
$carriers = AttachmentParts::request($storage, ExternalPartCoverage::Content);
180+
181+
(new Outbound\Encryption(new Keys\WrappedSessionKey(
182+
$this->recipientCertificate(),
183+
optimizedCipherBytes: $carriers,
184+
)))->withOptimizedCipherBytes($carriers)(
185+
new WsseContext($document, SoapVersion::Soap11, new SecurityProfile()),
186+
);
181187

182188
return $this->pack($document->toXmlString(), $storage);
183189
}

0 commit comments

Comments
 (0)