diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2024-03-26 23:41:46 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2024-03-26 23:41:46 +0000 |
commit | 635447ee33618cfc7738aa7e18a273726f561db4 (patch) | |
tree | 2093ed8378c7867a9ac663fb0bb26b792196b55a | |
parent | 8193643e6216864331ea10045074e2936b71a884 (diff) |
Cosmetics, mostly removal of silly parentheses
No change in generated assembly
-rw-r--r-- | lib/libcrypto/x509/x509cset.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/lib/libcrypto/x509/x509cset.c b/lib/libcrypto/x509/x509cset.c index 859c9724b5d..468831266ff 100644 --- a/lib/libcrypto/x509/x509cset.c +++ b/lib/libcrypto/x509/x509cset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509cset.c,v 1.21 2024/03/26 22:45:38 tb Exp $ */ +/* $OpenBSD: x509cset.c,v 1.22 2024/03/26 23:41:45 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -68,8 +68,7 @@ int X509_CRL_up_ref(X509_CRL *x) { - int refs = CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509_CRL); - return (refs > 1) ? 1 : 0; + return CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509_CRL) > 1; } LCRYPTO_ALIAS(X509_CRL_up_ref); @@ -77,28 +76,28 @@ int X509_CRL_set_version(X509_CRL *x, long version) { if (x == NULL) - return (0); + return 0; /* * RFC 5280, 4.1: versions 1 - 3 are specified as follows. * Version ::= INTEGER { v1(0), v2(1), v3(2) } * The only specified versions for CRLs are 1 and 2. */ if (version < 0 || version > 1) - return (0); + return 0; if (x->crl->version == NULL) { if ((x->crl->version = ASN1_INTEGER_new()) == NULL) - return (0); + return 0; } - return (ASN1_INTEGER_set(x->crl->version, version)); + return ASN1_INTEGER_set(x->crl->version, version); } LCRYPTO_ALIAS(X509_CRL_set_version); int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name) { - if ((x == NULL) || (x->crl == NULL)) - return (0); - return (X509_NAME_set(&x->crl->issuer, name)); + if (x == NULL || x->crl == NULL) + return 0; + return X509_NAME_set(&x->crl->issuer, name); } LCRYPTO_ALIAS(X509_CRL_set_issuer_name); @@ -108,7 +107,7 @@ X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm) ASN1_TIME *in; if (x == NULL) - return (0); + return 0; in = x->crl->lastUpdate; if (in != tm) { in = ASN1_STRING_dup(tm); @@ -117,7 +116,7 @@ X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm) x->crl->lastUpdate = in; } } - return (in != NULL); + return in != NULL; } LCRYPTO_ALIAS(X509_CRL_set_lastUpdate); @@ -134,7 +133,7 @@ X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm) ASN1_TIME *in; if (x == NULL) - return (0); + return 0; in = x->crl->nextUpdate; if (in != tm) { in = ASN1_STRING_dup(tm); @@ -143,7 +142,7 @@ X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm) x->crl->nextUpdate = in; } } - return (in != NULL); + return in != NULL; } LCRYPTO_ALIAS(X509_CRL_set_nextUpdate); @@ -157,11 +156,10 @@ LCRYPTO_ALIAS(X509_CRL_set1_nextUpdate); int X509_CRL_sort(X509_CRL *c) { - int i; X509_REVOKED *r; + int i; - /* sort the data so it will be written in serial - * number order */ + /* Sort the data so it will be written in serial number order */ sk_X509_REVOKED_sort(c->crl->revoked); for (i = 0; i < sk_X509_REVOKED_num(c->crl->revoked); i++) { r = sk_X509_REVOKED_value(c->crl->revoked, i); @@ -199,7 +197,7 @@ X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm) ASN1_TIME *in; if (x == NULL) - return (0); + return 0; in = x->revocationDate; if (in != tm) { in = ASN1_STRING_dup(tm); @@ -208,7 +206,7 @@ X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm) x->revocationDate = in; } } - return (in != NULL); + return in != NULL; } LCRYPTO_ALIAS(X509_REVOKED_set_revocationDate); @@ -218,7 +216,7 @@ X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial) ASN1_INTEGER *in; if (x == NULL) - return (0); + return 0; in = x->serialNumber; if (in != serial) { in = ASN1_INTEGER_dup(serial); @@ -227,7 +225,7 @@ X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial) x->serialNumber = in; } } - return (in != NULL); + return in != NULL; } LCRYPTO_ALIAS(X509_REVOKED_set_serialNumber); |