aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2022-05-23 17:26:15 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2022-05-25 14:06:34 +0200
commitcb0c36d124991e35a9e778056ec8fce23a14dad5 (patch)
treed4ca7213fa99b53bffa93b8d39466f3d8fc64282
parente9007e09792e3735d4973743634ff55d354fc7d8 (diff)
downloadopenssl-cb0c36d124991e35a9e778056ec8fce23a14dad5.tar.gz
Fix style nits in crl_set_issuers
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18385)
-rw-r--r--crypto/x509/x_crl.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/crypto/x509/x_crl.c b/crypto/x509/x_crl.c
index 4fb3096673..a19b0528b7 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;