Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions SIL.PasswordStore/Provider/WindowsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public void SetPassword(string service, string user, string password)

var passwordLength = string.IsNullOrEmpty(password)
? 0
: (uint)Encoding.UTF8.GetBytes(password).Length + 1;
: (uint)Encoding.Unicode.GetByteCount(password);
var credential = new Credential {
Flags = 0,
Type = CredType.Generic,
TargetName = GetTargetName(service, user),
Comment = null,
CredentialBlobSize = passwordLength * 2,
CredentialBlobSize = passwordLength,
CredentialBlob = Marshal.StringToCoTaskMemUni(password),
Persist = CredPersist.LocalMachine,
AttributeCount = 0
Expand Down