forked from mystiq/dex
49389c9b90
Passing an empty list to the overlord or worker's --key-secrets flag currently causes an out of range panic. Always check to ensure there's at least one element passed. Fixes #130 Fixes #217
16 lines
388 B
Go
16 lines
388 B
Go
package db
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestNewPrivateKeySetRepoInvalidKey(t *testing.T) {
|
|
_, err := NewPrivateKeySetRepo(nil, false, []byte("sharks"))
|
|
if err == nil {
|
|
t.Errorf("Expected non-nil error for key secret that was not 32 bytes")
|
|
}
|
|
_, err = NewPrivateKeySetRepo(nil, false)
|
|
if err == nil {
|
|
t.Fatalf("Expected non-nil error when creating repo with no key secrets")
|
|
}
|
|
}
|