wincred: improve compatibility with windows versions
commit8b2d219a3d6db49c8c3c0a5b620af33d6a40a974
authorKarsten Blees <blees@dcon.de>
Thu, 10 Jan 2013 10:52:12 +0000 (10 11:52 +0100)
committerErik Faye-Lund <kusmabite@gmail.com>
Tue, 26 Feb 2013 16:42:46 +0000 (26 17:42 +0100)
tree7c26d11b163f369d8afa3561007d6168889677a6
parent3b12f46ab382b280effa15a925b6195abaebf0a3
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>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
contrib/credential/wincred/git-credential-wincred.c