Commit 03883e7e authored by Paul Yang's avatar Paul Yang
Browse files

Fix rsa -check option



original problem: if a private key is invaild, nothing outputted.

the error filter in apps/rsa.c is not working any more.

Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4043)
parent 190b9a03
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ int rsa_main(int argc, char **argv)
    }

    if (check) {
        int r = RSA_check_key(rsa);
        int r = RSA_check_key_ex(rsa, NULL);

        if (r == 1) {
            BIO_printf(out, "RSA key ok\n");
@@ -226,7 +226,7 @@ int rsa_main(int argc, char **argv)

            while ((err = ERR_peek_error()) != 0 &&
                   ERR_GET_LIB(err) == ERR_LIB_RSA &&
                   ERR_GET_FUNC(err) == RSA_F_RSA_CHECK_KEY &&
                   ERR_GET_FUNC(err) == RSA_F_RSA_CHECK_KEY_EX &&
                   ERR_GET_REASON(err) != ERR_R_MALLOC_FAILURE) {
                BIO_printf(out, "RSA key error: %s\n",
                           ERR_reason_error_string(err));