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 18:09:33 +0300
committerAdam Langley <agl@google.com>2016-07-12 18:09:33 +0300
commit10f97f3bfcecc3fbe8e9f02e7c426f7e340f7f54 (patch)
tree3a23df61db5dc580eeb23916bf8955f5fcedc6cd /crypto/bytestring
parentd2b5af56cf2a8b4695821b2ff64a7bfc82f3ba5e (diff)
Revert "Move C++ helpers into |bssl| namespace."
This reverts commit 09feb0f3d95a2bc58ce0faaf14256d3bd30f52a4. (In order to make WebRTC happy this also needs to be reverted.)
Diffstat (limited to 'crypto/bytestring')
-rw-r--r--crypto/bytestring/bytestring_test.cc58
1 files changed, 27 insertions, 31 deletions
diff --git a/crypto/bytestring/bytestring_test.cc b/crypto/bytestring/bytestring_test.cc
index 95d9b85c..31ee51c4 100644
--- a/crypto/bytestring/bytestring_test.cc
+++ b/crypto/bytestring/bytestring_test.cc
@@ -29,8 +29,6 @@
#include "../test/scoped_types.h"
-namespace bssl {
-
static bool TestSkip() {
static const uint8_t kData[] = {1, 2, 3};
CBS data;
@@ -294,7 +292,7 @@ static bool TestCBBBasic() {
return false;
}
- ScopedBytes scoper(buf);
+ ScopedOpenSSLBytes scoper(buf);
return buf_len == sizeof(kExpected) && memcmp(buf, kExpected, buf_len) == 0;
}
@@ -339,7 +337,7 @@ static bool TestCBBFinishChild() {
CBB_cleanup(&cbb);
return false;
}
- ScopedBytes scoper(out_buf);
+ ScopedOpenSSLBytes scoper(out_buf);
return out_size == 1 && out_buf[0] == 0;
}
@@ -372,7 +370,7 @@ static bool TestCBBPrefixed() {
return false;
}
- ScopedBytes scoper(buf);
+ ScopedOpenSSLBytes scoper(buf);
return buf_len == sizeof(kExpected) && memcmp(buf, kExpected, buf_len) == 0;
}
@@ -412,7 +410,7 @@ static bool TestCBBDiscardChild() {
if (!CBB_finish(cbb.get(), &buf, &buf_len)) {
return false;
}
- ScopedBytes scoper(buf);
+ ScopedOpenSSLBytes scoper(buf);
static const uint8_t kExpected[] = {
0xaa,
@@ -458,7 +456,7 @@ static bool TestCBBMisuse() {
CBB_cleanup(&cbb);
return false;
}
- ScopedBytes scoper(buf);
+ ScopedOpenSSLBytes scoper(buf);
if (buf_len != 3 ||
memcmp(buf, "\x01\x01\x02", 3) != 0) {
@@ -482,7 +480,7 @@ static bool TestCBBASN1() {
CBB_cleanup(&cbb);
return false;
}
- ScopedBytes scoper(buf);
+ ScopedOpenSSLBytes scoper(buf);
if (buf_len != sizeof(kExpected) || memcmp(buf, kExpected, buf_len) != 0) {
return false;
@@ -557,7 +555,7 @@ static bool DoBerConvert(const char *name,
fprintf(stderr, "%s: CBS_asn1_ber_to_der failed.\n", name);
return false;
}
- ScopedBytes scoper(out);
+ ScopedOpenSSLBytes scoper(out);
if (out == NULL) {
if (ber_len != der_len ||
@@ -670,7 +668,7 @@ static bool TestImplicitString() {
int ok = CBS_get_asn1_implicit_string(&in, &out, &storage,
CBS_ASN1_CONTEXT_SPECIFIC | 0,
CBS_ASN1_OCTETSTRING);
- ScopedBytes scoper(storage);
+ ScopedOpenSSLBytes scoper(storage);
if (static_cast<bool>(ok) != test.ok) {
fprintf(stderr, "CBS_get_asn1_implicit_string unexpectedly %s\n",
@@ -749,7 +747,7 @@ static bool TestASN1Uint64() {
CBB_cleanup(&cbb);
return false;
}
- ScopedBytes scoper(out);
+ ScopedOpenSSLBytes scoper(out);
if (len != test->encoding_len || memcmp(out, test->encoding, len) != 0) {
return false;
}
@@ -799,29 +797,27 @@ static bool TestCBBReserve() {
return true;
}
-} // namespace bssl
-
int main(void) {
CRYPTO_library_init();
- if (!bssl::TestSkip() ||
- !bssl::TestGetUint() ||
- !bssl::TestGetPrefixed() ||
- !bssl::TestGetPrefixedBad() ||
- !bssl::TestGetASN1() ||
- !bssl::TestCBBBasic() ||
- !bssl::TestCBBFixed() ||
- !bssl::TestCBBFinishChild() ||
- !bssl::TestCBBMisuse() ||
- !bssl::TestCBBPrefixed() ||
- !bssl::TestCBBDiscardChild() ||
- !bssl::TestCBBASN1() ||
- !bssl::TestBerConvert() ||
- !bssl::TestImplicitString() ||
- !bssl::TestASN1Uint64() ||
- !bssl::TestGetOptionalASN1Bool() ||
- !bssl::TestZero() ||
- !bssl::TestCBBReserve()) {
+ if (!TestSkip() ||
+ !TestGetUint() ||
+ !TestGetPrefixed() ||
+ !TestGetPrefixedBad() ||
+ !TestGetASN1() ||
+ !TestCBBBasic() ||
+ !TestCBBFixed() ||
+ !TestCBBFinishChild() ||
+ !TestCBBMisuse() ||
+ !TestCBBPrefixed() ||
+ !TestCBBDiscardChild() ||
+ !TestCBBASN1() ||
+ !TestBerConvert() ||
+ !TestImplicitString() ||
+ !TestASN1Uint64() ||
+ !TestGetOptionalASN1Bool() ||
+ !TestZero() ||
+ !TestCBBReserve()) {
return 1;
}