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

CLI targets add command does not handle failed password #130

Open
dennisvang opened this issue Mar 21, 2024 · 0 comments
Open

CLI targets add command does not handle failed password #130

dennisvang opened this issue Mar 21, 2024 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@dennisvang
Copy link
Owner

dennisvang commented Mar 21, 2024

Describe the bug

When adding a target, if a private key is password protected and we enter the wrong password, signing fails, leaving the repo in an invalid state.

Workaround

Luckily the workaround is simple:

run the command again, this time enter the correct password

However, this should be handled properly.

To Reproduce
make sure at least one of the relevant private keys is password protected, then add a target, e.g.:

tufup targets add --skip-patch 1.2.3 my_dist my_keystore

and enter an invalid password

Expected behavior

  • either request password again,
  • or fail, but roll back any changes that have been made (remove archive file and remove corresponding entry in targets.json, if any)

Observed behavior

cli command fails with

securesystemslib.exceptions.CryptoError: Decryption failed.

but the new archive file remains in the repository/targets directory

@dennisvang dennisvang self-assigned this Mar 21, 2024
@dennisvang dennisvang added bug Something isn't working enhancement New feature or request labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant