summaryrefslogtreecommitdiffstats
path: root/crypto/crmf
diff options
context:
space:
mode:
authorPW Hu <jlu.hpw@foxmail.com>2021-11-10 12:39:54 +0800
committerTomas Mraz <tomas@openssl.org>2021-11-22 11:17:48 +0100
commit2349d7ba57c9327290df6f7bc18b7f0c3976ca9e (patch)
tree665b40724ec43bd912f90de936e06e4c890f9bdd /crypto/crmf
parent615a9b8798e6ec58f1b2e1ec08a0f6b3c8cb7f60 (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)
Diffstat (limited to 'crypto/crmf')
-rw-r--r--crypto/crmf/crmf_pbm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/crmf/crmf_pbm.c b/crypto/crmf/crmf_pbm.c
index aba6b3a16f..88a8480cf7 100644
--- a/crypto/crmf/crmf_pbm.c
+++ b/crypto/crmf/crmf_pbm.c
@@ -200,8 +200,8 @@ int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq,
mac_nid = OBJ_obj2nid(pbmp->mac->algorithm);
if (!EVP_PBE_find(EVP_PBE_TYPE_PRF, mac_nid, NULL, &hmac_md_nid, NULL)
- || !OBJ_obj2txt(hmac_mdname, sizeof(hmac_mdname),
- OBJ_nid2obj(hmac_md_nid), 0)) {
+ || OBJ_obj2txt(hmac_mdname, sizeof(hmac_mdname),
+ OBJ_nid2obj(hmac_md_nid), 0) <= 0) {
ERR_raise(ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_ALGORITHM);
goto err;
}