Align the SSL stack on #include style.

ssl.h should be first. Also two lines after includes and the rest of the
file.

Change-Id: Icb7586e00a3e64170082c96cf3f8bfbb2b7e1611
Reviewed-on: https://boringssl-review.googlesource.com/5892
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/custom_extensions.c b/ssl/custom_extensions.c
index a56c0f6..c94543d 100644
--- a/ssl/custom_extensions.c
+++ b/ssl/custom_extensions.c
@@ -12,10 +12,15 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <string.h>
 
-#include <openssl/ssl.h>
+#include <openssl/bytestring.h>
+#include <openssl/err.h>
+#include <openssl/mem.h>
+#include <openssl/stack.h>
 
 #include "internal.h"
 
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index 9fa46b1..1acb3ce 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -111,6 +111,8 @@
  * copied and put under another distribution licence
  * [including the GNU Public Licence.] */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <limits.h>
 #include <stdio.h>
diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c
index a3c1c37..73a3f8a 100644
--- a/ssl/d1_clnt.c
+++ b/ssl/d1_clnt.c
@@ -112,6 +112,8 @@
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
@@ -128,6 +130,7 @@
 
 #include "internal.h"
 
+
 static int dtls1_get_hello_verify(SSL *s);
 
 int dtls1_connect(SSL *s) {
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c
index db8a536..cb95585 100644
--- a/ssl/d1_lib.c
+++ b/ssl/d1_lib.c
@@ -54,12 +54,18 @@
  * (eay@cryptsoft.com).  This product includes software written by Tim
  * Hudson (tjh@cryptsoft.com). */
 
-#include <openssl/base.h>
+#include <openssl/ssl.h>
 
 #include <limits.h>
 #include <stdio.h>
 #include <string.h>
 
+#include <openssl/err.h>
+#include <openssl/mem.h>
+#include <openssl/obj.h>
+
+#include "internal.h"
+
 #if defined(OPENSSL_WINDOWS)
 #include <sys/timeb.h>
 #else
@@ -67,11 +73,6 @@
 #include <sys/time.h>
 #endif
 
-#include <openssl/err.h>
-#include <openssl/mem.h>
-#include <openssl/obj.h>
-
-#include "internal.h"
 
 /* DTLS1_MTU_TIMEOUTS is the maximum number of timeouts to expire
  * before starting to decrease the MTU. */
diff --git a/ssl/d1_meth.c b/ssl/d1_meth.c
index 859818f..d54a037 100644
--- a/ssl/d1_meth.c
+++ b/ssl/d1_meth.c
@@ -55,6 +55,8 @@
  * (eay@cryptsoft.com).  This product includes software written by Tim
  * Hudson (tjh@cryptsoft.com). */
 
+#include <openssl/ssl.h>
+
 #include "internal.h"
 
 
diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c
index 3306368..e2d505c 100644
--- a/ssl/d1_pkt.c
+++ b/ssl/d1_pkt.c
@@ -109,6 +109,8 @@
  * copied and put under another distribution licence
  * [including the GNU Public Licence.] */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssl/d1_srtp.c b/ssl/d1_srtp.c
index 1df1256..2fcc1ea 100644
--- a/ssl/d1_srtp.c
+++ b/ssl/d1_srtp.c
@@ -114,6 +114,8 @@
   Copyright (C) 2011, RTFM, Inc.
 */
 
+#include <openssl/ssl.h>
+
 #include <stdio.h>
 #include <string.h>
 
diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c
index e3e3f17..89c26aa 100644
--- a/ssl/d1_srvr.c
+++ b/ssl/d1_srvr.c
@@ -112,6 +112,8 @@
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 
diff --git a/ssl/s3_both.c b/ssl/s3_both.c
index 0978a5d..31e36c7 100644
--- a/ssl/s3_both.c
+++ b/ssl/s3_both.c
@@ -110,6 +110,8 @@
  * ECC cipher suite support in OpenSSL originally developed by
  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <limits.h>
 #include <stdio.h>
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index 6e82fff..f2539ee 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -148,6 +148,8 @@
  * OTHERWISE.
  */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index ba9883b..f1924c0 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -133,6 +133,8 @@
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  * OTHERWISE. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 7125215..617ea6e 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -146,6 +146,8 @@
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  * OTHERWISE. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssl/s3_meth.c b/ssl/s3_meth.c
index d2f855b..01c1101 100644
--- a/ssl/s3_meth.c
+++ b/ssl/s3_meth.c
@@ -54,6 +54,8 @@
  * copied and put under another distribution licence
  * [including the GNU Public Licence.] */
 
+#include <openssl/ssl.h>
+
 #include "internal.h"
 
 
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index 50898ed..3c2435d 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -106,6 +106,8 @@
  * (eay@cryptsoft.com).  This product includes software written by Tim
  * Hudson (tjh@cryptsoft.com). */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <limits.h>
 #include <stdio.h>
diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
index 7c2d3fa..b428043 100644
--- a/ssl/s3_srvr.c
+++ b/ssl/s3_srvr.c
@@ -146,6 +146,8 @@
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  * OTHERWISE. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssl/ssl_aead_ctx.c b/ssl/ssl_aead_ctx.c
index f50ed79..f9001c7 100644
--- a/ssl/ssl_aead_ctx.c
+++ b/ssl/ssl_aead_ctx.c
@@ -12,6 +12,8 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <string.h>
 
diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c
index 10016a2..0d4760d 100644
--- a/ssl/ssl_asn1.c
+++ b/ssl/ssl_asn1.c
@@ -80,6 +80,8 @@
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  * OTHERWISE. */
 
+#include <openssl/ssl.h>
+
 #include <limits.h>
 #include <string.h>
 
diff --git a/ssl/ssl_cipher.c b/ssl/ssl_cipher.c
index 4894239..8f8d639 100644
--- a/ssl/ssl_cipher.c
+++ b/ssl/ssl_cipher.c
@@ -138,6 +138,8 @@
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  * OTHERWISE. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index d606c7f..34e88fd 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -138,6 +138,8 @@
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  * OTHERWISE. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssl/ssl_session.c b/ssl/ssl_session.c
index 96daec0..345aca2 100644
--- a/ssl/ssl_session.c
+++ b/ssl/ssl_session.c
@@ -133,6 +133,8 @@
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  * OTHERWISE. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssl/ssl_stat.c b/ssl/ssl_stat.c
index d5feb5d..5ad1e47 100644
--- a/ssl/ssl_stat.c
+++ b/ssl/ssl_stat.c
@@ -82,9 +82,11 @@
  * OTHERWISE.
  */
 
-#include <stdio.h>
+#include <openssl/ssl.h>
+
 #include "internal.h"
 
+
 const char *SSL_state_string_long(const SSL *s) {
   const char *str;
 
diff --git a/ssl/ssl_txt.c b/ssl/ssl_txt.c
index 8a0b474..3ba0887 100644
--- a/ssl/ssl_txt.c
+++ b/ssl/ssl_txt.c
@@ -80,12 +80,14 @@
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  * OTHERWISE. */
 
+#include <openssl/ssl.h>
+
 #include <inttypes.h>
 #include <stdio.h>
 
-#include <openssl/buf.h>
+#include <openssl/bio.h>
 #include <openssl/err.h>
-#include <openssl/mem.h>
+#include <openssl/x509.h>
 
 #include "internal.h"
 
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c
index bb30810..076f8bd 100644
--- a/ssl/t1_enc.c
+++ b/ssl/t1_enc.c
@@ -133,6 +133,8 @@
  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  * OTHERWISE. */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 36793f7..5201b2e 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -106,6 +106,8 @@
  * (eay@cryptsoft.com).  This product includes software written by Tim
  * Hudson (tjh@cryptsoft.com). */
 
+#include <openssl/ssl.h>
+
 #include <assert.h>
 #include <limits.h>
 #include <stdio.h>