wincred: improve compatibility with windows versions
commiteffcff56a7c27c803a19ebca98691204c58fcd5c
authorKarsten Blees <blees@dcon.de>
Thu, 10 Jan 2013 10:52:12 +0000 (10 11:52 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 16 Jan 2013 09:55:05 +0000 (16 09:55 +0000)
tree1a64f4076bb93352f20924331d85998ed4c71a2f
parent117343979fb613fdeed4298106f4afc9ad91b5c0
wincred: improve compatibility with windows versions

On WinXP, the windows credential helper doesn't work at all (due to missing
Cred[Un]PackAuthenticationBuffer APIs). On Win7, the credential format used
by wincred is incompatible with native Windows tools (such as the control
panel applet or 'cmdkey.exe /generic'). These Windows tools only set the
TargetName, UserName and CredentialBlob members of the CREDENTIAL
structure (where CredentialBlob is the UTF-16-encoded password).

Remove the unnecessary packing / unpacking of the password, along with the
related API definitions, for compatibility with Windows XP.

Don't use CREDENTIAL_ATTRIBUTEs to identify credentials for compatibility
with Windows credential manager tools. Parse the protocol, username, host
and path fields from the credential's target name instead.

Credentials created with an old wincred version will have mangled or empty
passwords after this change.

Signed-off-by: Karsten Blees <blees@dcon.de>
contrib/credential/wincred/git-credential-wincred.c