[cli] Add check for deviceKey size

This commit is contained in:
Neeraj Gupta
2024-09-10 13:21:53 +05:30
parent 0aeff4a8ae
commit e70bf6a379

View File

@@ -18,6 +18,9 @@ type KeyHolder struct {
}
func NewKeyHolder(deviceKey []byte) *KeyHolder {
if len(deviceKey) != 32 {
panic(fmt.Sprintf("device key must be 32 bytes, found: %d bytes", len(deviceKey)))
}
return &KeyHolder{
AccountSecrets: make(map[string]*model.AccSecretInfo),
CollectionKeys: make(map[string][]byte),