[#16] Verify initial inner ring size and keys

closes #16

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-09-17 11:08:41 +03:00 committed by Alex Vanin
parent 33802137ee
commit 332e1ceca9

View file

@ -108,8 +108,15 @@ func Init(args [][]byte) bool {
var irList []node
if len(args) < 3 {
panic("neofs: at least three inner ring keys must be provided")
}
for i := 0; i < len(args); i++ {
pub := args[i]
if len(pub) != publicKeySize {
panic("neofs: incorrect public key length")
}
irList = append(irList, node{pub: pub})
}