From 332e1ceca9f776935cedde21ce31b370f8b22896 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 17 Sep 2020 11:08:41 +0300 Subject: [PATCH] [#16] Verify initial inner ring size and keys closes #16 Signed-off-by: Alex Vanin --- neofs_contract.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/neofs_contract.go b/neofs_contract.go index 302156d..be528bc 100644 --- a/neofs_contract.go +++ b/neofs_contract.go @@ -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}) }