We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
Assuming Playground uses the latest Go version, yes.
go env
https://play.golang.org/p/k07nWDYZ7Zk
Should return empty byte slice
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0xffffffff addr=0x0 pc=0xab662] goroutine 1 [running]: golang.org/x/crypto/blake2b.(*digest).Write(0x0, 0x432240, 0x4, 0x40, 0x0, 0xf0520, 0x40c080, 0xce380) /tmp/gopath522840708/pkg/mod/golang.org/x/[email protected]/blake2b/blake2b.go:216 +0x22 golang.org/x/crypto/argon2.blake2bHash(0x15ee7c, 0x0, 0x0, 0x44e400, 0x400, 0x400) /tmp/gopath522840708/pkg/mod/golang.org/x/[email protected]/argon2/blake2b.go:26 +0xc0 golang.org/x/crypto/argon2.extractKey(0x800000, 0x10000, 0x10000, 0x10000, 0x4, 0x0, 0x1, 0x0, 0x0, 0x0) /tmp/gopath522840708/pkg/mod/golang.org/x/[email protected]/argon2/argon2.go:255 +0x2c0 golang.org/x/crypto/argon2.deriveKey(0x1, 0x414008, 0x1, 0x1, 0x414009, 0x1, 0x1, 0x0, 0x0, 0x0, ...) /tmp/gopath522840708/pkg/mod/golang.org/x/[email protected]/argon2/argon2.go:117 +0x2e0 golang.org/x/crypto/argon2.Key(...) /tmp/gopath522840708/pkg/mod/golang.org/x/[email protected]/argon2/argon2.go:75 main.main() /tmp/sandbox040143225/prog.go:9 +0x100
The text was updated successfully, but these errors were encountered:
Change https://golang.org/cl/189878 mentions this issue: x/crypto/argon2: fix panic when keyLen == 0
x/crypto/argon2: fix panic when keyLen == 0
Sorry, something went wrong.
I may have misread the spec, but doesn't argon2 expect a minimum keyLen of 4? https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03#section-3.1
In that case, how about intentionally panicking on a keyLen < 4? Something like,
if keyLen < 4 { panic("argon2: tag length is too small") }
If it's any indication, the panic is currently happening because blake2b expects a hash size of at least 1, so maybe we should error out instead.
Successfully merging a pull request may close this issue.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Assuming Playground uses the latest Go version, yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/k07nWDYZ7Zk
What did you expect to see?
Should return empty byte slice
What did you see instead?
The text was updated successfully, but these errors were encountered: