Fix return value error in doc, and an error test
authorPW Hu <jlu.hpw@foxmail.com>
Fri, 22 Oct 2021 10:10:17 +0000 (18:10 +0800)
committerPauli <pauli@openssl.org>
Thu, 28 Oct 2021 03:17:40 +0000 (13:17 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16889)

[edited to remove end of line whitespace and wrap lines to eighty columns]

doc/man3/RSA_print.pod
test/evp_pkey_provided_test.c

index f85c5f3f479761decaa511e1ff9f563e191e30c0..fa5eb1def0705036f19f2840ee274bc815e2a8b9 100644 (file)
@@ -50,7 +50,10 @@ The output lines are indented by B<offset> spaces.
 
 =head1 RETURN VALUES
 
-These functions return 1 on success, 0 on error.
+DSAparams_print(), DSAparams_print_fp(), DSA_print(), and DSA_print_fp()
+return 1 for success and 0 or a negative value for failure.
+
+DHparams_print() and DHparams_print_fp() return 1 on success, 0 on error.
 
 =head1 SEE ALSO
 
index 15c8ce77bb89a5e6873da0f7aa899971746d35fa..f6424b86fab412e860cebe4e2c763dbc63926796 100644 (file)
@@ -141,7 +141,7 @@ static int test_print_key_using_pem(const char *alg, const EVP_PKEY *pk)
                                             (unsigned char *)"pass", 4,
                                             NULL, NULL))
         /* Private key in text form */
-        || !TEST_true(EVP_PKEY_print_private(membio, pk, 0, NULL))
+        || !TEST_int_gt(EVP_PKEY_print_private(membio, pk, 0, NULL), 0)
         || !TEST_true(compare_with_file(alg, PRIV_TEXT, membio))
         /* Public key in PEM form */
         || !TEST_true(PEM_write_bio_PUBKEY(membio, pk))