From cb0c36d124991e35a9e778056ec8fce23a14dad5 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Mon, 23 May 2022 17:26:15 +0200 Subject: [PATCH] Fix style nits in crl_set_issuers Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18385) --- crypto/x509/x_crl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crypto/x509/x_crl.c b/crypto/x509/x_crl.c index 4fb3096673b..a19b0528b78 100644 --- a/crypto/x509/x_crl.c +++ b/crypto/x509/x_crl.c @@ -94,15 +94,15 @@ static int crl_set_issuers(X509_CRL *crl) STACK_OF(X509_EXTENSION) *exts; ASN1_ENUMERATED *reason; X509_EXTENSION *ext; + gtmp = X509_REVOKED_get_ext_d2i(rev, NID_certificate_issuer, &j, NULL); - if (!gtmp && (j != -1)) { + if (gtmp == NULL && j != -1) { crl->flags |= EXFLAG_INVALID; return 1; } - if (gtmp) { - gens = gtmp; + if (gtmp != NULL) { if (crl->issuers == NULL) { crl->issuers = sk_GENERAL_NAMES_new_null(); if (crl->issuers == NULL) { @@ -114,16 +114,17 @@ static int crl_set_issuers(X509_CRL *crl) GENERAL_NAMES_free(gtmp); return 0; } + gens = gtmp; } rev->issuer = gens; reason = X509_REVOKED_get_ext_d2i(rev, NID_crl_reason, &j, NULL); - if (!reason && (j != -1)) { + if (reason == NULL && j != -1) { crl->flags |= EXFLAG_INVALID; return 1; } - if (reason) { + if (reason != NULL) { rev->reason = ASN1_ENUMERATED_get(reason); ASN1_ENUMERATED_free(reason); } else @@ -136,7 +137,8 @@ static int crl_set_issuers(X509_CRL *crl) for (j = 0; j < sk_X509_EXTENSION_num(exts); j++) { ext = sk_X509_EXTENSION_value(exts, j); if (X509_EXTENSION_get_critical(ext)) { - if (OBJ_obj2nid(X509_EXTENSION_get_object(ext)) == NID_certificate_issuer) + if (OBJ_obj2nid(X509_EXTENSION_get_object(ext)) + == NID_certificate_issuer) continue; crl->flags |= EXFLAG_CRITICAL; break; -- 2.47.2