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

Not possible to enter a passphrase - panic: crypto/hmac: hash generation function does not produce unique values #294

Closed
niclas3332 opened this issue Mar 30, 2021 · 2 comments · Fixed by #295
Assignees
Labels
bug Something isn't working

Comments

@niclas3332
Copy link

Hey,

when I try to set a passphrase, I got the error message
panic: crypto/hmac: hash generation function does not produce unique values

I tried to install it with go get, with git clone and make build and with the pre-compiled binary.
Same error every time.

Go: go1.16.2 linux/amd64
Gphotos: gphotos-uploader-cli v3.0.1
OS: Ubuntu 18.04.5 LTS

Complete Console output

Enter the passphrase to open the token store: 
panic: crypto/hmac: hash generation function does not produce unique values
goroutine 1 [running]:
crypto/hmac.New(0xc000206c30, 0xc0000e80b0, 0xf, 0x10, 0xc0000fc000, 0x7fef577aee20)
	/snap/go/7221/src/crypto/hmac/hmac.go:143 +0x370
github.com/dvsekhvalnov/jose2go/kdf.DerivePBKDF2(0xc0000e80b0, 0xf, 0x10, 0xc0000ee030, 0x1f, 0x30, 0x2000, 0x80, 0x9ed778, 0xc0000fc000, ...)
	/root/go/pkg/mod/github.com/dvsekhvalnov/jose2go@v0.0.0-20180829124132-7f401d37b68a/kdf/pbkdf2.go:15 +0xad
github.com/dvsekhvalnov/jose2go.(*Pbse2HmacAesKW).WrapNewKey(0xc0001aa0a8, 0x100, 0x8a3920, 0xc0000f2020, 0xc0000ec030, 0x203001, 0x20300000000000, 0x7fef307a9fff, 0x7fef577aef30, 0x7fef577aef30, ...)
	/root/go/pkg/mod/github.com/dvsekhvalnov/jose2go@v0.0.0-20180829124132-7f401d37b68a/pbse2_hmac_aeskw.go:50 +0x439
github.com/dvsekhvalnov/jose2go.encrypt(0xc0000f6280, 0x27b, 0x280, 0xc0000ec030, 0x8a3920, 0xc0000f2020, 0xc0000f64fb, 0x5, 0x0, 0xc0000f6280)
	/root/go/pkg/mod/github.com/dvsekhvalnov/jose2go@v0.0.0-20180829124132-7f401d37b68a/jose.go:305 +0x20a
github.com/dvsekhvalnov/jose2go.EncryptBytes(0xc0000f6280, 0x27b, 0x280, 0x95488a, 0x12, 0x94f9d2, 0x7, 0x8a3920, 0xc0000f2020, 0xc000207148, ...)
	/root/go/pkg/mod/github.com/dvsekhvalnov/jose2go@v0.0.0-20180829124132-7f401d37b68a/jose.go:222 +0x32f
github.com/dvsekhvalnov/jose2go.Encrypt(...)
	/root/go/pkg/mod/github.com/dvsekhvalnov/jose2go@v0.0.0-20180829124132-7f401d37b68a/jose.go:187
github.com/99designs/keyring.(*fileKeyring).Set(0xc00069c000, 0xc0001be678, 0x11, 0xc0013be000, 0x175, 0x180, 0x0, 0x0, 0x0, 0x0, ...)
	/root/go/pkg/mod/github.com/99designs/keyring@v1.1.5/file.go:144 +0x2d9
github.com/gphotosuploader/gphotos-uploader-cli/internal/datastore/tokenmanager.(*KeyringRepository).Set(0xc000180bb0, 0xc0001be678, 0x11, 0xc000190420, 0xc78220, 0x975ba0)
	/opt/gphotos-uploader-cli/internal/datastore/tokenmanager/keyring_repository.go:66 +0x118
github.com/gphotosuploader/gphotos-uploader-cli/internal/datastore/tokenmanager.(*TokenManager).Put(0xc000180d70, 0xc0001be678, 0x11, 0xc000190420, 0x1, 0x1)
	/opt/gphotos-uploader-cli/internal/datastore/tokenmanager/tokenmanager.go:47 +0x67
github.com/gphotosuploader/gphotos-uploader-cli/internal/app.App.NewOAuth2Client(0x9ecc78, 0xc000020020, 0x9eb370, 0xc000180d70, 0x9ecce8, 0xc000094088, 0x0, 0x9f21b8, 0xc78220, 0x9f15d8, ...)
	/opt/gphotos-uploader-cli/internal/app/oauth.go:66 +0x3e9
github.com/gphotosuploader/gphotos-uploader-cli/internal/app.Start(0x9eca10, 0xc00018c010, 0xc0001f4800, 0x1b, 0x6, 0x7fef57624a88, 0x18)
	/opt/gphotos-uploader-cli/internal/app/app.go:72 +0x672
github.com/gphotosuploader/gphotos-uploader-cli/internal/cmd.(*PushCmd).Run(0xc0001aa198, 0xc000246500, 0xcb3410, 0x0, 0x0, 0x0, 0x0)
	/opt/gphotos-uploader-cli/internal/cmd/push.go:50 +0x99
github.com/spf13/cobra.(*Command).execute(0xc000246500, 0xcb3410, 0x0, 0x0, 0xc000246500, 0xcb3410)
	/root/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:826 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc7e3a0, 0xc000207f78, 0x408025, 0xc000100058)
	/root/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914 +0x30b
github.com/spf13/cobra.(*Command).Execute(...)
	/root/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/gphotosuploader/gphotos-uploader-cli/internal/cmd.Execute()
	/opt/gphotos-uploader-cli/internal/cmd/root.go:57 +0x31
main.main()
	/opt/gphotos-uploader-cli/main.go:10 +0x25
@niclas3332 niclas3332 added the bug Something isn't working label Mar 30, 2021
@niclas3332 niclas3332 changed the title Not possible to enter a passphrase Not possible to enter a passphrase - panic: crypto/hmac: hash generation function does not produce unique values Mar 30, 2021
@pacoorozco
Copy link
Member

Reproduced using Go 1.16... it seems to be related with golang/go#45252

@pacoorozco
Copy link
Member

The problem is upstream on this dependency: 99designs/keyring#75

pacoorozco added a commit that referenced this issue Apr 4, 2021
Signed-off-by: pacoorozco <paco@pacoorozco.info>
@pacoorozco pacoorozco mentioned this issue Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants