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
diff options
context:
space:
mode:
authorAdam Langley <agl@google.com>2016-07-12 00:07:19 +0300
committerDavid Benjamin <davidben@google.com>2016-07-12 02:04:52 +0300
commit09feb0f3d95a2bc58ce0faaf14256d3bd30f52a4 (patch)
treec5d03846c2bffc42b9ab9bd6b6e30e044d7962b6 /crypto/bio
parent09eb655e5cb202878b831eadb30c92ab24960d4a (diff)
Move C++ helpers into |bssl| namespace.
We currently have the situation where the |tool| and |bssl_shim| code includes scoped_types.h from crypto/test and ssl/test. That's weird and shouldn't happen. Also, our C++ consumers might quite like to have access to the scoped types. Thus this change moves some of the template code to base.h and puts it all in a |bssl| namespace to prepare for scattering these types into their respective headers. In order that all the existing test code be able to access these types, it's all moved into the same namespace. Change-Id: I3207e29474dc5fcc344ace43119df26dae04eabb Reviewed-on: https://boringssl-review.googlesource.com/8730 Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bio_test.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/crypto/bio/bio_test.cc b/crypto/bio/bio_test.cc
index f2eb20ba..e7c061eb 100644
--- a/crypto/bio/bio_test.cc
+++ b/crypto/bio/bio_test.cc
@@ -43,6 +43,8 @@ OPENSSL_MSVC_PRAGMA(warning(pop))
#include "../test/scoped_types.h"
+namespace bssl {
+
#if !defined(OPENSSL_WINDOWS)
static int closesocket(int sock) {
return close(sock);
@@ -339,7 +341,7 @@ static bool ReadASN1(bool should_succeed, const uint8_t *data, size_t data_len,
if (!ok) {
out = nullptr;
}
- ScopedOpenSSLBytes out_storage(out);
+ ScopedBytes out_storage(out);
if (should_succeed != (ok == 1)) {
return false;
@@ -369,7 +371,7 @@ static bool TestASN1() {
static const size_t kLargePayloadLen = 8000;
static const uint8_t kLargePrefix[] = {0x30, 0x82, kLargePayloadLen >> 8,
kLargePayloadLen & 0xff};
- ScopedOpenSSLBytes large(reinterpret_cast<uint8_t *>(
+ ScopedBytes large(reinterpret_cast<uint8_t *>(
OPENSSL_malloc(sizeof(kLargePrefix) + kLargePayloadLen)));
if (!large) {
return false;
@@ -410,6 +412,8 @@ static bool TestASN1() {
return true;
}
+} // namespace bssl
+
int main(void) {
CRYPTO_library_init();
@@ -428,10 +432,10 @@ int main(void) {
}
#endif
- if (!TestSocketConnect() ||
- !TestPrintf() ||
- !TestZeroCopyBioPairs() ||
- !TestASN1()) {
+ if (!bssl::TestSocketConnect() ||
+ !bssl::TestPrintf() ||
+ !bssl::TestZeroCopyBioPairs() ||
+ !bssl::TestASN1()) {
return 1;
}