From 28b86f313b43cc70d11054d3830ef82e7af8290a Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Wed, 24 Aug 2016 00:17:31 +0200 Subject: [PATCH] Fix some extra or missing whitespaces... Reviewed-by: Rich Salz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/1618) --- apps/apps.h | 2 +- apps/ec.c | 2 +- apps/prime.c | 2 +- crypto/blake2/blake2s.c | 2 +- crypto/dsa/dsa_meth.c | 2 +- doc/man3/EVP_DigestInit.pod | 5 ++--- doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod | 6 +++--- include/openssl/dsa.h | 2 +- test/asynciotest.c | 2 +- test/handshake_helper.c | 2 +- test/ssltestlib.c | 4 ++-- test/verify_extra_test.c | 4 ++-- 12 files changed, 17 insertions(+), 18 deletions(-) diff --git a/apps/apps.h b/apps/apps.h index 7cdf711706..5bf8c1dfa2 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -294,7 +294,7 @@ typedef struct options_st { /* * value type: - no value (also the value zero), n number, p positive * number, u unsigned, l long, s string, < input file, > output file, - * f any format, F der/pem format , E der/pem/engine format identifier. + * f any format, F der/pem format, E der/pem/engine format identifier. * l, n and u include zero; p does not. */ int valtype; diff --git a/apps/ec.c b/apps/ec.c index eb343d16a0..06f357d1dd 100644 --- a/apps/ec.c +++ b/apps/ec.c @@ -185,7 +185,7 @@ int ec_main(int argc, char **argv) } else if (informat == FORMAT_ENGINE) { EVP_PKEY *pkey; if (pubin) - pkey = load_pubkey(infile, informat , 1, passin, e, "Public Key"); + pkey = load_pubkey(infile, informat, 1, passin, e, "Public Key"); else pkey = load_key(infile, informat, 1, passin, e, "Private Key"); if (pkey != NULL) { diff --git a/apps/prime.c b/apps/prime.c index 1092cf215e..3c72330c0a 100644 --- a/apps/prime.c +++ b/apps/prime.c @@ -106,7 +106,7 @@ int prime_main(int argc, char **argv) else r = BN_dec2bn(&bn, argv[0]); - if(!r) { + if (!r) { BIO_printf(bio_err, "Failed to process value (%s)\n", argv[0]); goto end; } diff --git a/crypto/blake2/blake2s.c b/crypto/blake2/blake2s.c index 0b3503e4f0..7451b14f5a 100644 --- a/crypto/blake2/blake2s.c +++ b/crypto/blake2/blake2s.c @@ -219,7 +219,7 @@ int BLAKE2s_Update(BLAKE2S_CTX *c, const void *data, size_t datalen) in += fill; datalen -= fill; } - if (datalen > BLAKE2S_BLOCKBYTES) { + if (datalen > BLAKE2S_BLOCKBYTES) { size_t stashlen = datalen % BLAKE2S_BLOCKBYTES; /* * If |datalen| is a multiple of the blocksize, stash diff --git a/crypto/dsa/dsa_meth.c b/crypto/dsa/dsa_meth.c index f0188f2007..51a486b2ec 100644 --- a/crypto/dsa/dsa_meth.c +++ b/crypto/dsa/dsa_meth.c @@ -132,7 +132,7 @@ int DSA_meth_set_sign_setup(DSA_METHOD *dsam, } int (*DSA_meth_get_verify(const DSA_METHOD *dsam)) - (const unsigned char *, int , DSA_SIG *, DSA *) + (const unsigned char *, int, DSA_SIG *, DSA *) { return dsam->dsa_do_verify; } diff --git a/doc/man3/EVP_DigestInit.pod b/doc/man3/EVP_DigestInit.pod index 14f195a089..d57f09daad 100644 --- a/doc/man3/EVP_DigestInit.pod +++ b/doc/man3/EVP_DigestInit.pod @@ -210,14 +210,13 @@ digest name passed on the command line. unsigned char md_value[EVP_MAX_MD_SIZE]; int md_len, i; - if(!argv[1]) { + if (!argv[1]) { printf("Usage: mdtest digestname\n"); exit(1); } md = EVP_get_digestbyname(argv[1]); - - if(!md) { + if (md == NULL) { printf("Unknown message digest %s\n", argv[1]); exit(1); } diff --git a/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod b/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod index e9e4b39b05..71f8792275 100644 --- a/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod +++ b/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod @@ -155,17 +155,17 @@ Reference Implementation: } else { /* retrieve session */ key = findkey(name); - if (!key || key->expire < now() ) { + if (!key || key->expire < now() ) { return 0; } HMAC_Init_ex(&hctx, key->hmac_key, 16, EVP_sha256(), NULL); EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key->aes_key, iv ); - if (key->expire < ( now() - RENEW_TIME ) ) { + if (key->expire < ( now() - RENEW_TIME ) ) /* return 2 - this session will get a new ticket even though the current is still valid */ return 2; - } + return 1; } diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h index 139718edb9..d03e6de395 100644 --- a/include/openssl/dsa.h +++ b/include/openssl/dsa.h @@ -199,7 +199,7 @@ int (*DSA_meth_get_sign_setup(const DSA_METHOD *dsam)) int DSA_meth_set_sign_setup(DSA_METHOD *dsam, int (*sign_setup) (DSA *, BN_CTX *, BIGNUM **, BIGNUM **)); int (*DSA_meth_get_verify(const DSA_METHOD *dsam)) - (const unsigned char *, int , DSA_SIG *, DSA *); + (const unsigned char *, int, DSA_SIG *, DSA *); int DSA_meth_set_verify(DSA_METHOD *dsam, int (*verify) (const unsigned char *, int, DSA_SIG *, DSA *)); int (*DSA_meth_get_mod_exp(const DSA_METHOD *dsam)) diff --git a/test/asynciotest.c b/test/asynciotest.c index e14747265d..d4edd94936 100644 --- a/test/asynciotest.c +++ b/test/asynciotest.c @@ -205,7 +205,7 @@ static int async_write(BIO *bio, const char *in, int inl) /* Write any data we have left after fragmenting */ ret = 0; if ((int)written < inl) { - ret = BIO_write(next, in + written , inl - written); + ret = BIO_write(next, in + written, inl - written); } if (ret <= 0 && BIO_should_write(next)) diff --git a/test/handshake_helper.c b/test/handshake_helper.c index c8fd47430a..fd79565bef 100644 --- a/test/handshake_helper.c +++ b/test/handshake_helper.c @@ -837,7 +837,7 @@ static char *dup_str(const unsigned char *in, size_t len) { char *ret; - if(len == 0) + if (len == 0) return NULL; /* Assert that the string does not contain NUL-bytes. */ diff --git a/test/ssltestlib.c b/test/ssltestlib.c index 42ba98cb7a..57039e77a9 100644 --- a/test/ssltestlib.c +++ b/test/ssltestlib.c @@ -155,7 +155,7 @@ static void dump_data(const char *data, int len) printf("*** Message Fragment len: %d\n", fraglen); if (fragoff + fraglen > msglen) printf("***---- HANDSHAKE MESSAGE FRAGMENT INVALID ----\n"); - else if(reclen < fraglen) + else if (reclen < fraglen) printf("**---- HANDSHAKE MESSAGE FRAGMENT TRUNCATED ----\n"); else printf("**---- END OF HANDSHAKE MESSAGE FRAGMENT ----\n"); @@ -442,7 +442,7 @@ int mempacket_test_inject(BIO *bio, const char *in, int inl, int pktnum, else return inl; } while(1); - } else if(looppkt->num == thispkt->num) { + } else if (looppkt->num == thispkt->num) { if (!ctx->noinject) { /* We injected two packets with the same packet number! */ return -1; diff --git a/test/verify_extra_test.c b/test/verify_extra_test.c index cc05bc2ef1..bfbe5c02f1 100644 --- a/test/verify_extra_test.c +++ b/test/verify_extra_test.c @@ -102,7 +102,7 @@ static int test_alt_chains_cert_forgery(const char *roots_f, lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); if (lookup == NULL) goto err; - if(!X509_LOOKUP_load_file(lookup, roots_f, X509_FILETYPE_PEM)) + if (!X509_LOOKUP_load_file(lookup, roots_f, X509_FILETYPE_PEM)) goto err; untrusted = load_certs_from_file(untrusted_f); @@ -110,7 +110,7 @@ static int test_alt_chains_cert_forgery(const char *roots_f, if ((bio = BIO_new_file(bad_f, "r")) == NULL) goto err; - if((x = PEM_read_bio_X509(bio, NULL, 0, NULL)) == NULL) + if ((x = PEM_read_bio_X509(bio, NULL, 0, NULL)) == NULL) goto err; sctx = X509_STORE_CTX_new(); -- GitLab