indent has problems with comments that are on the right hand side of a line.
authorMatt Caswell <matt@openssl.org>
Wed, 21 Jan 2015 11:09:58 +0000 (11:09 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 22 Jan 2015 09:44:02 +0000 (09:44 +0000)
Sometimes it fails to format them very well, and sometimes it corrupts them!
This commit moves some particularly problematic ones.

Conflicts:
crypto/bn/bn.h
crypto/ec/ec_lcl.h
crypto/rsa/rsa.h
demos/engines/ibmca/hw_ibmca.c
ssl/ssl.h
ssl/ssl3.h

Conflicts:
crypto/ec/ec_lcl.h
ssl/tls1.h

Conflicts:
crypto/ec/ecp_nistp224.c
crypto/evp/evp.h
ssl/d1_both.c
ssl/ssl.h
ssl/ssl_lib.c

Reviewed-by: Tim Hudson <tjh@openssl.org>
34 files changed:
apps/s_client.c
crypto/asn1/a_utctm.c
crypto/bio/bss_file.c
crypto/bio/bss_log.c
crypto/bn/bn.h
crypto/bn/bn_lib.c
crypto/des/read_pwd.c
crypto/dh/dh.h
crypto/ec/ec_lcl.h
crypto/evp/evp.h
crypto/rand/rand_win.c
crypto/rsa/rsa.h
crypto/rsa/rsa_eay.c
crypto/sha/sha.h
crypto/stack/safestack.h
crypto/store/str_mem.c
crypto/whrlpool/wp_block.c
crypto/x509/x509_vfy.h
crypto/x509/x509type.c
demos/easy_tls/easy-tls.c
demos/engines/ibmca/hw_ibmca.c
ms/applink.c
ssl/d1_both.c
ssl/d1_pkt.c
ssl/s23_srvr.c
ssl/s3_both.c
ssl/ssl.h
ssl/ssl3.h
ssl/ssl_lib.c
ssl/ssl_locl.h
ssl/ssl_sess.c
ssl/ssltest.c
ssl/t1_lib.c
ssl/tls1.h

index f3a11c36106ce7698f0c8cb92d811f4406916cd5..f9d389ddc7e1d996088a5e027d11cdaa2efe9bfe 100644 (file)
@@ -1679,7 +1679,9 @@ static void print_stuff(BIO *bio, SSL *s, int full)
                if (peer != NULL)
                        {
                        BIO_printf(bio,"Server certificate\n");
-                       if (!(c_showcerts && got_a_chain)) /* Redundant if we showed the whole chain */
+
+                       /* Redundant if we showed the whole chain */
+                       if (!(c_showcerts && got_a_chain))
                                PEM_write_bio_X509(bio,peer);
                        X509_NAME_oneline(X509_get_subject_name(peer),
                                buf,sizeof buf);
index 12776e304b6f45eb7d990f18c895ff3c1b816c2f..a649427089064f392b73037a75e1ee125ca717bb 100644 (file)
@@ -315,13 +315,16 @@ time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s)
                }
 #undef g2
 
-       return mktime(&tm)-offset*60; /* FIXME: mktime assumes the current timezone
-                                      * instead of UTC, and unless we rewrite OpenSSL
-                                      * in Lisp we cannot locally change the timezone
-                                      * without possibly interfering with other parts
-                                      * of the program. timegm, which uses UTC, is
-                                      * non-standard.
-                                      * Also time_t is inappropriate for general
-                                      * UTC times because it may a 32 bit type. */
+       /*
+        * FIXME: mktime assumes the current timezone
+        * instead of UTC, and unless we rewrite OpenSSL
+        * in Lisp we cannot locally change the timezone
+        * without possibly interfering with other parts
+        * of the program. timegm, which uses UTC, is
+        * non-standard.
+        * Also time_t is inappropriate for general
+        * UTC times because it may a 32 bit type.
+        */
+       return mktime(&tm)-offset*60; 
        }
 #endif
index d84c992f6eb80cd09ac43e24ab46b6fd346fc832..b4b7c21d66558241f66436cbdff7b95020b2d71f 100644 (file)
@@ -153,9 +153,14 @@ BIO *BIO_new_file(const char *filename, const char *mode)
                                        wmode,sizeof(wmode)/sizeof(wmode[0])) &&
                    (file=_wfopen(wfilename,wmode))==NULL &&
                    (errno==ENOENT || errno==EBADF)
-                  )    /* UTF-8 decode succeeded, but no file, filename
-                        * could still have been locale-ized... */
+                  )
+                       {
+                       /*
+                        * UTF-8 decode succeeded, but no file, filename
+                        * could still have been locale-ized...
+                        */
                        file = fopen(filename,mode);
+                       }
                }
        else if (GetLastError()==ERROR_NO_UNICODE_TRANSLATION)
                {
index 2227b2b52d475509af4401d24870884cab5268ac..eb50668642e1e73edbbc3b7e70bd4b2d4f9f896f 100644 (file)
@@ -276,8 +276,11 @@ static void xsyslog(BIO *bp, int priority, const char *string)
        case LOG_DEBUG:
                evtype = EVENTLOG_INFORMATION_TYPE;
                break;
-       default:                /* Should never happen, but set it
-                                  as error anyway. */
+       default:
+               /*
+                * Should never happen, but set it
+                * as error anyway.
+                */
                evtype = EVENTLOG_ERROR_TYPE;
                break;
                }
index be1b4375040fb3767b65e25bee8043cc5812f6a3..daef72bccee44a8c659cca88d434a11afcc21dda 100644 (file)
@@ -275,16 +275,22 @@ extern "C" {
 
 #define BN_FLG_MALLOCED                0x01
 #define BN_FLG_STATIC_DATA     0x02
-#define BN_FLG_CONSTTIME       0x04 /* avoid leaking exponent information through timing,
-                                      * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime,
-                                      * BN_div() will call BN_div_no_branch,
-                                      * BN_mod_inverse() will call BN_mod_inverse_no_branch.
-                                      */
 
-#ifndef OPENSSL_NO_DEPRECATED
-#define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME /* deprecated name for the flag */
-                                      /* avoid leaking exponent information through timings
-                                      * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */
+/*
+ * avoid leaking exponent information through timing,
+ * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime,
+ * BN_div() will call BN_div_no_branch,
+ * BN_mod_inverse() will call BN_mod_inverse_no_branch.
+ */
+#define BN_FLG_CONSTTIME       0x04 
+
+#ifdef OPENSSL_NO_DEPRECATED
+/* deprecated name for the flag */
+#define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME 
+/*
+ * avoid leaking exponent information through timings
+ * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime)
+ */
 #endif
 
 #ifndef OPENSSL_NO_DEPRECATED
index 78a599fcf775fd13455ca87106ee37ddb8f6d087..6b7f57d8e595c9372d96c6bf9110a526b58aeeda 100644 (file)
@@ -374,9 +374,12 @@ static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
                case 3: A[2]=B[2];
                case 2: A[1]=B[1];
                case 1: A[0]=B[0];
-               case 0: /* workaround for ultrix cc: without 'case 0', the optimizer does
-                        * the switch table by doing a=top&3; a--; goto jump_table[a];
-                        * which fails for top== 0 */
+               case 0:
+                       /*
+                        * workaround for ultrix cc: without 'case 0', the optimizer does
+                        * the switch table by doing a=top&3; a--; goto jump_table[a];
+                        * which fails for top== 0
+                        */
                        ;
                        }
                }
index ce5fa00a37a42fdf8d38bb6e36e2cb720744e5df..5c82e2fdc1dac8a611ef783cdb6120728000920c 100644 (file)
@@ -75,7 +75,8 @@
 #endif
 #endif
 
-/* #define SIGACTION */ /* Define this if you have sigaction() */
+/* Define this if you have sigaction() */
+/* #define SIGACTION */
 
 #ifdef WIN16TTY
 #undef OPENSSL_SYS_WIN16
index 0f2cd131245ed09f73130764559fcc19bb28080c..8f37c9ef5705d92970b6dbefefd9cc31cb03789b 100644 (file)
 #endif
 
 #define DH_FLAG_CACHE_MONT_P     0x01
-#define DH_FLAG_NO_EXP_CONSTTIME 0x02 /* new with 0.9.7h; the built-in DH
-                                       * implementation now uses constant time
-                                       * modular exponentiation for secret exponents
-                                       * by default. This flag causes the
-                                       * faster variable sliding window method to
-                                       * be used for all exponents.
-                                       */
+
+/*
+ * new with 0.9.7h; the built-in DH
+ * implementation now uses constant time
+ * modular exponentiation for secret exponents
+ * by default. This flag causes the
+ * faster variable sliding window method to
+ * be used for all exponents.
+ */
+#define DH_FLAG_NO_EXP_CONSTTIME 0x02
 
 #ifdef  __cplusplus
 extern "C" {
index e6f5ffa45ac2d1981dfc744d4cc463553232aef6..54cd1b3301e3416f57cf569cb066d69f0d9e2bc5 100644 (file)
@@ -200,37 +200,44 @@ struct ec_group_st {
        /* The following members are handled by the method functions,
         * even if they appear generic */
        
-       BIGNUM field; /* Field specification.
-                      * For curves over GF(p), this is the modulus;
-                      * for curves over GF(2^m), this is the 
-                      * irreducible polynomial defining the field.
-                      */
-
-       int poly[6]; /* Field specification for curves over GF(2^m).
-                     * The irreducible f(t) is then of the form:
-                     *     t^poly[0] + t^poly[1] + ... + t^poly[k]
-                     * where m = poly[0] > poly[1] > ... > poly[k] = 0.
-                     * The array is terminated with poly[k+1]=-1.
-                     * All elliptic curve irreducibles have at most 5
-                     * non-zero terms.
-                     */
-
-       BIGNUM a, b; /* Curve coefficients.
-                     * (Here the assumption is that BIGNUMs can be used
-                     * or abused for all kinds of fields, not just GF(p).)
-                     * For characteristic  > 3,  the curve is defined
-                     * by a Weierstrass equation of the form
-                     *     y^2 = x^3 + a*x + b.
-                     * For characteristic  2,  the curve is defined by
-                     * an equation of the form
-                     *     y^2 + x*y = x^3 + a*x^2 + b.
-                     */
-
-       int a_is_minus3; /* enable optimized point arithmetics for special case */
-
-       void *field_data1; /* method-specific (e.g., Montgomery structure) */
-       void *field_data2; /* method-specific */
-       int (*field_mod_func)(BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); /* method-specific */
+       /* Field specification.
+        * For curves over GF(p), this is the modulus;
+        * for curves over GF(2^m), this is the 
+        * irreducible polynomial defining the field.
+        */
+       BIGNUM field;
+
+       /* Field specification for curves over GF(2^m).
+        * The irreducible f(t) is then of the form:
+        *     t^poly[0] + t^poly[1] + ... + t^poly[k]
+        * where m = poly[0] > poly[1] > ... > poly[k] = 0.
+        * The array is terminated with poly[k+1]=-1.
+        * All elliptic curve irreducibles have at most 5
+        * non-zero terms.
+        */
+       int poly[6];
+
+       /* Curve coefficients.
+        * (Here the assumption is that BIGNUMs can be used
+        * or abused for all kinds of fields, not just GF(p).)
+        * For characteristic  > 3,  the curve is defined
+        * by a Weierstrass equation of the form
+        *     y^2 = x^3 + a*x + b.
+        * For characteristic  2,  the curve is defined by
+        * an equation of the form
+        *     y^2 + x*y = x^3 + a*x^2 + b.
+        */
+       BIGNUM a, b; 
+
+       /* enable optimized point arithmetics for special case */
+       int a_is_minus3;
+
+       /* method-specific (e.g., Montgomery structure) */
+       void *field_data1;
+       /* method-specific */
+       void *field_data2;
+       /* method-specific */
+       int (*field_mod_func)(BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *);
 } /* EC_GROUP */;
 
 struct ec_key_st {
index 1858d5a68be43cc844570dd4596b85088032bb7b..2534456eb6cfbcd6d9915a51df7b3c96f9489c55 100644 (file)
@@ -188,13 +188,16 @@ typedef int evp_verify_method(int type,const unsigned char *m,
                            unsigned int m_length,const unsigned char *sigbuf,
                            unsigned int siglen, void *key);
 
-#define EVP_MD_FLAG_ONESHOT    0x0001 /* digest can only handle a single
-                                       * block */
-
-#define EVP_MD_FLAG_PKEY_DIGEST        0x0002 /* digest is a "clone" digest used
-                                       * which is a copy of an existing
-                                       * one for a specific public key type.
-                                       * EVP_dss1() etc */
+/* digest can only handle a single block */
+#define EVP_MD_FLAG_ONESHOT    0x0001
+
+/*
+ * digest is a "clone" digest used
+ * which is a copy of an existing
+ * one for a specific public key type.
+ * EVP_dss1() etc
+ */
+#define EVP_MD_FLAG_PKEY_DIGEST        0x0002
 
 /* Digest uses EVP_PKEY_METHOD for signing instead of MD specific signing */
 
@@ -301,19 +304,39 @@ struct evp_cipher_st
        {
        int nid;
        int block_size;
-       int key_len;            /* Default value for variable length ciphers */
+
+       /* Default value for variable length ciphers */
+       int key_len;
        int iv_len;
-       unsigned long flags;    /* Various flags */
+
+       /* Various flags */
+       unsigned long flags;
+       
+       /* init key */
        int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-                   const unsigned char *iv, int enc);  /* init key */
+                   const unsigned char *iv, int enc);
+                   
+       /* encrypt/decrypt data */
        int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out,
-                        const unsigned char *in, size_t inl);/* encrypt/decrypt data */
-       int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */
-       int ctx_size;           /* how big ctx->cipher_data needs to be */
-       int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */
-       int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */
-       int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */
-       void *app_data;         /* Application data */
+                        const unsigned char *in, size_t inl);
+
+       /* cleanup ctx */
+       int (*cleanup)(EVP_CIPHER_CTX *);
+
+       /* how big ctx->cipher_data needs to be */
+       int ctx_size;
+
+       /* Populate a ASN1_TYPE with parameters */
+       int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *);
+
+       /* Get parameters from a ASN1_TYPE */
+       int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *);
+
+       /* Miscellaneous operations */
+       int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr);
+
+       /* Application data */
+       void *app_data;
        } /* EVP_CIPHER */;
 
 /* Values for cipher flags */
@@ -388,14 +411,22 @@ struct evp_cipher_ctx_st
 
 typedef struct evp_Encode_Ctx_st
        {
-       int num;        /* number saved in a partial encode/decode */
-       int length;     /* The length is either the output line length
-                        * (in input bytes) or the shortest input line
-                        * length that is ok.  Once decoding begins,
-                        * the length is adjusted up each time a longer
-                        * line is decoded */
-       unsigned char enc_data[80];     /* data to encode */
-       int line_num;   /* number read on current line */
+       /* number saved in a partial encode/decode */
+       int num;
+
+       /* The length is either the output line length
+        * (in input bytes) or the shortest input line
+        * length that is ok.  Once decoding begins,
+        * the length is adjusted up each time a longer
+        * line is decoded
+        */
+       int length;
+
+       /* data to encode */
+       unsigned char enc_data[80];
+
+       /* number read on current line */
+       int line_num;
        int expect_nl;
        } EVP_ENCODE_CTX;
 
index 30778d183c83f77b05c4e8dd1c0a373986137c9b..6ec7097885649f294e7ec39c17793d38d402b81b 100644 (file)
@@ -177,12 +177,13 @@ typedef BOOL (WINAPI *MODULE32)(HANDLE, LPMODULEENTRY32);
 
 #include <lmcons.h>
 #include <lmstats.h>
-#if 1 /* The NET API is Unicode only.  It requires the use of the UNICODE
-       * macro.  When UNICODE is defined LPTSTR becomes LPWSTR.  LMSTR was
-       * was added to the Platform SDK to allow the NET API to be used in
-       * non-Unicode applications provided that Unicode strings were still
-       * used for input.  LMSTR is defined as LPWSTR.
-       */
+#if 1
+/* The NET API is Unicode only.  It requires the use of the UNICODE
+ * macro.  When UNICODE is defined LPTSTR becomes LPWSTR.  LMSTR was
+ * was added to the Platform SDK to allow the NET API to be used in
+ * non-Unicode applications provided that Unicode strings were still
+ * used for input.  LMSTR is defined as LPWSTR.
+ */
 typedef NET_API_STATUS (NET_API_FUNCTION * NETSTATGET)
         (LPWSTR, LPWSTR, DWORD, DWORD, LPBYTE*);
 typedef NET_API_STATUS (NET_API_FUNCTION * NETFREE)(LPBYTE);
index 66f46263e3f03e7af41eecf6d642647421020159..8bcfc1ee2048aa5e7f2202d7b8a33c4e823419ae 100644 (file)
@@ -168,7 +168,9 @@ struct rsa_st
 # define OPENSSL_RSA_SMALL_MODULUS_BITS        3072
 #endif
 #ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
-# define OPENSSL_RSA_MAX_PUBEXP_BITS   64 /* exponent limit enforced for "large" modulus only */
+
+/* exponent limit enforced for "large" modulus only */
+# define OPENSSL_RSA_MAX_PUBEXP_BITS   64
 #endif
 
 #define RSA_3  0x3L
@@ -191,30 +193,36 @@ struct rsa_st
  */
 #define RSA_FLAG_SIGN_VER              0x0040
 
-#define RSA_FLAG_NO_BLINDING           0x0080 /* new with 0.9.6j and 0.9.7b; the built-in
-                                                * RSA implementation now uses blinding by
-                                                * default (ignoring RSA_FLAG_BLINDING),
-                                                * but other engines might not need it
-                                                */
-#define RSA_FLAG_NO_CONSTTIME          0x0100 /* new with 0.9.8f; the built-in RSA
-                                               * implementation now uses constant time
-                                               * operations by default in private key operations,
-                                               * e.g., constant time modular exponentiation, 
-                                                * modular inverse without leaking branches, 
-                                                * division without leaking branches. This 
-                                                * flag disables these constant time 
-                                                * operations and results in faster RSA 
-                                                * private key operations.
-                                                */ 
-#ifndef OPENSSL_NO_DEPRECATED
-#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME /* deprecated name for the flag*/
-                                                /* new with 0.9.7h; the built-in RSA
-                                                * implementation now uses constant time
-                                                * modular exponentiation for secret exponents
-                                                * by default. This flag causes the
-                                                * faster variable sliding window method to
-                                                * be used for all exponents.
-                                                */
+/*
+ * new with 0.9.6j and 0.9.7b; the built-in
+ * RSA implementation now uses blinding by
+ * default (ignoring RSA_FLAG_BLINDING),
+ * but other engines might not need it
+ */
+#define RSA_FLAG_NO_BLINDING           0x0080
+/*
+ * new with 0.9.8f; the built-in RSA
+ * implementation now uses constant time
+ * operations by default in private key operations,
+ * e.g., constant time modular exponentiation, 
+ * modular inverse without leaking branches, 
+ * division without leaking branches. This 
+ * flag disables these constant time 
+ * operations and results in faster RSA 
+ * private key operations.
+ */ 
+#define RSA_FLAG_NO_CONSTTIME          0x0100
+#ifdef OPENSSL_USE_DEPRECATED
+/* deprecated name for the flag*/
+/*
+ * new with 0.9.7h; the built-in RSA
+ * implementation now uses constant time
+ * modular exponentiation for secret exponents
+ * by default. This flag causes the
+ * faster variable sliding window method to
+ * be used for all exponents.
+ */
+#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME 
 #endif
 
 
index 56880dc13827257984b5a5dc73ce097506b8842d..aeab6cfcc3ea1b071096c55e18cbbe5c6dcab1a7 100644 (file)
@@ -285,11 +285,12 @@ static BN_BLINDING *rsa_get_blinding(RSA *rsa, int *local, BN_CTX *ctx)
                {
                /* resort to rsa->mt_blinding instead */
 
-               *local = 0; /* instructs rsa_blinding_convert(), rsa_blinding_invert()
-                            * that the BN_BLINDING is shared, meaning that accesses
-                            * require locks, and that the blinding factor must be
-                            * stored outside the BN_BLINDING
-                            */
+               /* instructs rsa_blinding_convert(), rsa_blinding_invert()
+                * that the BN_BLINDING is shared, meaning that accesses
+                * require locks, and that the blinding factor must be
+                * stored outside the BN_BLINDING
+                */
+               *local = 0;
 
                if (rsa->mt_blinding == NULL)
                        {
index d78999b013f3dfb9f6d4c7a11a6ed66ed7897098..50978f49cf1471d3f44c25d8fa91bdc6dfb70673 100644 (file)
@@ -155,9 +155,12 @@ void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
  * being exactly 64-bit wide. See Implementation Notes in sha512.c
  * for further details.
  */
-#define SHA512_CBLOCK  (SHA_LBLOCK*8)  /* SHA-512 treats input data as a
-                                        * contiguous array of 64 bit
-                                        * wide big-endian values. */
+/*
+ * SHA-512 treats input data as a
+ * contiguous array of 64 bit
+ * wide big-endian values.
+ */
+#define SHA512_CBLOCK  (SHA_LBLOCK*8)
 #if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
 #define SHA_LONG64 unsigned __int64
 #define U64(C)     C##UI64
index 1ddc79f7ea1304183b59a4aafe0ef1de4e97c388..f062b1e240d7dc4695855a71d3065bc643a100d6 100644 (file)
@@ -94,7 +94,8 @@ STACK_OF(type) \
     _STACK stack; \
     };
 
-#define IMPLEMENT_STACK_OF(type) /* nada (obsolete in new safestack approach)*/
+/* nada (obsolete in new safestack approach)*/
+#define IMPLEMENT_STACK_OF(type)
 
 
 /*-
index 8ac4f7e55c70b8440223a3b064b42dd2981d2df4..021d828325664e0ba9df736f63adf8de2649c99a 100644 (file)
@@ -86,25 +86,38 @@ typedef struct mem_object_data_st
 DECLARE_STACK_OF(MEM_OBJECT_DATA)
 struct mem_data_st
        {
-       STACK_OF(MEM_OBJECT_DATA) *data; /* sorted with
-                                         * STORE_ATTR_INFO_compare(). */
-       unsigned int compute_components : 1; /* Currently unused, but can
-                                               be used to add attributes
-                                               from parts of the data. */
+       /*
+        * sorted with
+        * STORE_ATTR_INFO_compare().
+        */
+       STACK_OF(MEM_OBJECT_DATA) *data; 
+       /*
+        * Currently unused, but can
+        * be used to add attributes
+        * from parts of the data.
+        */
+       unsigned int compute_components : 1;
        };
 
 DECLARE_STACK_OF(STORE_ATTR_INFO)
 struct mem_ctx_st
        {
-       int type;               /* The type we're searching for */
-       STACK_OF(STORE_ATTR_INFO) *search_attributes; /* Sets of
-                                    attributes to search for.  Each
-                                    element is a STORE_ATTR_INFO. */
-       int search_index;       /* which of the search attributes we
-                                  found a match for, -1 when we still
-                                  haven't found any */
-       int index;              /* -1 as long as we're searching for
-                                    the first */
+       /* The type we're searching for */
+       int type;
+       /*
+        * Sets of
+        * attributes to search for.  Each
+        * element is a STORE_ATTR_INFO.
+        */
+       STACK_OF(STORE_ATTR_INFO) *search_attributes;
+       /*
+        * which of the search attributes we
+        * found a match for, -1 when we still
+        * haven't found any
+        */ 
+       int search_index;
+       /* -1 as long as we're searching for the first */
+       int index;
        };
 
 static int mem_init(STORE *s);
index 221f6cc59f26b8be5abd3fbf485704d9535176bf..0a401ee6481022b1f5f713d86dded46522cd0879 100644 (file)
@@ -64,8 +64,11 @@ typedef unsigned long long   u64;
 #  define SMALL_REGISTER_BANK
 #  if defined(WHIRLPOOL_ASM)
 #    ifndef OPENSSL_SMALL_FOOTPRINT
-#      define OPENSSL_SMALL_FOOTPRINT  /* it appears that for elder non-MMX
-                                          CPUs this is actually faster! */
+/*
+ * it appears that for elder non-MMX
+ * CPUs this is actually faster!
+ */
+#      define OPENSSL_SMALL_FOOTPRINT
 #    endif
 #    define GO_FOR_MMX(ctx,inp,num)    do {                    \
        extern unsigned long OPENSSL_ia32cap_P;                 \
index 026e174e1abf575bd3a4d41a1274173c3e7ec939..d6eb3f3b3c5d852adacc374a6b2e9a306229aff9 100644 (file)
@@ -192,14 +192,22 @@ struct x509_store_st
        X509_VERIFY_PARAM *param;
 
        /* Callbacks for various operations */
-       int (*verify)(X509_STORE_CTX *ctx);     /* called to verify a certificate */
-       int (*verify_cb)(int ok,X509_STORE_CTX *ctx);   /* error callback */
-       int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */
-       int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */
-       int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */
-       int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */
-       int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */
-       int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */
+       /* called to verify a certificate */
+       int (*verify)(X509_STORE_CTX *ctx);
+       /* error callback */
+       int (*verify_cb)(int ok,X509_STORE_CTX *ctx);
+       /* get issuers cert from ctx */
+       int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+       /* check issued */
+       int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+       /* Check revocation status of chain */
+       int (*check_revocation)(X509_STORE_CTX *ctx);
+       /* retrieve CRL */
+       int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x);
+       /* Check CRL validity */
+       int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl);
+       /* Check certificate against CRL */
+       int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);
        STACK_OF(X509) * (*lookup_certs)(X509_STORE_CTX *ctx, X509_NAME *nm);
        STACK_OF(X509_CRL) * (*lookup_crls)(X509_STORE_CTX *ctx, X509_NAME *nm);
        int (*cleanup)(X509_STORE_CTX *ctx);
