style : fix some if(...

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/4457)
This commit is contained in:
FdaSilvaYY 2017-08-26 17:56:44 +02:00
parent 89635075d8
commit f479eab227
8 changed files with 24 additions and 24 deletions

View file

@ -198,7 +198,7 @@ static int psk_use_session_cb(SSL *s, const EVP_MD *md,
if (key_len == EVP_MD_size(EVP_sha256()))
cipher = SSL_CIPHER_find(s, tls13_aes128gcmsha256_id);
else if(key_len == EVP_MD_size(EVP_sha384()))
else if (key_len == EVP_MD_size(EVP_sha384()))
cipher = SSL_CIPHER_find(s, tls13_aes256gcmsha384_id);
if (cipher == NULL) {

View file

@ -208,7 +208,7 @@ static int psk_find_session_cb(SSL *ssl, const unsigned char *identity,
if (key_len == EVP_MD_size(EVP_sha256()))
cipher = SSL_CIPHER_find(ssl, tls13_aes128gcmsha256_id);
else if(key_len == EVP_MD_size(EVP_sha384()))
else if (key_len == EVP_MD_size(EVP_sha384()))
cipher = SSL_CIPHER_find(ssl, tls13_aes256gcmsha384_id);
if (cipher == NULL) {

View file

@ -111,7 +111,7 @@ _dopr(char **sbuffer,
if (ch == '%')
state = DP_S_FLAGS;
else
if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
return 0;
ch = *format++;
break;
@ -293,8 +293,8 @@ _dopr(char **sbuffer,
return 0;
break;
case 'c':
if(!doapr_outch(sbuffer, buffer, &currlen, maxlen,
va_arg(args, int)))
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
va_arg(args, int)))
return 0;
break;
case 's':
@ -323,7 +323,7 @@ _dopr(char **sbuffer,
}
break;
case '%':
if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
return 0;
break;
case 'w':
@ -354,7 +354,7 @@ _dopr(char **sbuffer,
if (*truncated)
currlen = *maxlen - 1;
}
if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
return 0;
*retlen = currlen - 1;
return 1;
@ -392,19 +392,19 @@ fmtstr(char **sbuffer,
padlen = -padlen;
while ((padlen > 0) && (max < 0 || cnt < max)) {
if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
return 0;
--padlen;
++cnt;
}
while (strln > 0 && (max < 0 || cnt < max)) {
if(!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
return 0;
--strln;
++cnt;
}
while ((padlen < 0) && (max < 0 || cnt < max)) {
if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
return 0;
++padlen;
++cnt;
@ -472,19 +472,19 @@ fmtint(char **sbuffer,
/* spaces */
while (spadlen > 0) {
if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' '))
return 0;
--spadlen;
}
/* sign */
if (signvalue)
if(!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue))
return 0;
/* prefix */
while (*prefix) {
if(!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix))
if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix))
return 0;
prefix++;
}
@ -492,7 +492,7 @@ fmtint(char **sbuffer,
/* zeros */
if (zpadlen > 0) {
while (zpadlen > 0) {
if(!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0'))
return 0;
--zpadlen;
}
@ -758,8 +758,8 @@ fmtfp(char **sbuffer,
return 0;
while (fplace > 0) {
if(!doapr_outch(sbuffer, buffer, currlen, maxlen,
fconvert[--fplace]))
if (!doapr_outch(sbuffer, buffer, currlen, maxlen,
fconvert[--fplace]))
return 0;
}
}
@ -913,7 +913,7 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
size_t retlen;
int truncated;
if(!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
return -1;
if (truncated)

View file

@ -265,7 +265,7 @@ int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert)
return (ASN1_STRING_length(respid->value.byKey) == SHA_DIGEST_LENGTH)
&& (memcmp(ASN1_STRING_get0_data(respid->value.byKey), md,
SHA_DIGEST_LENGTH) == 0);
} else if(respid->type == V_OCSP_RESPID_NAME) {
} else if (respid->type == V_OCSP_RESPID_NAME) {
if (respid->value.byName == NULL)
return 0;

View file

@ -437,8 +437,8 @@ static void dummy_pause_job(void) {
#endif
*writefd = pipefds[1];
if(!ASYNC_WAIT_CTX_set_wait_fd(waitctx, engine_dasync_id, pipefds[0],
writefd, wait_cleanup)) {
if (!ASYNC_WAIT_CTX_set_wait_fd(waitctx, engine_dasync_id, pipefds[0],
writefd, wait_cleanup)) {
wait_cleanup(waitctx, engine_dasync_id, pipefds[0], writefd);
return;
}

View file

@ -920,8 +920,8 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
* This will be at most one cipher block or the tag length if using
* AEAD. SSL_RT_MAX_CIPHER_BLOCK_SIZE covers either case.
*/
if(!WPACKET_reserve_bytes(thispkt, SSL_RT_MAX_CIPHER_BLOCK_SIZE,
NULL)
if (!WPACKET_reserve_bytes(thispkt, SSL_RT_MAX_CIPHER_BLOCK_SIZE,
NULL)
/*
* We also need next the amount of bytes written to this
* sub-packet

View file

@ -448,7 +448,7 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
*/
if (!ssl3_digest_cached_records(s, 1))
return 0;
if(!ssl_handshake_hash(s, hash, sizeof(hash), &hashlen))
if (!ssl_handshake_hash(s, hash, sizeof(hash), &hashlen))
return 0;
#ifdef SSL_DEBUG
fprintf(stderr, "Handshake hashes:\n");

View file

@ -282,7 +282,7 @@ void test_perror(const char *s);
* a default description that indicates the file and line number of the error.
*
* The following macros guarantee to evaluate each argument exactly once.
* This allows constructs such as: if(!TEST_ptr(ptr = OPENSSL_malloc(..)))
* This allows constructs such as: if (!TEST_ptr(ptr = OPENSSL_malloc(..)))
* to produce better contextual output than:
* ptr = OPENSSL_malloc(..);
* if (!TEST_ptr(ptr))