From affc9f0ecea60bf51f0c2065c1d58e75deccf6c3 Mon Sep 17 00:00:00 2001 From: Shang-Kuei Chen Date: Mon, 24 Feb 2020 22:24:11 +0800 Subject: [PATCH] address comment --- config/config.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index e0703eeb..10317f6b 100644 --- a/config/config.go +++ b/config/config.go @@ -131,12 +131,11 @@ func (c *Config) validate() error { } if cachedPinPath, exist := slotMap[key.SlotNumber]; exist && key.UserPinPath != cachedPinPath { return fmt.Errorf("key %q: unmatched pin code path for slot number #%d", key.Identifier, key.SlotNumber) - } else if !exist { - slotMap[key.SlotNumber] = key.UserPinPath } + slotMap[key.SlotNumber] = key.UserPinPath if key.CreateCACertIfNotExist && key.X509CACertLocation == "" { - return fmt.Errorf("key %q: key will create CA cert if not exist but X509CACertLocation is not specified", key.Identifier) + return fmt.Errorf("key %q: CA cert is supposed to be created if it doesn't exist but X509CACertLocation is not specified", key.Identifier) } if key.KeyType < crypki.RSA || key.KeyType > crypki.ECDSA {