From c6bb7aa199db137f70716e94c8a68488e01eec04 Mon Sep 17 00:00:00 2001
From: Gary Belvin <gdbelvin@gmail.com>
Date: Tue, 15 Jun 2021 18:18:29 +0100
Subject: [PATCH] Add back UI check, but don't read file

---
 cmd/step-pkcs11-init/main.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/cmd/step-pkcs11-init/main.go b/cmd/step-pkcs11-init/main.go
index c0ac997e..0f3c8fa6 100644
--- a/cmd/step-pkcs11-init/main.go
+++ b/cmd/step-pkcs11-init/main.go
@@ -119,6 +119,14 @@ func main() {
 		fatal(err)
 	}
 
+	if c.Pin == "" && u.Get("pin-value") == "" && u.Get("pin-source") == "" {
+		pin, err := ui.PromptPassword("What is the PKCS#11 PIN?")
+		if err != nil {
+			fatal(err)
+		}
+		c.Pin = string(pin)
+	}
+
 	k, err := kms.New(context.Background(), apiv1.Options{
 		Type: string(apiv1.PKCS11),
 		URI:  c.KMS,