-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add pkcs11-config-path command line parameter #192
add pkcs11-config-path command line parameter #192
Conversation
1b8b4f4
to
1d77e15
Compare
cmd/app/createca.go
Outdated
@@ -46,7 +46,7 @@ such as organization, country etc. This can then be used as the root | |||
certificate authority for an instance of sigstore fulcio`, | |||
Run: func(cmd *cobra.Command, args []string) { | |||
log.Logger.Info("binding to PKCS11 HSM") | |||
p11Ctx, err := crypto11.ConfigureFromFile("config/crypto11.conf") | |||
p11Ctx, err := crypto11.ConfigureFromFile(viper.GetString("crypto-config-path")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
Could we name it pkcs11-config-path
instead please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
pkg/pkcs11/pkcs11.go
Outdated
) | ||
|
||
func InitHSMCtx() (*crypto11.Context, error) { | ||
p11Ctx, err := crypto11.ConfigureFromFile("config/crypto11.conf") | ||
p11Ctx, err := crypto11.ConfigureFromFile(viper.GetString("crypto-config-path")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you manage to test this, I am not sure if the viper flags would reach this code (not at my main computer right now)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected to give it a dry run on CI/CD first, but I checked similar code in pkg directory first, so I assumed that it should be okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all checks passed
Signed-off-by: Vasilyev, Viacheslav <viacheslav.vasilyev@accenture.com>
ed224e7
to
a4c4553
Compare
Summary
Allow to change crypto11.conf file location via
--pkcs11-config-path
command-line parameterTicket Link
No ticket
Release Note