Rémi Bernon : secur32: Return STREAM_HEADER/TRAILER buffers on SEC_I_RENEGOTIATE.

Alexandre Julliard julliard at winehq.org
Fri Feb 19 17:20:10 CST 2021


Module: wine
Branch: master
Commit: 86ab322377e11f9670c1dc1af1935d1b8f501096
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=86ab322377e11f9670c1dc1af1935d1b8f501096

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri Feb 19 16:58:57 2021 +0100

secur32: Return STREAM_HEADER/TRAILER buffers on SEC_I_RENEGOTIATE.

And don't print an error anymore.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/secur32/schannel.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c
index 2d135a85227..d47c4d79258 100644
--- a/dlls/secur32/schannel.c
+++ b/dlls/secur32/schannel.c
@@ -1336,6 +1336,7 @@ static void schan_decrypt_fill_buffer(PSecBufferDesc message, ULONG buffer_type,
 static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle,
         PSecBufferDesc message, ULONG message_seq_no, PULONG quality)
 {
+    SECURITY_STATUS status = SEC_E_OK;
     struct schan_context *ctx;
     SecBuffer *buffer;
     SIZE_T data_size;
@@ -1385,10 +1386,16 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
     while (received < data_size)
     {
         SIZE_T length = data_size - received;
-        SECURITY_STATUS status = schan_imp_recv(ctx->session, data + received, &length);
+        status = schan_imp_recv(ctx->session, data + received, &length);
+
+        if (status == SEC_I_RENEGOTIATE)
+            break;
 
         if (status == SEC_I_CONTINUE_NEEDED)
+        {
+            status = SEC_E_OK;
             break;
+        }
 
         if (status != SEC_E_OK)
         {
@@ -1421,7 +1428,7 @@ static SECURITY_STATUS SEC_ENTRY schan_DecryptMessage(PCtxtHandle context_handle
     buffer->BufferType = SECBUFFER_STREAM_HEADER;
     buffer->cbBuffer = 5;
 
-    return SEC_E_OK;
+    return status;
 }
 
 static SECURITY_STATUS SEC_ENTRY schan_DeleteSecurityContext(PCtxtHandle context_handle)




More information about the wine-cvs mailing list