Merge pull request #1073 from smallstep/prompt-password

Support to ask for key password after crypto change
This commit is contained in:
Mariano Cano 2022-09-27 12:41:37 -07:00 committed by GitHub
commit de73a3e8de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,7 @@ import (
"go.step.sm/cli-utils/step"
"go.step.sm/cli-utils/ui"
"go.step.sm/cli-utils/usage"
"go.step.sm/crypto/pemutil"
// Enabled kms interfaces.
_ "go.step.sm/crypto/kms/awskms"
@ -52,6 +53,10 @@ func init() {
step.Set("Smallstep CA", Version, BuildTime)
authority.GlobalVersion.Version = Version
rand.Seed(time.Now().UnixNano())
// Add support for asking passwords
pemutil.PromptPassword = func(msg string) ([]byte, error) {
return ui.PromptPassword(msg)
}
}
func exit(code int) {