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

Fixed tmkms keys import -t for priv_validator #350

Merged

Conversation

freak12techno
Copy link
Contributor

@freak12techno freak12techno commented Jun 25, 2021

For now, tmkms keys import -t priv_validator results in an error:

$ tmkms yubihsm keys import -t priv_validator ~/priv_validator.json
error: invalid key type: priv_validator

I've renamed the json label to priv_validator to match the description.

Also it seems like the priv_validator.json file is now priv_validator_key.json (at least on Persistence on core-1 and on Sentinel on sentinelhub-2 it's this way)

@tony-iqlusion
Copy link
Member

It seems like your problem would be resolved by using:

tmkms yubihsm keys import -t json ~/priv_validator.json

Some("base64") => self.import_base64(&contents),
Some(other) => {
status_err!("invalid key type: {}", other);
process::exit(1);
}
None => {
if self.path.ends_with("priv_validator.json") {
if self.path.ends_with("priv_validator_key.json") {
Copy link
Member

Choose a reason for hiding this comment

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

This part seems OK.

@freak12techno
Copy link
Contributor Author

It seems like your problem would be resolved by using:

tmkms yubihsm keys import -t json ~/priv_validator.json

@tony-iqlusion yeah, this worked for me eventually (also adding -i 1 as it'd fail without it). My concern here is that the --help is misleading here, so my idea was to update the option name. For now you need to go through the source code to find how the function is called.
I can also leave the json option here and update the help entry so it'd say "use json", this would also solve it. What do you think?

@tony-iqlusion
Copy link
Member

I can also leave the json option here and update the help entry so it'd say "use json", this would also solve it. What do you think?

Sounds good!

@freak12techno
Copy link
Contributor Author

Done. Can you check once more?

@tony-iqlusion
Copy link
Member

@freak12techno can you rebase?

@freak12techno
Copy link
Contributor Author

@tony-iqlusion done

@tony-iqlusion tony-iqlusion merged commit d3fd2bf into iqlusioninc:main Jul 27, 2021
@tony-iqlusion
Copy link
Member

Thank you!

@tony-iqlusion tony-iqlusion mentioned this pull request Feb 11, 2022
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.

2 participants