Revert "Move C++ helpers into |bssl| namespace." This reverts commit 09feb0f3d95a2bc58ce0faaf14256d3bd30f52a4. (In order to make WebRTC happy this also needs to be reverted.)
diff --git a/tool/args.cc b/tool/args.cc index 952584d..9ec18a3 100644 --- a/tool/args.cc +++ b/tool/args.cc
@@ -23,8 +23,6 @@ #include "internal.h" -namespace bssl { - bool ParseKeyValueArguments(std::map<std::string, std::string> *out_args, const std::vector<std::string> &args, const struct argument *templates) { @@ -104,5 +102,3 @@ *out = num; return true; } - -} // namespace bssl
diff --git a/tool/ciphers.cc b/tool/ciphers.cc index fa060ab..d7cc36b 100644 --- a/tool/ciphers.cc +++ b/tool/ciphers.cc
@@ -25,8 +25,6 @@ #include "internal.h" -namespace bssl { - bool Ciphers(const std::vector<std::string> &args) { if (args.size() != 1) { fprintf(stderr, "Usage: bssl ciphers <cipher suite string>\n"); @@ -66,5 +64,3 @@ return true; } - -} // namespace bssl
diff --git a/tool/client.cc b/tool/client.cc index 593e3c6..7310ebf 100644 --- a/tool/client.cc +++ b/tool/client.cc
@@ -26,8 +26,6 @@ #include "transport_common.h" -namespace bssl { - static const struct argument kArguments[] = { { "-connect", kRequiredArgument, @@ -328,5 +326,3 @@ return ok; } - -} // namespace bssl
diff --git a/tool/const.cc b/tool/const.cc index 553e2d9..7b7001e 100644 --- a/tool/const.cc +++ b/tool/const.cc
@@ -18,8 +18,6 @@ #include "internal.h" -namespace bssl { - const uint8_t kDERRSAPrivate2048[] = { 0x30, 0x82, 0x04, 0xa3, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, 0xd0, 0x02, 0xde, 0x5d, 0x19, 0x33, 0x48, 0x15, 0xc7, 0x86, 0xde, 0xa3, @@ -434,5 +432,3 @@ }; const size_t kDERRSAPrivate3Prime2048Len = sizeof(kDERRSAPrivate3Prime2048); - -} // namespace bssl
diff --git a/tool/digest.cc b/tool/digest.cc index e6a97bb..2e3e608 100644 --- a/tool/digest.cc +++ b/tool/digest.cc
@@ -44,8 +44,6 @@ #include "internal.h" -namespace bssl { - struct close_delete { void operator()(int *fd) { BORINGSSL_CLOSE(*fd); @@ -478,5 +476,3 @@ bool SHA512Sum(const std::vector<std::string> &args) { return DigestSum(EVP_sha512(), args); } - -} // namespace bssl
diff --git a/tool/generate_ed25519.cc b/tool/generate_ed25519.cc index 9672b78..15d3692 100644 --- a/tool/generate_ed25519.cc +++ b/tool/generate_ed25519.cc
@@ -22,8 +22,6 @@ #include "internal.h" -namespace bssl { - static const struct argument kArguments[] = { { "-out-public", kRequiredArgument, "The file to write the public key to", @@ -67,5 +65,3 @@ WriteToFile(args_map["-out-private"], private_key, sizeof(private_key)); } - -} // namespace bssl
diff --git a/tool/genrsa.cc b/tool/genrsa.cc index 576bd7c..4b39401 100644 --- a/tool/genrsa.cc +++ b/tool/genrsa.cc
@@ -22,8 +22,6 @@ #include "internal.h" -namespace bssl { - static const struct argument kArguments[] = { { "-nprimes", kOptionalArgument, @@ -69,5 +67,3 @@ return true; } - -} // namespace bssl
diff --git a/tool/internal.h b/tool/internal.h index 769bcab..fd66e00 100644 --- a/tool/internal.h +++ b/tool/internal.h
@@ -44,8 +44,6 @@ #define BORINGSSL_WRITE write #endif -namespace bssl { - enum ArgumentType { kRequiredArgument, kOptionalArgument, @@ -90,7 +88,5 @@ extern const uint8_t kDERRSAPrivate3Prime2048[]; extern const size_t kDERRSAPrivate3Prime2048Len; -} // namespace bssl - #endif /* !OPENSSL_HEADER_TOOL_INTERNAL_H */
diff --git a/tool/pkcs12.cc b/tool/pkcs12.cc index 2423f19..15e32d3 100644 --- a/tool/pkcs12.cc +++ b/tool/pkcs12.cc
@@ -39,8 +39,6 @@ #include "internal.h" -namespace bssl { - #if defined(OPENSSL_WINDOWS) typedef int read_result_t; #else @@ -142,5 +140,3 @@ return true; } - -} // namespace bssl
diff --git a/tool/rand.cc b/tool/rand.cc index a76dc84..3701748 100644 --- a/tool/rand.cc +++ b/tool/rand.cc
@@ -23,8 +23,6 @@ #include "internal.h" -namespace bssl { - static const struct argument kArguments[] = { { "-hex", kBooleanArgument, @@ -95,5 +93,3 @@ return true; } - -} // namespace bssl
diff --git a/tool/server.cc b/tool/server.cc index 04bb7ef..14f37a4 100644 --- a/tool/server.cc +++ b/tool/server.cc
@@ -21,8 +21,6 @@ #include "transport_common.h" -namespace bssl { - static const struct argument kArguments[] = { { "-accept", kRequiredArgument, @@ -152,5 +150,3 @@ SSL_CTX_free(ctx); return ok; } - -} // namespace bssl
diff --git a/tool/speed.cc b/tool/speed.cc index 8efd1f4..a8eb8bf 100644 --- a/tool/speed.cc +++ b/tool/speed.cc
@@ -41,8 +41,6 @@ #include "internal.h" -namespace bssl { - // TimeResults represents the results of benchmarking a function. struct TimeResults { // num_calls is the number of function calls done in the time period. @@ -632,5 +630,3 @@ return true; } - -} // namespace bssl
diff --git a/tool/tool.cc b/tool/tool.cc index 8519108..34851b4 100644 --- a/tool/tool.cc +++ b/tool/tool.cc
@@ -29,8 +29,6 @@ #include "internal.h" -namespace bssl { - typedef bool (*tool_func_t)(const std::vector<std::string> &args); struct Tool { @@ -81,8 +79,7 @@ } } - -static int Main(int argc, char **argv) { +int main(int argc, char **argv) { #if defined(OPENSSL_WINDOWS) // Read and write in binary mode. This makes bssl on Windows consistent with // bssl on other platforms, and also makes it consistent with MSYS's commands @@ -127,9 +124,3 @@ return !tool(args); } - -} // namespace bssl - -int main(int argc, char **argv) { - return bssl::Main(argc, argv); -}
diff --git a/tool/transport_common.cc b/tool/transport_common.cc index 7ccda21..01bba00 100644 --- a/tool/transport_common.cc +++ b/tool/transport_common.cc
@@ -51,8 +51,6 @@ #include "transport_common.h" -namespace bssl { - #if !defined(OPENSSL_WINDOWS) static int closesocket(int sock) { return close(sock); @@ -539,5 +537,3 @@ return true; } - -} // namespace bssl
diff --git a/tool/transport_common.h b/tool/transport_common.h index 8618129..a57a916 100644 --- a/tool/transport_common.h +++ b/tool/transport_common.h
@@ -18,9 +18,6 @@ #include <openssl/ssl.h> #include <string.h> - -namespace bssl { - // InitSocketLibrary calls the Windows socket init functions, if needed. bool InitSocketLibrary(); @@ -46,7 +43,4 @@ // returns true on success and false otherwise. bool DoSMTPStartTLS(int sock); -} // namespace bssl - - #endif /* !OPENSSL_HEADER_TOOL_TRANSPORT_COMMON_H */