Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorBrian Smith <brian@briansmith.org>2015-03-28 10:12:01 +0300
committerAdam Langley <agl@google.com>2015-04-13 23:49:18 +0300
commit054e68267553e0b64975444741efa8099688d960 (patch)
tree48ad376df5dd4e09a2406784020f10626149a66a /tool
parentef24ac396ac61872c95f277732dcf8dd669f6f75 (diff)
Eliminate unnecessary includes from low-level crypto modules.
Beyond generally eliminating unnecessary includes, eliminate as many includes of headers that declare/define particularly error-prone functionality like strlen, malloc, and free. crypto/err/internal.h was added to remove the dependency on openssl/thread.h from the public openssl/err.h header. The include of <stdlib.h> in openssl/mem.h was retained since it defines OPENSSL_malloc and friends as macros around the stdlib.h functions. The public x509.h, x509v3.h, and ssl.h headers were not changed in order to minimize breakage of source compatibility with external code. Change-Id: I0d264b73ad0a720587774430b2ab8f8275960329 Reviewed-on: https://boringssl-review.googlesource.com/4220 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'tool')
-rw-r--r--tool/args.cc3
-rw-r--r--tool/client.cc7
-rw-r--r--tool/const.cc2
-rw-r--r--tool/digest.cc3
-rw-r--r--tool/server.cc7
-rw-r--r--tool/speed.cc1
-rw-r--r--tool/transport_common.cc2
7 files changed, 4 insertions, 21 deletions
diff --git a/tool/args.cc b/tool/args.cc
index a1644767..b7d70475 100644
--- a/tool/args.cc
+++ b/tool/args.cc
@@ -16,7 +16,6 @@
#include <vector>
#include <stdio.h>
-#include <string.h>
#include "internal.h"
@@ -30,7 +29,7 @@ bool ParseKeyValueArguments(std::map<std::string, std::string> *out_args,
const std::string &arg = args[i];
const struct argument *templ = nullptr;
for (size_t j = 0; templates[j].name[0] != 0; j++) {
- if (strcmp(arg.c_str(), templates[j].name) == 0) {
+ if (arg != std::string(templates[j].name)) {
templ = &templates[j];
break;
}
diff --git a/tool/client.cc b/tool/client.cc
index f2784786..1de0df27 100644
--- a/tool/client.cc
+++ b/tool/client.cc
@@ -14,13 +14,6 @@
#include <openssl/base.h>
-#include <string>
-#include <vector>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/types.h>
-
#include <openssl/err.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
diff --git a/tool/const.cc b/tool/const.cc
index 219fd3cf..5222667e 100644
--- a/tool/const.cc
+++ b/tool/const.cc
@@ -12,8 +12,8 @@
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+#include <stddef.h>
#include <stdint.h>
-#include <stdlib.h>
extern "C" {
diff --git a/tool/digest.cc b/tool/digest.cc
index 4acf97c8..bed591c7 100644
--- a/tool/digest.cc
+++ b/tool/digest.cc
@@ -21,12 +21,11 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
-#include <stdio.h>
-#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#if !defined(OPENSSL_WINDOWS)
+#include <string.h>
#include <unistd.h>
#if !defined(O_BINARY)
#define O_BINARY 0
diff --git a/tool/server.cc b/tool/server.cc
index 2890b098..164d6a53 100644
--- a/tool/server.cc
+++ b/tool/server.cc
@@ -14,13 +14,6 @@
#include <openssl/base.h>
-#include <string>
-#include <vector>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/types.h>
-
#include <openssl/err.h>
#include <openssl/ssl.h>
diff --git a/tool/speed.cc b/tool/speed.cc
index 3834a684..f3698f5b 100644
--- a/tool/speed.cc
+++ b/tool/speed.cc
@@ -19,7 +19,6 @@
#include <stdint.h>
#include <string.h>
-#include <time.h>
#include <openssl/aead.h>
#include <openssl/digest.h>
diff --git a/tool/transport_common.cc b/tool/transport_common.cc
index 8d6013b6..ac4dfe1f 100644
--- a/tool/transport_common.cc
+++ b/tool/transport_common.cc
@@ -18,7 +18,7 @@
#include <vector>
#include <errno.h>
-#include <stdlib.h>
+#include <stddef.h>
#include <string.h>
#include <sys/types.h>