Closed ni4 closed 3 years ago
If passed recipient is a primary key, rnp tries to use it, if it is not suitable, it scans subkeys until some suitable key is found. Looks like if we need to give exact reason why encryption failed, we need to print why each subkey was rejected, otherwise there will be generic error "no suitable key found". That means even if operation is successfull, but there were some expired subkeys, there will be excess warnings printed each time for each expired subkey. Or we need to save rejection reasons and print them only if no key was found.
@antonsviridenko For now it would be enough to just print some message in cli_rnp_encrypt_and_sign()
on failure. Later, once #1457 is implemented, we may improve it by showing a message during recipient addition.
closed by https://github.com/rnpgp/rnp/pull/1520
Description
RNP CLI doesn't show any error message if encryption failed because of expired recipient's key.
Steps to Reproduce
rnp -r "expired_key" somefile.dat
Expected Behavior
Some message is shown, like
Encryption failed: recipient's key "expired_key" is expired.
Actual Behavior
No message at all (however, return code is correct and non-zero).