Whitespace cleanup in crypto
authorFdaSilvaYY <fdasilvayy@gmail.com>
Tue, 28 Jun 2016 20:51:01 +0000 (22:51 +0200)
committerRich Salz <rsalz@openssl.org>
Wed, 29 Jun 2016 13:56:39 +0000 (09:56 -0400)
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1264)

23 files changed:
crypto/aes/aes_core.c
crypto/aes/aes_x86core.c
crypto/asn1/asn1_par.c
crypto/bn/bn_div.c
crypto/bn/bn_exp.c
crypto/bn/bn_gcd.c
crypto/bn/bn_prime.c
crypto/conf/conf_mod.c
crypto/ec/ec_lib.c
crypto/evp/bio_ok.c
crypto/evp/e_aes_cbc_hmac_sha1.c
crypto/modes/ocb128.c
crypto/objects/obj_dat.h
crypto/pkcs7/pk7_doit.c
crypto/rsa/rsa_pk1.c
crypto/ts/ts_rsp_verify.c
crypto/x509/x509_vfy.c
include/openssl/bn.h
include/openssl/buffer.h
include/openssl/err.h
include/openssl/pkcs12.h
include/openssl/srp.h
include/openssl/x509v3.h

index ef0fc51d952ff93c18fed34768257381fe09db66..69be3d85c751a40a7da52784a661612e0a564f55 100644 (file)
@@ -1355,7 +1355,7 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
             rk[j] = tpe ^ ROTATE(tpd,16) ^
                 ROTATE(tp9,24) ^ ROTATE(tpb,8);
 #else
-            rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^ 
+            rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^
                 (tp9 >> 8) ^ (tp9 << 24) ^
                 (tpb >> 24) ^ (tpb << 8);
 #endif
index dd7e905470f02006533ebfc31eca2a24c875e77a..95b49bbabc28423b8d99f60f19e4a8320de715d8 100644 (file)
@@ -621,7 +621,7 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
             rk[j] = tpe ^ ROTATE(tpd,16) ^
                 ROTATE(tp9,8) ^ ROTATE(tpb,24);
 #else
-            rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^ 
+            rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^
                 (tp9 >> 24) ^ (tp9 << 8) ^
                 (tpb >> 8) ^ (tpb << 24);
 #endif
@@ -910,7 +910,7 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
            (u32)Td4[(s1 >> 16) & 0xff] << 16 ^
            (u32)Td4[(s0 >> 24)       ] << 24;
 
-    /* now do the linear transform using words */ 
+    /* now do the linear transform using words */
     {
         int i;
         u32 tp1, tp2, tp4, tp8, tp9, tpb, tpd, tpe, m;
@@ -934,7 +934,7 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
             t[i] = tpe ^ ROTATE(tpd,16) ^
                 ROTATE(tp9,8) ^ ROTATE(tpb,24);
 #else
-            t[i] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^ 
+            t[i] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^
                 (tp9 >> 24) ^ (tp9 << 8) ^
                 (tpb >> 8) ^ (tpb << 24);
 #endif
@@ -987,7 +987,7 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
                (u32)Td4[(s1 >> 16) & 0xff] << 16 ^
                (u32)Td4[(s0 >> 24)       ] << 24;
 
-    /* now do the linear transform using words */ 
+    /* now do the linear transform using words */
     {
         int i;
         u32 tp1, tp2, tp4, tp8, tp9, tpb, tpd, tpe, m;
@@ -1011,7 +1011,7 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
             t[i] = tpe ^ ROTATE(tpd,16) ^
                 ROTATE(tp9,8) ^ ROTATE(tpb,24);
 #else
-            t[i] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^ 
+            t[i] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^
                 (tp9 >> 24) ^ (tp9 << 8) ^
                 (tpb >> 8) ^ (tpb << 24);
 #endif
index 1e17895f264307f6fe9f4a996922c07ece4d30f2..4db3df9b8d3e58507854f5105cce308adf48dee6 100644 (file)
@@ -116,7 +116,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
             goto end;
         if (j & V_ASN1_CONSTRUCTED) {
             const unsigned char *sp = p;
-                
+
             ep = p + len;
             if (BIO_write(bp, "\n", 1) <= 0)
                 goto end;
index eef1b878c810c9eb3841ea09f7fea204b628ebf0..0bec12b1c8ce01a458faf439bf537dc18fd9a926 100644 (file)
@@ -130,7 +130,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
 # endif                         /* OPENSSL_NO_ASM */
 
 /*-
- * BN_div computes  dv := num / divisor,  rounding towards
+ * BN_div computes  dv := num / divisor, rounding towards
  * zero, and sets up rm  such that  dv*divisor + rm = num  holds.
  * Thus:
  *     dv->neg == num->neg ^ divisor->neg  (unless the result is zero)
index d334cf705bb385bad0c78a90db395b0840892b0d..e2f0d5e3168ac86f628d8a4a1ad6a1aebbed5f3a 100644 (file)
@@ -97,7 +97,7 @@ int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
     bn_check_top(m);
 
     /*-
-     * For even modulus  m = 2^k*m_odd,  it might make sense to compute
+     * For even modulus  m = 2^k*m_odd, it might make sense to compute
      * a^p mod m_odd  and  a^p mod 2^k  separately (with Montgomery
      * exponentiation for the odd part), using appropriate exponent
      * reductions, and combine the results using the CRT.
index 1039e7630f63a1b7794ca5d0171f9427e35cc7b9..e1aac131c542300591a6c88b1d4b4056cd6daaa9 100644 (file)
@@ -370,7 +370,7 @@ BIGNUM *int_bn_mod_inverse(BIGNUM *in,
              * i.e.
              *        sign*(Y + D*X)*a  ==  B  (mod |n|).
              *
-             * So if we set  (X, Y, sign) := (Y + D*X, X, -sign),  we arrive back at
+             * So if we set  (X, Y, sign) := (Y + D*X, X, -sign), we arrive back at
              *      -sign*X*a  ==  B   (mod |n|),
              *       sign*Y*a  ==  A   (mod |n|).
              * Note that  X  and  Y  stay non-negative all the time.
@@ -565,7 +565,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
          * i.e.
          *        sign*(Y + D*X)*a  ==  B  (mod |n|).
          *
-         * So if we set  (X, Y, sign) := (Y + D*X, X, -sign),  we arrive back at
+         * So if we set  (X, Y, sign) := (Y + D*X, X, -sign), we arrive back at
          *      -sign*X*a  ==  B   (mod |n|),
          *       sign*Y*a  ==  A   (mod |n|).
          * Note that  X  and  Y  stay non-negative all the time.
index 1c41938fedb73d16f58447a8cfb623ec5b543bc1..8e7f4f5676b913014fa80a4931cfdb7e100723b5 100644 (file)
@@ -430,7 +430,7 @@ static int probable_prime(BIGNUM *rnd, int bits, prime_t *mods)
      */
     if (is_single_word) {
         BN_ULONG size_limit;
-        
+
         if (bits == BN_BITS2) {
             /*
              * Shifting by this much has undefined behaviour so we do it a
index d01d20e3d4483b01cad96d19725e5827c8845f61..31f838e0fa7ca650be2d2ec9cf14d404fff23cb8 100644 (file)
@@ -64,7 +64,7 @@ static CONF_MODULE *module_add(DSO *dso, const char *name,
 static CONF_MODULE *module_find(const char *name);
 static int module_init(CONF_MODULE *pmod, const char *name, const char *value,
                        const CONF *cnf);
-static CONF_MODULE *module_load_dso(const CONF *cnf, const char *name, 
+static CONF_MODULE *module_load_dso(const CONF *cnf, const char *name,
                                     const char *value);
 
 /* Main function: load modules from a CONF structure */
@@ -181,7 +181,7 @@ static int module_run(const CONF *cnf, const char *name, const char *value,
 }
 
 /* Load a module from a DSO */
-static CONF_MODULE *module_load_dso(const CONF *cnf, 
+static CONF_MODULE *module_load_dso(const CONF *cnf,
                                     const char *name, const char *value)
 {
     DSO *dso = NULL;
index fa74ee76447741cd74409c6afd6dd04b9dc46e17..c592c067a1cd6c68d70849a28ed5f93bccc5ab63 100644 (file)
@@ -284,7 +284,6 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
     } else
         BN_zero(group->cofactor);
 
     /*
      * Some groups have an order with
      * factors of two, which makes the Montgomery setup fail.
index 33066e8d83197ddf109c2f826695d4583e574c96..7974b96311a96ab88539b5b383d0ede315589737 100644 (file)
@@ -402,7 +402,7 @@ static long ok_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
 {
     long ret = 1;
     BIO *next;
-    
+
     next = BIO_next(b);
 
     if (next == NULL)
index be1deaa474d7e93fbe5afe8adf9a82f1a4b8c8ee..0e1ad7461598c48f55fd6a809b0f2135bc72d76f 100644 (file)
@@ -818,7 +818,7 @@ static int aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
 
             if (arg != EVP_AEAD_TLS1_AAD_LEN)
                 return -1;
+
             len = p[arg - 2] << 8 | p[arg - 1];
 
             if (EVP_CIPHER_CTX_encrypting(ctx)) {
index 54a96b8e983fad52c75d9d859a42d89cd3568c39..c3bd13bbe2aa5e652a5bc9fbfade98d5c5474a51 100644 (file)
@@ -230,7 +230,7 @@ int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv,
 
     /*
      * Spec says IV is 120 bits or fewer - it allows non byte aligned lengths.
-     * We don't support  this at this stage
+     * We don't support this at this stage
      */
     if ((len > 15) || (len < 1) || (taglen > 16) || (taglen < 1)) {
         return -1;
index df03694974b9d890a47c487ade5345589a9ee455..be7565753e4d161f0a0301cfaf1a18cf5cd4feb6 100644 (file)
@@ -2314,11 +2314,11 @@ static const ASN1_OBJECT nid_objs[NUM_NID]={
 {"id-GostR3410-2001-CryptoPro-XchA-ParamSet",
        "id-GostR3410-2001-CryptoPro-XchA-ParamSet",
        NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet,7,&(lvalues[5609]),0},
-       
+
 {"id-GostR3410-2001-CryptoPro-XchB-ParamSet",
        "id-GostR3410-2001-CryptoPro-XchB-ParamSet",
        NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet,7,&(lvalues[5616]),0},
-       
+
 {"id-GostR3410-94-a","id-GostR3410-94-a",NID_id_GostR3410_94_a,7,
        &(lvalues[5623]),0},
 {"id-GostR3410-94-aBis","id-GostR3410-94-aBis",
index 24022416d225401d6272fdfd0178c50382a6f071..bc6bd30fc3c8bbce752a5bd96e415c421a6cca66 100644 (file)
@@ -582,7 +582,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
     BIO_free_all(btmp);
     BIO_free_all(etmp);
     BIO_free_all(bio);
-    return  NULL;
+    return NULL;
 }
 
 static BIO *PKCS7_find_digest(EVP_MD_CTX **pmd, BIO *bio, int nid)
index bac7c26a17385692fb8982931e3fcdb8b1cfae15..efb16a02e6edbc4dcbee54c1d25b2b074292c559 100644 (file)
@@ -183,7 +183,7 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
     /*
      * Always do this zero-padding copy (even when num == flen) to avoid
      * leaking that information. The copy still leaks some side-channel
-     * information, but it's impossible to have a fixed  memory access
+     * information, but it's impossible to have a fixed memory access
      * pattern since we can't read out of the bounds of |from|.
      *
      * TODO(emilia): Consider porting BN_bn2bin_padded from BoringSSL.
index 21da8aaa9e8f5a438082fc876e22d83b1d8648f5..091663686fa9bd5a4e5687a5f41c2628975ae203 100644 (file)
@@ -463,7 +463,7 @@ static char *ts_get_status_text(STACK_OF(ASN1_UTF8STRING) *text)
         TSerr(TS_F_TS_GET_STATUS_TEXT, ERR_R_MALLOC_FAILURE);
         return NULL;
     }
-    
+
     for (i = 0, p = result; i < sk_ASN1_UTF8STRING_num(text); ++i) {
         ASN1_UTF8STRING *current = sk_ASN1_UTF8STRING_value(text, i);
         length = ASN1_STRING_length(current);
index 15920840f904a4db3460fd1d01b3485e88a8f650..b400ce4ad63aa6de2c95d0715c3c08cc374f7108 100644 (file)
@@ -2538,7 +2538,7 @@ static int dane_match(X509_STORE_CTX *ctx, X509 *cert, int depth)
 
     /*
      * If we've previously matched a PKIX-?? record, no need to test any
-     * further PKIX-?? records,  it remains to just build the PKIX chain.
+     * further PKIX-?? records, it remains to just build the PKIX chain.
      * Had the match been a DANE-?? record, we'd be done already.
      */
     if (dane->mdpth >= 0)
index 82552b6e84c880dc81104f0f0fc4cc9f2b43f1a7..c4fca99ff60255d0c19afba8fa6886010064a446 100644 (file)
@@ -90,7 +90,7 @@ int BN_get_flags(const BIGNUM *b, int n);
  */
 void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags);
 
-/* Wrapper function to make using BN_GENCB easier */
+/* Wrapper function to make using BN_GENCB easier */
 int BN_GENCB_call(BN_GENCB *cb, int a, int b);
 
 BN_GENCB *BN_GENCB_new(void);
index 88409fd9eb9fea16f2b2010d22ae1c1b6e8deb7e..e2e1e5da9d475d1d834614d994451469d98458a7 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
 # define BUF_strlcpy(dst, src, size)  OPENSSL_strlcpy(dst, src, size)
 # define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size)
 # define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen)
+
 struct buf_mem_st {
     size_t length;              /* current number of bytes */
     char *data;
index b019d0e3bb6b6bfbd70ab662fe85609fad5ba51f..9dcd27e9becd291b694ae0fb1a3193cabb6f4ff8 100644 (file)
@@ -188,7 +188,7 @@ typedef struct err_state_st {
 # define ERR_R_INTERNAL_ERROR                    (4|ERR_R_FATAL)
 # define ERR_R_DISABLED                          (5|ERR_R_FATAL)
 # define ERR_R_INIT_FAIL                         (6|ERR_R_FATAL)
-# define ERR_R_PASSED_INVALID_ARGUMENT           (7) 
+# define ERR_R_PASSED_INVALID_ARGUMENT           (7)
 
 /*
  * 99 is the maximum possible ERR_R_... code, higher values are reserved for
index 37d02aef25c5c9cd8db1af63c506228d5b272509..4c49fb28815a7d108f983aefa2ae5c4f857901a1 100644 (file)
@@ -188,8 +188,8 @@ DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
 void PKCS12_PBE_add(void);
 int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
                  STACK_OF(X509) **ca);
-PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, 
-                      X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, 
+PKCS12 *PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey,
+                      X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert,
                       int iter, int mac_iter, int keytype);
 
 PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
index 80bcb0dd3832144a7784ddc3d06c0d18b70f8a01..f2b6ec750d51ea4a0bff5c2c22d9fc3a1b9ec317 100644 (file)
@@ -57,7 +57,7 @@ typedef struct SRP_VBASE_st {
 } SRP_VBASE;
 
 /*
- * Internal structure storing N and g pair 
+ * Internal structure storing N and g pair
  */
 typedef struct SRP_gN_st {
     char *id;
index 29b7194f265e57ab1ced26345f564228c23627a7..7b0403b9dce81163c22e2180aec8085edff9345e 100644 (file)
@@ -549,7 +549,7 @@ DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS)
 
 GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out,
                                const X509V3_EXT_METHOD *method,
-                               X509V3_CTX *ctx, int gen_type, 
+                               X509V3_CTX *ctx, int gen_type,
                                const char *value, int is_nc);
 
 # ifdef HEADER_CONF_H