From 063a09a521bcb1045e2177a5afd6d1f57cf57304 Mon Sep 17 00:00:00 2001 From: Gary Belvin Date: Tue, 15 Jun 2021 12:30:28 +0100 Subject: [PATCH] Allow reading pin from kms string --- cmd/step-pkcs11-init/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/step-pkcs11-init/main.go b/cmd/step-pkcs11-init/main.go index fd9dbc72..4f32107a 100644 --- a/cmd/step-pkcs11-init/main.go +++ b/cmd/step-pkcs11-init/main.go @@ -119,7 +119,12 @@ func main() { fatal(err) } - if u.Pin() == "" && c.Pin == "" { + kmsPin := u.Pin() + if c.Pin == "" && kmsPin != "" { + c.Pin = kmsPin + } + + if c.Pin == "" { pin, err := ui.PromptPassword("What is the PKCS#11 PIN?") if err != nil { fatal(err)