diff options
author | PW Hu <jlu.hpw@foxmail.com> | 2021-11-10 12:39:54 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-11-22 11:18:49 +0100 |
commit | 24ba865cfc7c04fba813ecb86ac7c1b329e3305f (patch) | |
tree | 3505802cf7fd523acca85ca9a68a3555470fc0a4 /test | |
parent | f89b54460053404d85b9a91a8b6a2b30e254bdf8 (diff) |
Fix the return check of OBJ_obj2txt
Also update OBJ_nid2obj.pod to document the possible return values.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17005)
(cherry picked from commit 2349d7ba57c9327290df6f7bc18b7f0c3976ca9e)
Diffstat (limited to 'test')
-rw-r--r-- | test/algorithmid_test.c | 2 | ||||
-rw-r--r-- | test/evp_fetch_prov_test.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/test/algorithmid_test.c b/test/algorithmid_test.c index ce5fbffc22..0104425c1d 100644 --- a/test/algorithmid_test.c +++ b/test/algorithmid_test.c @@ -48,7 +48,7 @@ static int test_spki_aid(X509_PUBKEY *pubkey, const char *filename) goto end; X509_ALGOR_get0(&oid, NULL, NULL, alg); - if (!TEST_true(OBJ_obj2txt(name, sizeof(name), oid, 0))) + if (!TEST_int_gt(OBJ_obj2txt(name, sizeof(name), oid, 0), 0)) goto end; /* diff --git a/test/evp_fetch_prov_test.c b/test/evp_fetch_prov_test.c index fc10bdad57..d237082bdc 100644 --- a/test/evp_fetch_prov_test.c +++ b/test/evp_fetch_prov_test.c @@ -220,11 +220,11 @@ static int test_explicit_EVP_MD_fetch_by_X509_ALGOR(int idx) X509_ALGOR_get0(&obj, NULL, NULL, algor); switch (idx) { case 0: - if (!TEST_true(OBJ_obj2txt(id, sizeof(id), obj, 0))) + if (!TEST_int_gt(OBJ_obj2txt(id, sizeof(id), obj, 0), 0)) goto end; break; case 1: - if (!TEST_true(OBJ_obj2txt(id, sizeof(id), obj, 1))) + if (!TEST_int_gt(OBJ_obj2txt(id, sizeof(id), obj, 1), 0)) goto end; break; } @@ -336,11 +336,11 @@ static int test_explicit_EVP_CIPHER_fetch_by_X509_ALGOR(int idx) X509_ALGOR_get0(&obj, NULL, NULL, algor); switch (idx) { case 0: - if (!TEST_true(OBJ_obj2txt(id, sizeof(id), obj, 0))) + if (!TEST_int_gt(OBJ_obj2txt(id, sizeof(id), obj, 0), 0)) goto end; break; case 1: - if (!TEST_true(OBJ_obj2txt(id, sizeof(id), obj, 1))) + if (!TEST_int_gt(OBJ_obj2txt(id, sizeof(id), obj, 1), 0)) goto end; break; } |