Remove string.h from base.h.
Including string.h in base.h causes any file that includes a BoringSSL
header to include string.h. Generally this wouldn't be a problem,
although string.h might slow down the compile if it wasn't otherwise
needed. However, it also causes problems for ipsec-tools in Android
because OpenSSL didn't have this behaviour.
This change removes string.h from base.h and, instead, adds it to each
.c file that requires it.
Change-Id: I5968e50b0e230fd3adf9b72dd2836e6f52d6fb37
Reviewed-on: https://boringssl-review.googlesource.com/3200
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/x509v3/pcy_tree.c b/crypto/x509v3/pcy_tree.c
index a70a72b..682474d 100644
--- a/crypto/x509v3/pcy_tree.c
+++ b/crypto/x509v3/pcy_tree.c
@@ -55,6 +55,8 @@
*
*/
+#include <string.h>
+
#include <openssl/mem.h>
#include <openssl/obj.h>
#include <openssl/stack.h>
diff --git a/crypto/x509v3/v3_akey.c b/crypto/x509v3/v3_akey.c
index 67607d9..f6e6b69 100644
--- a/crypto/x509v3/v3_akey.c
+++ b/crypto/x509v3/v3_akey.c
@@ -55,6 +55,7 @@
* Hudson (tjh@cryptsoft.com). */
#include <stdio.h>
+#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
diff --git a/crypto/x509v3/v3_alt.c b/crypto/x509v3/v3_alt.c
index 54e0f0a..113cf45 100644
--- a/crypto/x509v3/v3_alt.c
+++ b/crypto/x509v3/v3_alt.c
@@ -55,6 +55,7 @@
* Hudson (tjh@cryptsoft.com). */
#include <stdio.h>
+#include <string.h>
#include <openssl/conf.h>
#include <openssl/err.h>
diff --git a/crypto/x509v3/v3_bcons.c b/crypto/x509v3/v3_bcons.c
index 881b922..a1381b4 100644
--- a/crypto/x509v3/v3_bcons.c
+++ b/crypto/x509v3/v3_bcons.c
@@ -56,6 +56,7 @@
#include <stdio.h>
+#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
diff --git a/crypto/x509v3/v3_bitst.c b/crypto/x509v3/v3_bitst.c
index a4c3186..15e9859 100644
--- a/crypto/x509v3/v3_bitst.c
+++ b/crypto/x509v3/v3_bitst.c
@@ -55,6 +55,7 @@
* Hudson (tjh@cryptsoft.com). */
#include <stdio.h>
+#include <string.h>
#include <openssl/conf.h>
#include <openssl/err.h>
diff --git a/crypto/x509v3/v3_conf.c b/crypto/x509v3/v3_conf.c
index 48654cb..7606ac1 100644
--- a/crypto/x509v3/v3_conf.c
+++ b/crypto/x509v3/v3_conf.c
@@ -56,8 +56,9 @@
/* extension creation utilities */
-#include <stdio.h>
#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
#include <openssl/conf.h>
#include <openssl/err.h>
diff --git a/crypto/x509v3/v3_cpols.c b/crypto/x509v3/v3_cpols.c
index b3d6fef..d5a8c3c 100644
--- a/crypto/x509v3/v3_cpols.c
+++ b/crypto/x509v3/v3_cpols.c
@@ -57,6 +57,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
diff --git a/crypto/x509v3/v3_crld.c b/crypto/x509v3/v3_crld.c
index e2bd2ad..e41dd65 100644
--- a/crypto/x509v3/v3_crld.c
+++ b/crypto/x509v3/v3_crld.c
@@ -55,6 +55,7 @@
* Hudson (tjh@cryptsoft.com). */
#include <stdio.h>
+#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
diff --git a/crypto/x509v3/v3_ia5.c b/crypto/x509v3/v3_ia5.c
index 39d6ef8..ec57e9b 100644
--- a/crypto/x509v3/v3_ia5.c
+++ b/crypto/x509v3/v3_ia5.c
@@ -56,8 +56,8 @@
*
*/
-
#include <stdio.h>
+#include <string.h>
#include <openssl/asn1.h>
#include <openssl/conf.h>
diff --git a/crypto/x509v3/v3_info.c b/crypto/x509v3/v3_info.c
index 4ef744b..7558b2d 100644
--- a/crypto/x509v3/v3_info.c
+++ b/crypto/x509v3/v3_info.c
@@ -57,6 +57,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
diff --git a/crypto/x509v3/v3_pci.c b/crypto/x509v3/v3_pci.c
index 54f28e1..aa93891 100644
--- a/crypto/x509v3/v3_pci.c
+++ b/crypto/x509v3/v3_pci.c
@@ -35,6 +35,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include <openssl/conf.h>
#include <openssl/err.h>
diff --git a/crypto/x509v3/v3_pcons.c b/crypto/x509v3/v3_pcons.c
index dac732c..f87c6a0 100644
--- a/crypto/x509v3/v3_pcons.c
+++ b/crypto/x509v3/v3_pcons.c
@@ -56,6 +56,7 @@
#include <stdio.h>
+#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
diff --git a/crypto/x509v3/v3_purp.c b/crypto/x509v3/v3_purp.c
index 791927f..6daf632 100644
--- a/crypto/x509v3/v3_purp.c
+++ b/crypto/x509v3/v3_purp.c
@@ -56,6 +56,8 @@
#include <stdio.h>
+#include <string.h>
+
#include <openssl/buf.h>
#include <openssl/err.h>
#include <openssl/digest.h>
diff --git a/crypto/x509v3/v3_skey.c b/crypto/x509v3/v3_skey.c
index 116679a..471a1ab 100644
--- a/crypto/x509v3/v3_skey.c
+++ b/crypto/x509v3/v3_skey.c
@@ -56,6 +56,7 @@
#include <stdio.h>
+#include <string.h>
#include <openssl/digest.h>
#include <openssl/err.h>
diff --git a/crypto/x509v3/v3_sxnet.c b/crypto/x509v3/v3_sxnet.c
index 7b8e3c5..bb5e214 100644
--- a/crypto/x509v3/v3_sxnet.c
+++ b/crypto/x509v3/v3_sxnet.c
@@ -57,6 +57,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c
index b856efd..d081c1c 100644
--- a/crypto/x509v3/v3_utl.c
+++ b/crypto/x509v3/v3_utl.c
@@ -60,6 +60,7 @@
#include <ctype.h>
#include <stdio.h>
+#include <string.h>
#include <openssl/bn.h>
#include <openssl/buf.h>