microsoft / vsts-authentication-library-for-java

Retrieve OAuth2 or Personal Accesss Tokens for Visual Studio Team Services (visualstudio.com) accounts. Also provides secure storage for those secrets on different platforms.
MIT License
18 stars 20 forks source link

CredManagerBackedSecureStore get method shoud treat secret bytes as UTF_16LE #35

Open normanhuang opened 3 years ago

normanhuang commented 3 years ago

https://github.com/microsoft/vsts-authentication-library-for-java/blob/edee296b96cec09dfc8af85afa0f6f348fa4920a/storage/src/main/java/com/microsoft/alm/storage/windows/internal/CredManagerBackedSecureStore.java#L90

In the current implementation, the secret bytes are incorrectly decoded as UTF8. As a result, the Password of the newly created Credential object does not match the original password.