Skip to content
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

Merged
merged 1 commit into from
Oct 1, 2021

Conversation

avoidik
Copy link
Contributor

@avoidik avoidik commented Sep 30, 2021

Summary

Allow to change crypto11.conf file location via --pkcs11-config-path command-line parameter

Ticket Link

No ticket

Release Note

* add pkcs11-config-path command line parameter to be able to change crypto11.conf file location

@avoidik avoidik force-pushed the allow-to-change-pkcs-config-path branch from 1b8b4f4 to 1d77e15 Compare September 30, 2021 20:35
@@ -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"))
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

)

func InitHSMCtx() (*crypto11.Context, error) {
p11Ctx, err := crypto11.ConfigureFromFile("config/crypto11.conf")
p11Ctx, err := crypto11.ConfigureFromFile(viper.GetString("crypto-config-path"))
Copy link
Member

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)?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all checks passed

@avoidik avoidik changed the title add crypto-config-path command line parameter add pkcs11-config-path command line parameter Oct 1, 2021
Signed-off-by: Vasilyev, Viacheslav <viacheslav.vasilyev@accenture.com>
@avoidik avoidik force-pushed the allow-to-change-pkcs-config-path branch from ed224e7 to a4c4553 Compare October 1, 2021 09:40
@lukehinds lukehinds merged commit e3bb9cb into sigstore:main Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants