Fix strange formatting by indent
authorMatt Caswell <matt@openssl.org>
Wed, 21 Jan 2015 12:19:08 +0000 (12:19 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 22 Jan 2015 09:44:08 +0000 (09:44 +0000)
Conflicts:
crypto/hmac/hmac.h

Conflicts:
crypto/evp/e_aes_cbc_hmac_sha256.c

Conflicts:
crypto/ec/ecp_nistp224.c
crypto/ec/ecp_nistp256.c
crypto/ec/ecp_nistp521.c
crypto/ec/ectest.c

Reviewed-by: Tim Hudson <tjh@openssl.org>
14 files changed:
crypto/asn1/asn1_par.c
crypto/asn1/d2i_pu.c
crypto/asn1/t_x509.c
crypto/asn1/tasn_dec.c
crypto/des/set_key.c
crypto/dsa/dsa.h
crypto/ec/ec_lcl.h
crypto/evp/e_des3.c
crypto/hmac/hmac.h
crypto/rsa/rsa.h
crypto/sparcv9cap.c
engines/ccgost/gost94_keyx.c
engines/e_sureware.c
ssl/t1_enc.c

index aaca69aebd94ca286bac91742f5db55957674109..fad14c8ee01d55d0407eb3f05730d2fb52d81fc2 100644 (file)
@@ -418,14 +418,22 @@ end:
 const char *ASN1_tag2str(int tag)
 {
        static const char * const tag2str[] = {
-        "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", /* 0-4 */
-        "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL", /* 5-9 */
-        "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>",      /* 10-13 */
-       "<ASN1 14>", "<ASN1 15>", "SEQUENCE", "SET",                /* 15-17 */
-       "NUMERICSTRING", "PRINTABLESTRING", "T61STRING",            /* 18-20 */
-       "VIDEOTEXSTRING", "IA5STRING", "UTCTIME","GENERALIZEDTIME", /* 21-24 */
-       "GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING",          /* 25-27 */
-       "UNIVERSALSTRING", "<ASN1 29>", "BMPSTRING"                 /* 28-30 */
+        /* 0-4 */
+        "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING",
+        /* 5-9 */ 
+        "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL",
+        /* 10-13 */
+        "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>",
+        /* 15-17 */ 
+       "<ASN1 14>", "<ASN1 15>", "SEQUENCE", "SET",
+        /* 18-20 */  
+       "NUMERICSTRING", "PRINTABLESTRING", "T61STRING",
+        /* 21-24 */
+       "VIDEOTEXSTRING", "IA5STRING", "UTCTIME","GENERALIZEDTIME",
+        /* 25-27 */
+       "GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING",
+        /* 28-30 */
+       "UNIVERSALSTRING", "<ASN1 29>", "BMPSTRING"
        };
 
        if((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))
index c8f39ceb037beb1fef1cc42ed839a53fc7847871..1408eb2aab357e744c4154d495b8e3a7c4282e88 100644 (file)
@@ -97,8 +97,9 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
                {
 #ifndef OPENSSL_NO_RSA
        case EVP_PKEY_RSA:
+               /* TMP UGLY CAST */
                if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,
-                       (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
+                       (const unsigned char **)pp,length)) == NULL)
                        {
                        ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
                        goto err;
@@ -107,8 +108,9 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
 #endif
 #ifndef OPENSSL_NO_DSA
        case EVP_PKEY_DSA:
+               /* TMP UGLY CAST */
                if (!d2i_DSAPublicKey(&(ret->pkey.dsa),
-                       (const unsigned char **)pp,length)) /* TMP UGLY CAST */
+                       (const unsigned char **)pp,length))
                        {
                        ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
                        goto err;
index cdc42e762939dc1ba3b1110f5c7f46ba95d08394..2d021560b23f7f0ac1cededa5845f0ed5c42d133 100644 (file)
@@ -364,7 +364,8 @@ int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
        if (v[i-1] == 'Z') gmt=1;
        for (i=0; i<12; i++)
                if ((v[i] > '9') || (v[i] < '0')) goto err;
-       y= (v[0]-'0')*1000+(v[1]-'0')*100 + (v[2]-'0')*10+(v[3]-'0');
+       y= (v[0]-'0')*1000+(v[1]-'0')*100
+               + (v[2]-'0')*10+(v[3]-'0');
        M= (v[4]-'0')*10+(v[5]-'0');
        if ((M > 12) || (M < 1)) goto err;
        d= (v[6]-'0')*10+(v[7]-'0');
index 2cbfa814759601f5a912069898326b93a882dbe7..18e9f9be4fb9cfbb3b70eaccab4301da6006259e 100644 (file)
@@ -94,15 +94,24 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval,
 
 /* Table to convert tags to bit values, used for MSTRING type */
 static const unsigned long tag2bit[32] = {
-0,     0,      0,      B_ASN1_BIT_STRING,      /* tags  0 -  3 */
-B_ASN1_OCTET_STRING,   0,      0,              B_ASN1_UNKNOWN,/* tags  4- 7 */
-B_ASN1_UNKNOWN,        B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN,/* tags  8-11 */
-B_ASN1_UTF8STRING,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,/* tags 12-15 */
-B_ASN1_SEQUENCE,0,B_ASN1_NUMERICSTRING,B_ASN1_PRINTABLESTRING, /* tags 16-19 */
-B_ASN1_T61STRING,B_ASN1_VIDEOTEXSTRING,B_ASN1_IA5STRING,       /* tags 20-22 */
-B_ASN1_UTCTIME, B_ASN1_GENERALIZEDTIME,                               /* tags 23-24 */ 
-B_ASN1_GRAPHICSTRING,B_ASN1_ISO64STRING,B_ASN1_GENERALSTRING,  /* tags 25-27 */
-B_ASN1_UNIVERSALSTRING,B_ASN1_UNKNOWN,B_ASN1_BMPSTRING,B_ASN1_UNKNOWN, /* tags 28-31 */
+    /* tags  0 -  3 */
+0,     0,      0,      B_ASN1_BIT_STRING,      
+    /* tags  4- 7 */
+B_ASN1_OCTET_STRING,   0,      0,              B_ASN1_UNKNOWN,
+    /* tags  8-11 */
+B_ASN1_UNKNOWN,        B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN,
+    /* tags 12-15 */
+B_ASN1_UTF8STRING,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,
+    /* tags 16-19 */
+B_ASN1_SEQUENCE,0,B_ASN1_NUMERICSTRING,B_ASN1_PRINTABLESTRING,
+    /* tags 20-22 */
+B_ASN1_T61STRING,B_ASN1_VIDEOTEXSTRING,B_ASN1_IA5STRING,
+    /* tags 23-24 */
+B_ASN1_UTCTIME, B_ASN1_GENERALIZEDTIME,
+    /* tags 25-27 */
+B_ASN1_GRAPHICSTRING,B_ASN1_ISO64STRING,B_ASN1_GENERALSTRING,  
+    /* tags 28-31 */
+B_ASN1_UNIVERSALSTRING,B_ASN1_UNKNOWN,B_ASN1_BMPSTRING,B_ASN1_UNKNOWN,
        };
 
 unsigned long ASN1_tag2bit(int tag)
index 3033904c18df71f32c95ec01814848ffcce23887..59b220a93aba1240ed0847389a7e160eda3924e6 100644 (file)
@@ -182,7 +182,8 @@ static const DES_LONG des_skb[8][64]={
        0x00090020L,0x00090030L,0x20090020L,0x20090030L,
        0x00080820L,0x00080830L,0x20080820L,0x20080830L,
        0x00090820L,0x00090830L,0x20090820L,0x20090830L,
-       },{
+       },
+       {
        /* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */
        0x00000000L,0x02000000L,0x00002000L,0x02002000L,
        0x00200000L,0x02200000L,0x00202000L,0x02202000L,
@@ -200,7 +201,8 @@ static const DES_LONG des_skb[8][64]={
        0x10200400L,0x12200400L,0x10202400L,0x12202400L,
        0x10000404L,0x12000404L,0x10002404L,0x12002404L,
        0x10200404L,0x12200404L,0x10202404L,0x12202404L,
-       },{
+       },
+       {
        /* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */
        0x00000000L,0x00000001L,0x00040000L,0x00040001L,
        0x01000000L,0x01000001L,0x01040000L,0x01040001L,
@@ -218,7 +220,8 @@ static const DES_LONG des_skb[8][64]={
        0x09000200L,0x09000201L,0x09040200L,0x09040201L,
        0x08000202L,0x08000203L,0x08040202L,0x08040203L,
        0x09000202L,0x09000203L,0x09040202L,0x09040203L,
-       },{
+       },
+       {
        /* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */
        0x00000000L,0x00100000L,0x00000100L,0x00100100L,
        0x00000008L,0x00100008L,0x00000108L,0x00100108L,
@@ -236,7 +239,8 @@ static const DES_LONG des_skb[8][64]={
        0x04020008L,0x04120008L,0x04020108L,0x04120108L,
        0x04021000L,0x04121000L,0x04021100L,0x04121100L,
        0x04021008L,0x04121008L,0x04021108L,0x04121108L,
-       },{
+       },
+       {
        /* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
        0x00000000L,0x10000000L,0x00010000L,0x10010000L,
        0x00000004L,0x10000004L,0x00010004L,0x10010004L,
@@ -254,7 +258,8 @@ static const DES_LONG des_skb[8][64]={
        0x00101004L,0x10101004L,0x00111004L,0x10111004L,
        0x20101000L,0x30101000L,0x20111000L,0x30111000L,
        0x20101004L,0x30101004L,0x20111004L,0x30111004L,
-       },{
+       },
+       {
        /* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */
        0x00000000L,0x08000000L,0x00000008L,0x08000008L,
        0x00000400L,0x08000400L,0x00000408L,0x08000408L,
@@ -272,7 +277,8 @@ static const DES_LONG des_skb[8][64]={
        0x02000401L,0x0A000401L,0x02000409L,0x0A000409L,
        0x02020001L,0x0A020001L,0x02020009L,0x0A020009L,
        0x02020401L,0x0A020401L,0x02020409L,0x0A020409L,
-       },{
+       },
+       {
        /* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */
        0x00000000L,0x00000100L,0x00080000L,0x00080100L,
        0x01000000L,0x01000100L,0x01080000L,0x01080100L,
@@ -290,7 +296,8 @@ static const DES_LONG des_skb[8][64]={
        0x01200200L,0x01200300L,0x01280200L,0x01280300L,
        0x00200210L,0x00200310L,0x00280210L,0x00280310L,
        0x01200210L,0x01200310L,0x01280210L,0x01280310L,
-       },{
+       },
+       {
        /* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */
        0x00000000L,0x04000000L,0x00040000L,0x04040000L,
        0x00000002L,0x04000002L,0x00040002L,0x04040002L,
@@ -308,7 +315,8 @@ static const DES_LONG des_skb[8][64]={
        0x00000822L,0x04000822L,0x00040822L,0x04040822L,
        0x00002820L,0x04002820L,0x00042820L,0x04042820L,
        0x00002822L,0x04002822L,0x00042822L,0x04042822L,
-       }};
+       }
+};
 
 int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule)
        {
index ac50a5c846da15f37d9109b3ccf5b03636176b8f..e79fcf32fd168c7f3cc6b4c6e8ffc8720c9daeeb 100644 (file)
@@ -122,9 +122,10 @@ struct dsa_method
        int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
                        BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx,
                        BN_MONT_CTX *in_mont);
+       /* Can be null */
        int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
                                const BIGNUM *m, BN_CTX *ctx,
-                               BN_MONT_CTX *m_ctx); /* Can be null */
+                               BN_MONT_CTX *m_ctx);
        int (*init)(DSA *dsa);
        int (*finish)(DSA *dsa);
        int flags;
index 54cd1b3301e3416f57cf569cb066d69f0d9e2bc5..1d8b82a460baf5d45e15a4c9e15c2c0148acf40a 100644 (file)
@@ -169,8 +169,10 @@ struct ec_method_st {
        int (*field_sqr)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *);
        int (*field_div)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
 
-       int (*field_encode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); /* e.g. to Montgomery */
-       int (*field_decode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); /* e.g. from Montgomery */
+       /* e.g. to Montgomery */
+       int (*field_encode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *);
+       /* e.g. from Montgomery */
+       int (*field_decode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *);
        int (*field_set_to_one)(const EC_GROUP *, BIGNUM *r, BN_CTX *);
 } /* EC_METHOD */;
 
index c35370576a48ed3e74d481947d92c998792b3fc4..3e2ae3601851fa572c7ebfc2f4d074504a30c0f6 100644 (file)
@@ -179,8 +179,8 @@ static int des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
        DES_ede3_cfb_encrypt(c,d,1,1,
                             &data(ctx)->ks1,&data(ctx)->ks2,&data(ctx)->ks3,
                             (DES_cblock *)ctx->iv,ctx->encrypt);
-       out[n/8]=(out[n/8]&~(0x80 >> (unsigned int)(n%8))) |
-                ((d[0]&0x80) >> (unsigned int)(n%8));
+       out[n/8]=(out[n/8]&~(0x80 >> (unsigned int)(n%8)))
+               | ((d[0]&0x80) >> (unsigned int)(n%8));
        }
 
     return 1;
index 1be00221908d1211572b54950730b35947fd49dd..6322e545927fb4c8f00e1514cf5423cb196212be 100644 (file)
@@ -88,10 +88,12 @@ typedef struct hmac_ctx_st
 void HMAC_CTX_init(HMAC_CTX *ctx);
 void HMAC_CTX_cleanup(HMAC_CTX *ctx);
 
-#define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */
+/* deprecated */
+#define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx)
 
+/* deprecated */
 int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
-              const EVP_MD *md); /* deprecated */
+              const EVP_MD *md);
 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
                  const EVP_MD *md, ENGINE *impl);
 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
index 8bcfc1ee2048aa5e7f2202d7b8a33c4e823419ae..890956243f6285d2636b0afde96ad0b7d061c901 100644 (file)
@@ -97,14 +97,20 @@ struct rsa_meth_st
        int (*rsa_priv_dec)(int flen,const unsigned char *from,
                            unsigned char *to,
                            RSA *rsa,int padding);
-       int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */
+       /* Can be null */
+       int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx);
+       /* Can be null */
        int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
                          const BIGNUM *m, BN_CTX *ctx,
-                         BN_MONT_CTX *m_ctx); /* Can be null */
-       int (*init)(RSA *rsa);          /* called at new */
-       int (*finish)(RSA *rsa);        /* called at free */
-       int flags;                      /* RSA_METHOD_FLAG_* things */
-       char *app_data;                 /* may be needed! */
+                         BN_MONT_CTX *m_ctx);
+       /* called at new */
+       int (*init)(RSA *rsa);
+       /* called at free */
+       int (*finish)(RSA *rsa);
+       /* RSA_METHOD_FLAG_* things */
+       int flags;
+       /* may be needed! */
+       char *app_data;
 /* New sign and verify functions: some libraries don't allow arbitrary data
  * to be signed/verified: this allows them to be used. Note: for this to work
  * the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used
index ed195ab4028ce61ca3ffdfd22840fb1d86e1f271..6188c5954a9bbe8d1698d781b5a2aead94a1494e 100644 (file)
@@ -66,7 +66,8 @@ static int walk_nodename(di_node_t node, di_node_name_t di_node_name)
 
        /* This is expected to catch all UltraSPARC flavors prior T1 */
        if (!strcmp (name,"SUNW,UltraSPARC") ||
-           !strncmp(name,"SUNW,UltraSPARC-I",17))  /* covers II,III,IV */
+               /* covers II,III,IV */
+           !strncmp(name,"SUNW,UltraSPARC-I",17))
                {
                OPENSSL_sparcv9cap_P |= SPARCV9_PREFER_FPU|SPARCV9_VIS1;
 
index 0d7d3ffe6aa7484a03a2965c99828b97e6b63f7b..52d189ca8b74146ae97687a12c1b5c72a71b020d 100644 (file)
@@ -4,8 +4,8 @@
  *         This file is distributed under the same license as OpenSSL *
  *                                                                    *
  *     Implements generation and parsing of GOST_KEY_TRANSPORT for    *
- *                             GOST R 34.10-94 algorithms                            *
- *                                                                                                                                       *
+ *              GOST R 34.10-94 algorithms                            *
+ *                                                                    *
  *          Requires OpenSSL 0.9.9 for compilation                    *
  **********************************************************************/
 #include <string.h>
index befc70fad88ee4f77a3afe7c42f3d53d4e3b7d09..d4dac55d0eade9896b423f77ece33eb4f5c4a4d5 100644 (file)
 *
 * Copyright@2001 Baltimore Technologies Ltd.
 * All right Reserved.
-*                                                                                                                                                                                              *       
-*              THIS FILE IS PROVIDED BY BALTIMORE TECHNOLOGIES ``AS IS'' AND                                                                                                                                                   *
-*              ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE                                   * 
-*              IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE                              *
-*              ARE DISCLAIMED.  IN NO EVENT SHALL BALTIMORE TECHNOLOGIES BE LIABLE                                             *
-*              FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL                              *
-*              DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS                                 *
-*              OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)                                   *
-*              HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT                              *
-*              LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY                               *
-*              OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF                                  *
-*              SUCH DAMAGE.                                                                                                                                                    *
+*                                                                                      *
+*        THIS FILE IS PROVIDED BY BALTIMORE TECHNOLOGIES ``AS IS'' AND                 *
+*        ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE         *
+*        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE    *
+*        ARE DISCLAIMED.  IN NO EVENT SHALL BALTIMORE TECHNOLOGIES BE LIABLE           *
+*        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL    *
+*        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS       *
+*        OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)         *
+*        HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT    *
+*        LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY     *
+*        OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF        *
+*        SUCH DAMAGE.                                                                  *
 ====================================================================*/
 
 #include <stdio.h>
index 52808b32ca8d198063e67d430e85d55f6246fa66..6d8bc44b66c822d491ba0443bf1d519a034a5fde 100644 (file)
@@ -984,7 +984,8 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
                co = s->s3->client_opaque_prf_input;
                col = s->s3->server_opaque_prf_input_len;
                so = s->s3->server_opaque_prf_input;
-               sol = s->s3->client_opaque_prf_input_len; /* must be same as col (see draft-rescorla-tls-opaque-prf-input-00.txt, section 3.1) */
+               /* must be same as col (see draft-rescorla-tls-opaque-prf-input-00.txt, section 3.1) */
+               sol = s->s3->client_opaque_prf_input_len;
                }
 #endif