← Commit list

b82235540f

Viktor Szakats
Viktor Szakats
2026-08-30
SUCCESS Duration: 412s

Subject

sspi: add local helper macro to avoid UNICODE branching

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/curl_sspi.c+1 -7
@@ -181,13 +181,7 @@ CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp,
identity->DomainLength = curlx_uztoul(domlen);
dup_domain.tchar_ptr = NULL;
- /* Setup the identity's flags */
- identity->Flags = (unsigned long)
-#ifdef UNICODE
- SEC_WINNT_AUTH_IDENTITY_UNICODE;
-#else
- SEC_WINNT_AUTH_IDENTITY_ANSI;
-#endif
+ identity->Flags = CURL_SEC_WINNT_AUTH_IDENTITY;
return CURLE_OK;
}
lib/curl_sspi.h+7 -0
@@ -29,6 +29,13 @@
#include <sspi.h>
+/* Local helper macro */
+#ifdef UNICODE
+#define CURL_SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY_UNICODE
+#else
+#define CURL_SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY_ANSI
+#endif
+
/* Offered by mingw-w64 v9+, MS SDK 7.0A/VS2010+ */
#ifndef SECPKG_ATTR_ENDPOINT_BINDINGS
#define SECPKG_ATTR_ENDPOINT_BINDINGS 26
lib/vauth/spnego_sspi.c+1 -6
@@ -154,12 +154,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
memset(&nego->identity, 0, sizeof(nego->identity));
nego->identity.Version = SEC_WINNT_AUTH_IDENTITY_VERSION;
nego->identity.Length = sizeof(nego->identity);
- nego->identity.Flags =
-#ifdef UNICODE
- SEC_WINNT_AUTH_IDENTITY_UNICODE;
-#else
- SEC_WINNT_AUTH_IDENTITY_ANSI;
-#endif
+ nego->identity.Flags = CURL_SEC_WINNT_AUTH_IDENTITY;
nego->p_identity = &nego->identity;
}