X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwingss.c;h=6b4d0f15e0850f522282ae092b9107f6f95c15ab;hb=510f49e405e71ba5c97875e7a019364e1ef5fac9;hp=237b3890c7dfacba84491b3969d43d0c60cfec76;hpb=a1f3b7a358adaa7c2a98359cd0373aa823eeb14b;p=PuTTY.git diff --git a/windows/wingss.c b/windows/wingss.c index 237b3890..6b4d0f15 100644 --- a/windows/wingss.c +++ b/windows/wingss.c @@ -2,6 +2,7 @@ #include "putty.h" +#define SECURITY_WIN32 #include #include "pgssapi.h" @@ -82,18 +83,22 @@ struct ssh_gss_liblist *ssh_gss_setup(Conf *conf) == ERROR_SUCCESS) { DWORD type, size; LONG ret; - char *buffer; - - /* Find out the string length */ - ret = RegQueryValueEx(regkey, "InstallDir", NULL, &type, NULL, &size); + wchar_t *buffer; + /* Find out the string length, in bytes, for a wchar_t */ + ret = RegQueryValueExW(regkey, L"InstallDir", NULL, &type, NULL, &size); if (ret == ERROR_SUCCESS && type == REG_SZ) { buffer = snewn(size + 20, char); - ret = RegQueryValueEx(regkey, "InstallDir", NULL, - &type, buffer, &size); + ret = RegQueryValueExW(regkey, L"InstallDir", NULL, + &type, (LPBYTE)buffer, &size); if (ret == ERROR_SUCCESS && type == REG_SZ) { - strcat(buffer, "\\bin\\gssapi32.dll"); - module = LoadLibrary(buffer); + wcscat(buffer, L"\\bin\\"); + dll_hijacking_protection_add_path(buffer); + /* If 32-bit */ + module = LoadLibrary("gssapi32.dll"); + /* elif 64-bit */ + /* module = LoadLibrary("gssapi64.dll"); */ + } sfree(buffer); } @@ -354,7 +359,7 @@ static Ssh_gss_stat ssh_sspi_display_status(struct ssh_gss_library *lib, Ssh_gss_ctx ctx, Ssh_gss_buf *buf) { winSsh_gss_ctx *winctx = (winSsh_gss_ctx *) ctx; - char *msg; + const char *msg; if (winctx == NULL) return SSH_GSS_FAILURE;