rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
194 stars 55 forks source link

`--edit-key` sub-options should be mutually exclusive #1979

Closed antonsviridenko closed 1 year ago

antonsviridenko commented 1 year ago

Description

https://github.com/rnpgp/rnp/blob/9b08ed1d13b79b3c8f2603ecc29b2cd066b70a49/src/rnp/fficli.cpp#L1091 The code above says at least one but depending on the processing order, current code executes only one of the edit key subcommands.

Steps to Reproduce

Try to pass multiple --edit-key subcommands/options.

Expected Behavior

I think rnpkeys should print an error message on attempts to pass more than one --edit-key options and the error message above should be updated to address this change.

antonsviridenko commented 1 year ago

btw, same issue applies to the top-level CLI commands, last one specified on the command line is actually executed, like

rnp --sign --verify --decrypt --list-packets ~/.rnp/pubring.gpg

executes --list-command