From 5cc5b102c1b0a66aa63b66f43f2da9a1a9d15ab6 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 6 Dec 2018 18:09:18 +0100 Subject: [PATCH] secur32: Use -VERS-ALL gnutls priority string to disable not enabled protocols. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46161 Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/secur32/schannel_gnutls.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/secur32/schannel_gnutls.c b/dlls/secur32/schannel_gnutls.c index 05e922dfe8e..0a494214116 100644 --- a/dlls/secur32/schannel_gnutls.c +++ b/dlls/secur32/schannel_gnutls.c @@ -166,7 +166,7 @@ DWORD schan_imp_enabled_protocols(void) BOOL schan_imp_create_session(schan_imp_session *session, schan_credentials *cred) { gnutls_session_t *s = (gnutls_session_t*)session; - char priority[128] = "NORMAL:%LATEST_RECORD_VERSION", *p; + char priority[128] = "NORMAL:%LATEST_RECORD_VERSION:-VERS-ALL", *p; unsigned i; int err = pgnutls_init(s, cred->credential_use == SECPKG_CRED_INBOUND ? GNUTLS_SERVER : GNUTLS_CLIENT); @@ -178,8 +178,9 @@ BOOL schan_imp_create_session(schan_imp_session *session, schan_credentials *cre p = priority + strlen(priority); for(i = 0; i < ARRAY_SIZE(protocol_priority_flags); i++) { + if (!(cred->enabled_protocols & protocol_priority_flags[i].enable_flag)) continue; *p++ = ':'; - *p++ = (cred->enabled_protocols & protocol_priority_flags[i].enable_flag) ? '+' : '-'; + *p++ = '+'; strcpy(p, protocol_priority_flags[i].gnutls_flag); p += strlen(p); }