]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix style nits in crl_set_issuers
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 23 May 2022 15:26:15 +0000 (17:26 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 25 May 2022 12:06:34 +0000 (14:06 +0200)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18385)

crypto/x509/x_crl.c

index 4fb3096673bce79b3cfcd75710f955bcc4a30e57..a19b0528b78b9862ce99c30e2d313441a1c3d643 100644 (file)
@@ -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;