From e31bc3dbdb7af30faf82740a0db66e0d72715487 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Fri, 8 Feb 2019 09:58:12 +0100 Subject: [PATCH] secur32: Return ISC_RET_USED_SUPPLIED_CREDS for schannel contexts if the feature was requested. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46127 Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/secur32/schannel.c | 2 ++ dlls/secur32/tests/schannel.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c index 2dbf8b1806c..5caaece8a5d 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -926,6 +926,8 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW( *pfContextAttr |= ISC_RET_ALLOCATED_MEMORY; if (ctx->req_ctx_attr & ISC_REQ_STREAM) *pfContextAttr |= ISC_RET_STREAM; + if (ctx->req_ctx_attr & ISC_REQ_USE_SUPPLIED_CREDS) + *pfContextAttr |= ISC_RET_USED_SUPPLIED_CREDS; return ret; } diff --git a/dlls/secur32/tests/schannel.c b/dlls/secur32/tests/schannel.c index ebdfcb61a13..6ae76eab1a5 100644 --- a/dlls/secur32/tests/schannel.c +++ b/dlls/secur32/tests/schannel.c @@ -843,7 +843,7 @@ todo_wine buffers[1].pBuffers[0].cbBuffer = ret; status = InitializeSecurityContextA(&cred_handle, &context, (SEC_CHAR *)"localhost", - ISC_REQ_CONFIDENTIALITY|ISC_REQ_STREAM, + ISC_REQ_CONFIDENTIALITY|ISC_REQ_STREAM|ISC_REQ_USE_SUPPLIED_CREDS, 0, 0, &buffers[1], 0, NULL, &buffers[0], &attrs, NULL); buffers[1].pBuffers[0].cbBuffer = buf_size; while (status == SEC_I_CONTINUE_NEEDED) @@ -860,7 +860,7 @@ todo_wine buf->BufferType = SECBUFFER_TOKEN; status = InitializeSecurityContextA(&cred_handle, &context, (SEC_CHAR *)"localhost", - ISC_REQ_CONFIDENTIALITY|ISC_REQ_STREAM, + ISC_REQ_CONFIDENTIALITY|ISC_REQ_STREAM|ISC_REQ_USE_SUPPLIED_CREDS, 0, 0, &buffers[1], 0, NULL, &buffers[0], &attrs, NULL); buffers[1].pBuffers[0].cbBuffer = buf_size; } @@ -871,6 +871,7 @@ todo_wine skip("Handshake failed\n"); return; } + ok(attrs & (ISC_RET_CONFIDENTIALITY|ISC_RET_STREAM|ISC_RET_USED_SUPPLIED_CREDS), "got %08x\n", attrs); status = QueryCredentialsAttributesA(&cred_handle, SECPKG_CRED_ATTR_NAMES, &names); ok(status == SEC_E_NO_CREDENTIALS || status == SEC_E_UNSUPPORTED_FUNCTION /* before Vista */, "expected SEC_E_NO_CREDENTIALS, got %08x\n", status);