Jacek Caban : secur32: Don' t change input buffer in InitializeSecurityContext.

Alexandre Julliard julliard at winehq.org
Tue Feb 28 03:45:56 CST 2017


Module: wine
Branch: oldstable
Commit: 98c513ff3811d170cf70d6b4f78dd9ed485f0c74
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=98c513ff3811d170cf70d6b4f78dd9ed485f0c74

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jan 13 19:57:48 2017 +0100

secur32: Don't change input buffer in InitializeSecurityContext.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit c1f055d8dfda4cb4349db319a9e8734022d74895)
Conflicts:
        dlls/secur32/tests/schannel.c
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/secur32/schannel.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c
index c6cc4d1..71f219c 100644
--- a/dlls/secur32/schannel.c
+++ b/dlls/secur32/schannel.c
@@ -732,7 +732,14 @@ schan_imp_session schan_session_for_transport(struct schan_transport* t)
     return t->ctx->session;
 }
 
-static int schan_init_sec_ctx_get_next_buffer(const struct schan_transport *t, struct schan_buffers *s)
+static int schan_init_sec_ctx_get_next_input_buffer(const struct schan_transport *t, struct schan_buffers *s)
+{
+    if (s->current_buffer_idx != -1)
+        return -1;
+    return schan_find_sec_buffer_idx(s->desc, 0, SECBUFFER_TOKEN);
+}
+
+static int schan_init_sec_ctx_get_next_output_buffer(const struct schan_transport *t, struct schan_buffers *s)
 {
     if (s->current_buffer_idx == -1)
     {
@@ -884,9 +891,9 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW(
     ctx->req_ctx_attr = fContextReq;
 
     transport.ctx = ctx;
-    init_schan_buffers(&transport.in, pInput, schan_init_sec_ctx_get_next_buffer);
+    init_schan_buffers(&transport.in, pInput, schan_init_sec_ctx_get_next_input_buffer);
     transport.in.limit = expected_size;
-    init_schan_buffers(&transport.out, pOutput, schan_init_sec_ctx_get_next_buffer);
+    init_schan_buffers(&transport.out, pOutput, schan_init_sec_ctx_get_next_output_buffer);
     schan_imp_set_session_transport(ctx->session, &transport);
 
     /* Perform the TLS handshake */




More information about the wine-cvs mailing list