@@ -230,49 +238,72 @@ struct x509_lookup_st
 struct x509_store_ctx_st      /* X509_STORE_CTX */
        {
        X509_STORE *ctx;
-       int current_method;     /* used when looking up certs */
+       /* used when looking up certs */
+       int current_method;
 
        /* The following are set by the caller */
-       X509 *cert;             /* The cert to check */
-       STACK_OF(X509) *untrusted;      /* chain of X509s - untrusted - passed in */
-       STACK_OF(X509_CRL) *crls;       /* set of CRLs passed in */
+       /* The cert to check */
+       X509 *cert;
+       /* chain of X509s - untrusted - passed in */
+       STACK_OF(X509) *untrusted;
+       /* set of CRLs passed in */
+       STACK_OF(X509_CRL) *crls;
 
        X509_VERIFY_PARAM *param;
-       void *other_ctx;        /* Other info for use with get_issuer() */
+       /* Other info for use with get_issuer() */
+       void *other_ctx;
 
        /* Callbacks for various operations */
-       int (*verify)(X509_STORE_CTX *ctx);     /* called to verify a certificate */
-       int (*verify_cb)(int ok,X509_STORE_CTX *ctx);           /* error callback */
-       int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */
-       int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */
-       int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */
-       int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */
-       int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */
-       int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */
+       /* called to verify a certificate */
+       int (*verify)(X509_STORE_CTX *ctx);
+       /* error callback */
+       int (*verify_cb)(int ok,X509_STORE_CTX *ctx);
+       /* get issuers cert from ctx */
+       int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+       /* check issued */
+       int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+       /* Check revocation status of chain */
+       int (*check_revocation)(X509_STORE_CTX *ctx);
+       /* retrieve CRL */
+       int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x);
+       /* Check CRL validity */
+       int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl);
+       /* Check certificate against CRL */
+       int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);
        int (*check_policy)(X509_STORE_CTX *ctx);
        STACK_OF(X509) * (*lookup_certs)(X509_STORE_CTX *ctx, X509_NAME *nm);
        STACK_OF(X509_CRL) * (*lookup_crls)(X509_STORE_CTX *ctx, X509_NAME *nm);
        int (*cleanup)(X509_STORE_CTX *ctx);
 
        /* The following is built up */
-       int valid;              /* if 0, rebuild chain */
-       int last_untrusted;     /* index of last untrusted cert */
-       STACK_OF(X509) *chain;          /* chain of X509s - built up and trusted */
-       X509_POLICY_TREE *tree; /* Valid policy tree */
-
-       int explicit_policy;    /* Require explicit policy value */
+       /* if 0, rebuild chain */
+       int valid;
+       /* index of last untrusted cert */
+       int last_untrusted;
+       /* chain of X509s - built up and trusted */
+       STACK_OF(X509) *chain;
+       /* Valid policy tree */
+       X509_POLICY_TREE *tree;
+
+       /* Require explicit policy value */
+       int explicit_policy;
 
        /* When something goes wrong, this is why */
        int error_depth;
        int error;
        X509 *current_cert;
-       X509 *current_issuer;   /* cert currently being tested as valid issuer */
-       X509_CRL *current_crl;  /* current CRL */
-
-       int current_crl_score;  /* score of current CRL */
-       unsigned int current_reasons;  /* Reason mask */
-
-       X509_STORE_CTX *parent; /* For CRL path validation: parent context */
+       /* cert currently being tested as valid issuer */
+       X509 *current_issuer;
+       /* current CRL */
+       X509_CRL *current_crl;
+
+       /* score of current CRL */
+       int current_crl_score;
+       /* Reason mask */
+       unsigned int current_reasons;
+
+       /* For CRL path validation: parent context */
+       X509_STORE_CTX *parent;
 
        CRYPTO_EX_DATA ex_data;
        } /* X509_STORE_CTX */;
index 3385ad3f67cbe405f18692235b1bb086d63a4633..42366fcbed3644a926e7ff7faa114ca47eee3d81 100644 (file)
@@ -116,8 +116,8 @@ int X509_certificate_type(X509 *x, EVP_PKEY *pkey)
                break;
                }
 
-       if (EVP_PKEY_size(pk) <= 1024/8)/* /8 because it's 1024 bits we look
-                                          for, not bytes */
+       /* /8 because it's 1024 bits we look for, not bytes */
+       if (EVP_PKEY_size(pk) <= 1024/8)
                ret|=EVP_PKT_EXP;
        if(pkey==NULL) EVP_PKEY_free(pk);
        return(ret);
index b433036715456b36de14e14edd630272eafeb554..e6b9b865c8986cd5103edc6c9fc5f368f8bd07ec 100644 (file)
@@ -708,7 +708,9 @@ tls_create_ctx(struct tls_create_ctx_args a, void *apparg)
            SSL_CTX_set_verify_depth(ret, a.verify_depth);
        
        if (a.ca_file != NULL) {
-           r = SSL_CTX_load_verify_locations(ret, a.ca_file, NULL /* no CA-directory */); /* does not report failure if file does not exist ... */
+           /* does not report failure if file does not exist ... */
+           /* NULL argument means no CA-directory */
+           r = SSL_CTX_load_verify_locations(ret, a.ca_file, NULL); 
            if (!r) {
                err_pref_1 = " while processing certificate file ";
                err_pref_2 = a.ca_file;
index 0c2c39b8a7997e1f07bce9859886dc9d03d65044..fa690a2286942251d3480eb7f3a678f4daa919cf 100644 (file)
@@ -917,4 +917,4 @@ IMPLEMENT_DYNAMIC_BIND_FN(bind_fn)
 \r
 \r
 #endif /* !OPENSSL_NO_HW_IBMCA */\r
-#endif /* !OPENSSL_NO_HW */\r
+#endif /* !OPENSSL_NO_HW */
index 54a0a642628a25c6a5a0909c2b50174c22f5052d..76f1c40d0ab42f872283aa38e11c0ce208813a91 100644 (file)
@@ -46,9 +46,12 @@ extern "C" {
 __declspec(dllexport)
 void **
 #if defined(__BORLANDC__)
-__stdcall      /* __stdcall appears to be the only way to get the name
-                * decoration right with Borland C. Otherwise it works
-                * purely incidentally, as we pass no parameters. */
+/*
+ * __stdcall appears to be the only way to get the name
+ * decoration right with Borland C. Otherwise it works
+ * purely incidentally, as we pass no parameters.
+ */
+__stdcall
 #else
 __cdecl
 #endif
index 2f5b63d61df43adec82c2c9086ad55fb4b36c52f..18d47e78398cae3a222583f7b859edadbafd70b9 100644 (file)
@@ -476,10 +476,15 @@ long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
 again:
        i = dtls1_get_message_fragment(s, st1, stn, max, ok);
        if ( i == DTLS1_HM_BAD_FRAGMENT ||
-               i == DTLS1_HM_FRAGMENT_RETRY)  /* bad fragment received */
+               i == DTLS1_HM_FRAGMENT_RETRY)
+               {
+               /* bad fragment received */
                goto again;
+               }
        else if ( i <= 0 && !*ok)
+               {
                return i;
+               }
 
        p = (unsigned char *)s->init_buf->data;
        msg_len = msg_hdr->msg_len;
@@ -1150,7 +1155,8 @@ int dtls1_read_failed(SSL *s, int code)
                return code;
                }
 
-       if ( ! SSL_in_init(s))  /* done, no need to send a retransmit */
+       /* done, no need to send a retransmit */
+       if ( ! SSL_in_init(s))
                {
                BIO_set_flags(SSL_get_rbio(s), BIO_FLAGS_READ);
                return code;
index bf4e44704fe079494fd8df839e07675083e8eaca..96a3419355f85b48ffecd9ab07030f591f57eb02 100644 (file)
@@ -335,8 +335,8 @@ dtls1_get_buffered_record(SSL *s)
                (((PQ_64BIT)s->d1->handshake_read_seq) << 32) | 
                ((PQ_64BIT)s->d1->r_msg_hdr.frag_off);
        
-       if ( ! SSL_in_init(s))  /* if we're not (re)negotiating, 
-                                                          nothing buffered */
+    /* if we're not (re)negotiating, nothing buffered */
+       if ( ! SSL_in_init(s))
                return 0;
 
 
index c040c6f82f43fbae72d6266a809a77a577a27283..7637150bc01622d1f477da955ad57c5632f77739 100644 (file)
@@ -233,19 +233,21 @@ end:
 
 int ssl23_get_client_hello(SSL *s)
        {
-       char buf_space[11]; /* Request this many bytes in initial read.
-                            * We can detect SSL 3.0/TLS 1.0 Client Hellos
-                            * ('type == 3') correctly only when the following
-                            * is in a single record, which is not guaranteed by
-                            * the protocol specification:
-                            * Byte  Content
-                            *  0     type            \
-                            *  1/2   version          > record header
-                            *  3/4   length          /
-                            *  5     msg_type        \
-                            *  6-8   length           > Client Hello message
-                            *  9/10  client_version  /
-                            */
+    /*-
+     * Request this many bytes in initial read.
+     * We can detect SSL 3.0/TLS 1.0 Client Hellos
+     * ('type == 3') correctly only when the following
+     * is in a single record, which is not guaranteed by
+     * the protocol specification:
+     * Byte  Content
+     *  0     type            \
+     *  1/2   version          > record header
+     *  3/4   length          /
+     *  5     msg_type        \
+     *  6-8   length           > Client Hello message
+     *  9/10  client_version  /
+     */
+       char buf_space[11]; 
        char *buf= &(buf_space[0]);
        unsigned char *p,*d,*d_len,*dd;
        unsigned int i;
index 412d095d604b0f53a04ba647e20279823f07fff3..26a4e810f00a3efc095dc2b71a540e714937cd2a 100644 (file)
@@ -212,11 +212,12 @@ int ssl3_get_finished(SSL *s, int a, int b)
         * change cipher spec message and is in s->s3->tmp.peer_finish_md
         */ 
 
+       /* 64 argument should actually be 36+4 :-) */
        n=s->method->ssl_get_message(s,
                a,
                b,
                SSL3_MT_FINISHED,
-               64, /* should actually be 36+4 :-) */
+               64,
                &ok);
 
        if (!ok) return((int)n);
index bba674b130f31e2746aa3105c5364f4ac081fdea..74cd85c3a917a6bfcf9c36778612285160a51a65 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -819,7 +819,8 @@ struct ssl_ctx_st
        int verify_mode;
        unsigned int sid_ctx_length;
        unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
-       int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx); /* called 'verify_callback' in the SSL */
+       /* called 'verify_callback' in the SSL */
+       int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx);
 
        /* Default generate session ID callback. */
        GEN_SESSION_CB generate_session_id;
@@ -984,22 +985,28 @@ struct ssl_st
         * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION)
         */
        int version;
