mongodb / winkerberos

A native Kerberos client implementation for Python on Windows
Apache License 2.0
54 stars 15 forks source link

Use the _W versions of the Windows API, especially for SEC_WINNT_AUTH_IDENTITY #1

Closed schlenk closed 8 years ago

schlenk commented 8 years ago

It would be much prefered if you used the _W versions of the API, especially for the auth identify.

Both usernames and credentials/passwords might contain UTF-16 chars outside of the current codepage.

In addition, your code reacts in funny ways if one changes the current user local (e.g. when using remote desktop, try switching between turkish, german and EN_US and use some umlauts or accents in the usernames or passwords, those might get silently converted).

Its close to trivial to use the UTF-16 APIs from python thanks to the usual unicode support.

behackett commented 8 years ago

This was already on my list of things to do. It should be fairly easy using Tchar.h and python's support for wchar_t.

https://msdn.microsoft.com/en-us/library/c426s321.aspx

behackett commented 8 years ago

This should be resolved now. It took quite a bit of effort since PyArg_ParseTuple is useless for getting byte strings as wchar_t in python2.x.