http://bugs.winehq.org/show_bug.cgi?id=20748
--- Comment #6 from Hans Leidekker hans@meelstraat.net 2009-11-19 06:53:15 --- Created an attachment (id=24832) --> (http://bugs.winehq.org/attachment.cgi?id=24832) secur32: Use an empty buffer to return decrypted data.
A look at the chromium source was revealing:
int SSLClientSocketWin::DoPayloadDecrypt() { [...] for (int i = 1; i < 4; i++) { switch (buffers[i].BufferType) { case SECBUFFER_DATA: DCHECK(!decrypted_ptr_ && bytes_decrypted_ == 0); decrypted_ptr_ = static_cast<char*>(buffers[i].pvBuffer); bytes_decrypted_ = buffers[i].cbBuffer; break; case SECBUFFER_EXTRA: DCHECK(!received_ptr_ && bytes_received_ == 0); received_ptr_ = static_cast<char*>(buffers[i].pvBuffer); bytes_received_ = buffers[i].cbBuffer; break; default: break; } }
It starts the loop at 1, so the code does not even look at the first buffer, even though DecryptMessage will decrypt the buffer in-place.
This patch uses an empty SecBuffer to return another pointer to the decrypted data, which makes the unit test happy.
You need to apply this patch from bug 20622 first: http://bugs.winehq.org/attachment.cgi?id=24819