-       int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
+       /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
+       int type;
 
-       const SSL_METHOD *method; /* SSLv3 */
+       /* SSLv3 */
+       const SSL_METHOD *method;
 
        /* There are 2 BIO's even though they are normally both the
         * same.  This is so data can be read and written to different
         * handlers */
 
 #ifndef OPENSSL_NO_BIO
-       BIO *rbio; /* used by SSL_read */
-       BIO *wbio; /* used by SSL_write */
-       BIO *bbio; /* used during session-id reuse to concatenate
-                   * messages */
+       /* used by SSL_read */
+       BIO *rbio;
+       /* used by SSL_write */
+       BIO *wbio;
+       /* used during session-id reuse to concatenate messages */
+       BIO *bbio;
 #else
-       char *rbio; /* used by SSL_read */
-       char *wbio; /* used by SSL_write */
+       /* used by SSL_read */
+       char *rbio;
+       /* used by SSL_write */
+       char *wbio;
        char *bbio;
 #endif
        /* This holds a variable that indicates what we were doing
@@ -1020,19 +1027,26 @@ struct ssl_st
         * test instead of an "init" member.
         */
 
-       int server;     /* are we the server side? - mostly used by SSL_clear*/
+       /* are we the server side? - mostly used by SSL_clear*/
+       int server;
 
-       int new_session;/* 1 if we are to use a new session.
-                        * 2 if we are a server and are inside a handshake
-                        *   (i.e. not just sending a HelloRequest)
-                        * NB: For servers, the 'new' session may actually be a previously
-                        * cached session or even the previous session unless
-                        * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */
-       int quiet_shutdown;/* don't send shutdown packets */
-       int shutdown;   /* we have shut things down, 0x01 sent, 0x02
-                        * for received */
-       int state;      /* where we are */
-       int rstate;     /* where we are when reading */
+       /*
+        * 1 if we are to use a new session.
+        * 2 if we are a server and are inside a handshake
+        *   (i.e. not just sending a HelloRequest)
+        * NB: For servers, the 'new' session may actually be a previously
+        * cached session or even the previous session unless
+        * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set
+        */
+       int new_session;
+       /* don't send shutdown packets */
+       int quiet_shutdown;
+       /* we have shut things down, 0x01 sent, 0x02 for received */
+       int shutdown;
+       /* where we are */
+       int state;
+       /* where we are when reading */
+       int rstate;
 
        BUF_MEM *init_buf;      /* buffer used during init */
        void *init_msg;         /* pointer to handshake message body, set by ssl3_get_message() */
@@ -1104,17 +1118,25 @@ struct ssl_st
        GEN_SESSION_CB generate_session_id;
 
        /* Used in SSL2 and SSL3 */
-       int verify_mode;        /* 0 don't care about verify failure.
-                                * 1 fail if verify fails */
-       int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */
+       /*
+        * 0 don't care about verify failure.
+        * 1 fail if verify fails
+        */
+       int verify_mode;
+       /* fail if callback returns 0 */
+       int (*verify_callback)(int ok,X509_STORE_CTX *ctx);
 
-       void (*info_callback)(const SSL *ssl,int type,int val); /* optional informational callback */
+       /* optional informational callback */
+       void (*info_callback)(const SSL *ssl,int type,int val);
 
-       int error;              /* error bytes to be written */
-       int error_code;         /* actual code */
+       /* error bytes to be written */
+       int error;
+       /* actual code */
+       int error_code;
 
 #ifndef OPENSSL_NO_KRB5
-       KSSL_CTX *kssl_ctx;     /* Kerberos 5 context */
+       /* Kerberos 5 context */
+       KSSL_CTX *kssl_ctx;
 #endif /* OPENSSL_NO_KRB5 */
 
 #ifndef OPENSSL_NO_PSK
@@ -1138,12 +1160,14 @@ struct ssl_st
        STACK_OF(X509_NAME) *client_CA;
 
        int references;
-       unsigned long options; /* protocol behaviour */
-       unsigned long mode; /* API behaviour */
+       /* protocol behaviour */
+       unsigned long options;
+       /* API behaviour */
+       unsigned long mode;
        long max_cert_list;
        int first_packet;
-       int client_version;     /* what was passed, used for
-                                * SSLv3/TLS rollback check */
+       /* what was passed, used for SSLv3/TLS rollback check */
+       int client_version;
        unsigned int max_send_fragment;
 #ifndef OPENSSL_NO_TLSEXT
        /* TLS extension debug callback */
@@ -1152,11 +1176,13 @@ struct ssl_st
                                        void *arg);
        void *tlsext_debug_arg;
        char *tlsext_hostname;
-       int servername_done;   /* no further mod of servername 
-                                 0 : call the servername extension callback.
-                                 1 : prepare 2, allow last ack just after in server callback.
-                                 2 : don't call servername callback, no ack in server hello
-                              */
+    /*-
+     * no further mod of servername 
+     * 0 : call the servername extension callback.
+     * 1 : prepare 2, allow last ack just after in server callback.
+     * 2 : don't call servername callback, no ack in server hello
+     */
+       int servername_done;
        /* certificate status request info */
        /* Status type or -1 if no status type */
        int tlsext_status_type;
@@ -1173,9 +1199,11 @@ struct ssl_st
        int tlsext_ticket_expected;
 #ifndef OPENSSL_NO_EC
        size_t tlsext_ecpointformatlist_length;
-       unsigned char *tlsext_ecpointformatlist; /* our list */
+       /* our list */
+       unsigned char *tlsext_ecpointformatlist;
        size_t tlsext_ellipticcurvelist_length;
-       unsigned char *tlsext_ellipticcurvelist; /* our list */
+       /* our list */
+       unsigned char *tlsext_ellipticcurvelist;
 #endif /* OPENSSL_NO_EC */
 
        /* draft-rescorla-tls-opaque-prf-input-00.txt information to be used for handshakes */
index 263d16dcbdaf95923ade3669a74dcd19ab69b6be..392c0452ea01ffe27432df1829f6208844e51734 100644 (file)
@@ -346,23 +346,34 @@ extern "C" {
 
 typedef struct ssl3_record_st
        {
-/*r */ int type;               /* type of record */
-/*rw*/ unsigned int length;    /* How many bytes available */
-/*r */ unsigned int off;       /* read/write offset into 'buf' */
-/*rw*/ unsigned char *data;    /* pointer to the record data */
-/*rw*/ unsigned char *input;   /* where the decode bytes are */
-/*r */ unsigned char *comp;    /* only used with decompression - malloc()ed */
-/*r */  unsigned long epoch;    /* epoch number, needed by DTLS1 */
-/*r */  unsigned char seq_num[8]; /* sequence number, needed by DTLS1 */
+               /* type of record */
+/*r */ int type;
+               /* How many bytes available */
+/*rw*/ unsigned int length;
+               /* read/write offset into 'buf' */
+/*r */ unsigned int off;
+               /* pointer to the record data */
+/*rw*/ unsigned char *data;
+               /* where the decode bytes are */
+/*rw*/ unsigned char *input;
+               /* only used with decompression - malloc()ed */
+/*r */ unsigned char *comp;
+               /* epoch number, needed by DTLS1 */
+/*r */  unsigned long epoch;
+               /* sequence number, needed by DTLS1 */
+/*r */  unsigned char seq_num[8]; 
        } SSL3_RECORD;
 
 typedef struct ssl3_buffer_st
        {
-       unsigned char *buf;     /* at least SSL3_RT_MAX_PACKET_SIZE bytes,
-                                * see ssl3_setup_buffers() */
-       size_t len;             /* buffer size */
-       int offset;             /* where to 'copy from' */
-       int left;               /* how many bytes left */
+       /* at least SSL3_RT_MAX_PACKET_SIZE bytes, see ssl3_setup_buffers() */
+       unsigned char *buf;
+       /* buffer size */
+       size_t len;
+       /* where to 'copy from' */
+       int offset;
+       /* how many bytes left */
+       int left;
        } SSL3_BUFFER;
 
 #define SSL3_CT_RSA_SIGN                       1
index 9b6df7a36e11f081cd985d23fe31f73d77c6d58f..8a429ba187a6b5827c4ebf88c24c9bc1aab6183a 100644 (file)
@@ -198,10 +198,15 @@ int SSL_clear(SSL *s)
        s->hit=0;
        s->shutdown=0;
 
-#if 0 /* Disabled since version 1.10 of this file (early return not
-       * needed because SSL_clear is not called when doing renegotiation) */
-       /* This is set if we are doing dynamic renegotiation so keep
-        * the old cipher.  It is sort of a SSL_clear_lite :-) */
+#if 0
+       /*
+        * Disabled since version 1.10 of this file (early return not
+     * needed because SSL_clear is not called when doing renegotiation)
+     */
+       /*
+        * This is set if we are doing dynamic renegotiation so keep
+        * the old cipher.  It is sort of a SSL_clear_lite :-)
+        */
        if (s->new_session) return(1);
 #else
        if (s->new_session)
index bb553aaefd14fb7f6f0bca3bbfc4a5ee00093b39..7ff5d32c9a39eefd244c5fc07d78ebfccab49dcb 100644 (file)
@@ -472,9 +472,12 @@ typedef struct cert_pkey_st
 typedef struct cert_st
        {
        /* Current active set */
-       CERT_PKEY *key; /* ALWAYS points to an element of the pkeys array
-                        * Probably it would make more sense to store
-                        * an index, not a pointer. */
+       /*
+        * ALWAYS points to an element of the pkeys array
+        * Probably it would make more sense to store
+        * an index, not a pointer.
+        */
+       CERT_PKEY *key;
  
        /* The following masks are for the key and auth
         * algorithms that are supported by the certs below */
index 8e5d8a097221af294ea12b8d87330b0f359a3c1d..005d60a1a422104c40a2a31588bd4fa2c41d85b9 100644 (file)
@@ -955,9 +955,11 @@ static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s)
        if ((s->next == NULL) || (s->prev == NULL)) return;
 
        if (s->next == (SSL_SESSION *)&(ctx->session_cache_tail))
-               { /* last element in list */
+               {
+               /* last element in list */
                if (s->prev == (SSL_SESSION *)&(ctx->session_cache_head))
-                       { /* only one element in list */
+                       {
+                       /* only one element in list */
                        ctx->session_cache_head=NULL;
                        ctx->session_cache_tail=NULL;
                        }
@@ -970,12 +972,14 @@ static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s)
        else
                {
                if (s->prev == (SSL_SESSION *)&(ctx->session_cache_head))
-                       { /* first element in list */
+                       {
+                       /* first element in list */
                        ctx->session_cache_head=s->next;
                        s->next->prev=(SSL_SESSION *)&(ctx->session_cache_head);
                        }
                else
-                       { /* middle of list */
+                       {
+                       /* middle of list */
                        s->next->prev=s->prev;
                        s->prev->next=s->next;
                        }
index 46b449cf71165fa397afd602e14d5a972f18d99f..80f5a287998569b1d1d1b24a831b14085ab2cb99 100644 (file)
  * OTHERWISE.
  */
 
-#define _BSD_SOURCE 1          /* Or gethostname won't be declared properly
-                                  on Linux and GNU platforms. */
+/* Or gethostname won't be declared properly on Linux and GNU platforms. */
+#define _BSD_SOURCE 1
 
 #include <assert.h>
 #include <errno.h>
 #include "e_os.h"
 
 #ifdef OPENSSL_SYS_VMS
-#define _XOPEN_SOURCE 500      /* Or isascii won't be declared properly on
-                                  VMS (at least with DECompHP C).  */
+/* Or isascii won't be declared properly on VMS (at least with DECompHP C).  */
+#define _XOPEN_SOURCE 500
 #endif
 
 #include <ctype.h>
 #endif
 #include <openssl/bn.h>
 
-#define _XOPEN_SOURCE_EXTENDED 1 /* Or gethostname won't be declared properly
-                                    on Compaq platforms (at least with DEC C).
-                                    Do not try to put it earlier, or IPv6 includes
-                                    get screwed...
-                                 */
+/*
+ * Or gethostname won't be declared properly
+ * on Compaq platforms (at least with DEC C).
+ * Do not try to put it earlier, or IPv6 includes
+ * get screwed...
+*/
+#define _XOPEN_SOURCE_EXTENDED 1 
 
 #ifdef OPENSSL_SYS_WINDOWS
 #include <winsock.h>
index 7cce96a74d1bbcd577256adf793af674875dcd36..fcf8bc937b0ab4f5331de03a0bf9d9e77fe6ee7d 100644 (file)
@@ -942,8 +942,11 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
                                return 0;
                                }
 
-                       if (s->s3->client_opaque_prf_input != NULL) /* shouldn't really happen */
+                       if (s->s3->client_opaque_prf_input != NULL)
+                               {
+                               /* shouldn't really happen */
                                OPENSSL_free(s->s3->client_opaque_prf_input);
+                               }
                                
                        /* dummy byte just to get non-NULL */
                        if (s->s3->client_opaque_prf_input_len == 0)
@@ -1216,12 +1219,20 @@ int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
                                return 0;
                                }
                        
-                       if (s->s3->server_opaque_prf_input != NULL) /* shouldn't really happen */
+                       if (s->s3->server_opaque_prf_input != NULL)
+                               {
+                               /* shouldn't really happen */
                                OPENSSL_free(s->s3->server_opaque_prf_input);
+                               }
                        if (s->s3->server_opaque_prf_input_len == 0)
-                               s->s3->server_opaque_prf_input = OPENSSL_malloc(1); /* dummy byte just to get non-NULL */
+                               {
+                               /* dummy byte just to get non-NULL */
+                               s->s3->server_opaque_prf_input = OPENSSL_malloc(1);
+                               }
                        else
+                               {
                                s->s3->server_opaque_prf_input = BUF_memdup(sdata, s->s3->server_opaque_prf_input_len);
+                               }
 
                        if (s->s3->server_opaque_prf_input == NULL)
                                {
@@ -1371,13 +1382,21 @@ int ssl_prepare_clienthello_tlsext(SSL *s)
 
                if (s->tlsext_opaque_prf_input != NULL)
                        {
-                       if (s->s3->client_opaque_prf_input != NULL) /* shouldn't really happen */
+                       if (s->s3->client_opaque_prf_input != NULL)
+                               {
+                               /* shouldn't really happen */
                                OPENSSL_free(s->s3->client_opaque_prf_input);
+                               }
 
                        if (s->tlsext_opaque_prf_input_len == 0)
-                               s->s3->client_opaque_prf_input = OPENSSL_malloc(1); /* dummy byte just to get non-NULL */
+                               {
+                               /* dummy byte just to get non-NULL */
+                               s->s3->client_opaque_prf_input = OPENSSL_malloc(1);
+                               }
                        else
+                               {
                                s->s3->client_opaque_prf_input = BUF_memdup(s->tlsext_opaque_prf_input, s->tlsext_opaque_prf_input_len);
+                               }
                        if (s->s3->client_opaque_prf_input == NULL)
                                {
                                SSLerr(SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT,ERR_R_MALLOC_FAILURE);
@@ -1465,8 +1484,11 @@ int ssl_check_clienthello_tlsext_early(SSL *s)
                                }
                        }
 
-               if (s->s3->server_opaque_prf_input != NULL) /* shouldn't really happen */
+               if (s->s3->server_opaque_prf_input != NULL)
+                       {
+                       /* shouldn't really happen */
                        OPENSSL_free(s->s3->server_opaque_prf_input);
+                       }
                s->s3->server_opaque_prf_input = NULL;
 
                if (s->tlsext_opaque_prf_input != NULL)
@@ -1478,9 +1500,14 @@ int ssl_check_clienthello_tlsext_early(SSL *s)
                                 * of the same length as the client opaque PRF input! */
 
                                if (s->tlsext_opaque_prf_input_len == 0)
-                                       s->s3->server_opaque_prf_input = OPENSSL_malloc(1); /* dummy byte just to get non-NULL */
+                                       {
+                                       /* dummy byte just to get non-NULL */
+                                       s->s3->server_opaque_prf_input = OPENSSL_malloc(1);
+                                       }
                                else
+                                       {
                                        s->s3->server_opaque_prf_input = BUF_memdup(s->tlsext_opaque_prf_input, s->tlsext_opaque_prf_input_len);
+                                       }
                                if (s->s3->server_opaque_prf_input == NULL)
                                        {
                                        ret = SSL_TLSEXT_ERR_ALERT_FATAL;
index 6eeb8dda6c2986aac2121993484bae55b2ff15e5..377e24212fec726eb69d82c03fe33b23d0880ba5 100644 (file)
@@ -217,9 +217,12 @@ extern "C" {
 #define TLSEXT_TYPE_ec_point_formats           11
 #define TLSEXT_TYPE_session_ticket             35
 /* ExtensionType value from draft-rescorla-tls-opaque-prf-input-00.txt */
-#if 0 /* will have to be provided externally for now ,
-       * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183
-       * using whatever extension number you'd like to try */
+#if 0
+/*
+ * will have to be provided externally for now ,
+ * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183
+ * using whatever extension number you'd like to try
+ */
 # define TLSEXT_TYPE_opaque_prf_input          ?? */
 #endif