summaryrefslogtreecommitdiffstats
path: root/apps/rsa.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-08-24 12:46:09 +0200
committerMatt Caswell <matt@openssl.org>2016-08-24 14:31:05 +0100
commit63db6b772fa264a62927f6a3584733192dc5a352 (patch)
tree7dac3bcf6edd80c11b1bb9edfeaee65795f3baea /apps/rsa.c
parent55d83bf7c10c7b205fffa23fa7c3977491e56c07 (diff)
Trust RSA_check_key() to return correct values
In apps/rsa.c, we were second guessing RSA_check_key() to leave error codes lying around without returning -1 properly. However, this also catches other errors that are lying around and that we should not care about. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/rsa.c')
-rw-r--r--apps/rsa.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/apps/rsa.c b/apps/rsa.c
index f67387e27f..bd2f53a6f4 100644
--- a/apps/rsa.c
+++ b/apps/rsa.c
@@ -230,10 +230,7 @@ int rsa_main(int argc, char **argv)
ERR_reason_error_string(err));
ERR_get_error(); /* remove e from error stack */
}
- }
-
- /* should happen only if r == -1 */
- if (r == -1 || ERR_peek_error() != 0) {
+ } else if (r == -1) {
ERR_print_errors(bio_err);
goto end;
}