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

"Failed to create user: crypto/blowfish: invalid key size 1" #333

Merged
merged 1 commit into from
Mar 12, 2014

Conversation

jvshahid
Copy link
Contributor

in the admin interface,
when i create a db, it works.
then I do add user "graphite", "graphite" as user/pass.
often i get "Failed to create user: crypto/blowfish: invalid key size 1"

when i retry it says "user already exists"

@toddboom
Copy link
Contributor

@Dieterbe I remember also seeing this once when the password was only a single character. Did the user account authenticate correctly afterwards?

@Dieterbe
Copy link
Contributor Author

yeah

@jvshahid jvshahid added this to the 0.5.0 milestone Mar 12, 2014
Currently we create a user with no password if the password provided was
not more than 4 chars and less than 56 chars. We also return an error
msg that reveals the internal of our crypto algorithm and isn't readable
by the end user.
@jvshahid
Copy link
Contributor

I looked into the go.crypto code and it turns out that the password has to be > 4 and < 56 characters. This patch do a check before creating the user and return a readable error to the end user. If an error is returned the user isn't created which avoids the user exists error that you get afterwards.

You said that in your case you were trying to set the password to graphite but I don't understand how did you get that error, could be a bug in the admin ui or may be you hit enter prematurely.

pauldix added a commit that referenced this pull request Mar 12, 2014
"Failed to create user: crypto/blowfish: invalid key size 1"
@pauldix pauldix merged commit 4f30e59 into master Mar 12, 2014
@jvshahid jvshahid deleted the fix-333-crypto-bug branch March 25, 2014 16:38
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

Successfully merging this pull request may close these issues.

4 participants