MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / TestHashZeroSalt

Function TestHashZeroSalt

pkg/auth/pbkdf2/pbkdf2_test.go:73–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestHashZeroSalt(t *testing.T) {
74 a := New(t)
75
76 h := &PBKDF2{
77 Iterations: 10000,
78 KeyLength: 512,
79 Algorithm: Sha512,
80 SaltLength: 0,
81 }
82
83 plain := "secret"
84
85 _, err := h.Hash(plain)
86 a.So(err, ShouldNotBeNil)
87}
88
89func TestBadHash(t *testing.T) {
90 a := New(t)

Callers

nothing calls this directly

Calls 2

HashMethod · 0.95
NewFunction · 0.50

Tested by

no test coverage detected