Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyring fails to return value when password changed with Windows Credentials Manager #56

Closed
ronblum opened this issue May 25, 2018 · 2 comments

Comments

@ronblum
Copy link

ronblum commented May 25, 2018

Issue found using RStudio.

System details

RStudio Edition : Desktop
RStudio Version : 1.2.637
OS Version      : Windows 10
R Version       : 3.4.4, 3.5.0

Steps to reproduce the problem

  1. Set a username/password: key_set_with_value("bobo", username = "bobo_username", password = "bobo_password")
  2. Retrieve the password: key_get("bobo", "bobo_username")
    • Result: password

    [1] "bobo_password"

  3. Update the password using the Credential Manager in the Control Panel
  4. Retrieve the password: key_get("bobo", "bobo_username")
    • Result: error

    Error in b_wincred_get(self, private, service, username, keyring) :
    Key contains embedded null bytes, use get_raw()

Describe the problem in detail

When a keyring password is updated in Windows, key_get() returns an error instead of the password.

Describe the behavior you expected

The updated password would be returned. key_get_raw() doesn't help, as it returns a different error:

> key_get_raw("bobo", "bobo_username")
Error in b_wincred_get_raw(self, private, service, username = NULL, keyring = NULL) :
could not find function "b_wincred_get_raw"

@gaborcsardi
Copy link
Member

I am pretty sure that this is an UTF8/UTF16 encoding issue, and I think we can work around it.

@gaborcsardi
Copy link
Member

Should be OK now. We should probably always use UTF-16, but switching to that now could cause compatibility issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants