Browse Source

Allow reading pin from kms string

Gary Belvin 5 years ago
parent
commit
063a09a521
1 changed files with 6 additions and 1 deletions
  1. 6 1
      cmd/step-pkcs11-init/main.go

+ 6 - 1
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)