dennisvang / tufup

Automated updates for stand-alone Python applications.
MIT License
71 stars 1 forks source link

CLI targets add command does not handle failed password #130

Open dennisvang opened 3 months ago

dennisvang commented 3 months ago

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

Observed behavior

cli command fails with

securesystemslib.exceptions.CryptoError: Decryption failed.

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