When using rnp_op_verify_execute with detached signature file in incorrect format, I receive RNP_ERROR_BAD_PARAMETERS error code instead of RNP_ERROR_BAD_FORMAT.
First, the error is masked in src/librepgp/stream-parse.cpp, lines 819-826:
if (stream_parse_signature(readsrc, &readsig) != RNP_SUCCESS) {
RNP_LOG("failed to parse signature");
siginfo->unknown = true;
if (sig) {
*sig = NULL;
}
return RNP_SUCCESS;
}
Secondly, in lines 2093-2094:
/* no need to check the error here - we already know tag */
signed_read_single_signature(param, readsrc, &sig);
Description
When using
rnp_op_verify_execute
with detached signature file in incorrect format, I receiveRNP_ERROR_BAD_PARAMETERS
error code instead ofRNP_ERROR_BAD_FORMAT
.First, the error is masked in
src/librepgp/stream-parse.cpp
, lines 819-826:Secondly, in lines 2093-2094:
Steps to Reproduce
Expected Behavior
I would expect to get
RNP_ERROR_BAD_FORMAT
Actual Behavior
What behavior did you observe instead?
I get
RNP_ERROR_BAD_PARAMETERS
error code