diff options
author | Bodo Möller <bodo@openssl.org> | 1999-07-12 09:46:34 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 1999-07-12 09:46:34 +0000 |
commit | 3a55fc1aaba9e70e16570c1747b6627e8092dc11 (patch) | |
tree | 53ff7567dba24a98db9334fe8627d3fc9a00be6a /apps/rsa.c | |
parent | 8735ee6f5d1c54d5ab4f8567320a1ecba7775443 (diff) | |
download | openssl-3a55fc1aaba9e70e16570c1747b6627e8092dc11.zip openssl-3a55fc1aaba9e70e16570c1747b6627e8092dc11.tar.gz openssl-3a55fc1aaba9e70e16570c1747b6627e8092dc11.tar.bz2 |
correct error handling
insert spaces in products that occur in error codes
Diffstat (limited to 'apps/rsa.c')
-rw-r--r-- | apps/rsa.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -262,9 +262,12 @@ bad: } if (check) - if (RSA_check_key(rsa)) + { + int r = RSA_check_key(rsa); + + if (r == 1) BIO_printf(out,"RSA key ok\n"); - else + else if (r == 0) { long e; @@ -276,13 +279,15 @@ bad: BIO_printf(out, "RSA key error: %s\n", ERR_reason_error_string(e)); ERR_get_error(); /* remove e from error stack */ } - if (e != 0) - { - ERR_print_errors(bio_err); - goto end; - } } - + + if (r == -1 || ERR_peek_error() != 0) /* should happen only if r == -1 */ + { + ERR_print_errors(bio_err); + goto end; + } + } + if (noout) goto end; BIO_printf(bio_err,"writing RSA private key\n"); if (outformat == FORMAT_ASN1) |