From: Peiwei Hu Date: Tue, 24 May 2022 16:09:54 +0000 (+0800) Subject: Fix the checks of X509_REVOKED_add1_ext_i2d X-Git-Tag: openssl-3.2.0-alpha1~2491 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c540a82767954a616934ba6caa6ddc736502c574;p=thirdparty%2Fopenssl.git Fix the checks of X509_REVOKED_add1_ext_i2d Reviewed-by: Dmitry Belyavskiy Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18400) --- diff --git a/apps/ca.c b/apps/ca.c index 23c7f05a2c9..460099a63ee 100644 --- a/apps/ca.c +++ b/apps/ca.c @@ -2479,18 +2479,18 @@ static int make_revoked(X509_REVOKED *rev, const char *str) rtmp = ASN1_ENUMERATED_new(); if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code)) goto end; - if (!X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rtmp, 0, 0)) + if (X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rtmp, 0, 0) <= 0) goto end; } if (rev && comp_time) { - if (!X509_REVOKED_add1_ext_i2d - (rev, NID_invalidity_date, comp_time, 0, 0)) + if (X509_REVOKED_add1_ext_i2d + (rev, NID_invalidity_date, comp_time, 0, 0) <= 0) goto end; } if (rev && hold) { - if (!X509_REVOKED_add1_ext_i2d - (rev, NID_hold_instruction_code, hold, 0, 0)) + if (X509_REVOKED_add1_ext_i2d + (rev, NID_hold_instruction_code, hold, 0, 0) <= 0) goto end; }