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/crypto/dh
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/dh
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/dh')
-rw-r--r--crypto/dh/dh_test.cc41
1 files changed, 20 insertions, 21 deletions
diff --git a/crypto/dh/dh_test.cc b/crypto/dh/dh_test.cc
index 1c244283..8fe496c9 100644
--- a/crypto/dh/dh_test.cc
+++ b/crypto/dh/dh_test.cc
@@ -71,25 +71,7 @@
#include "../test/scoped_types.h"
-static bool RunBasicTests();
-static bool RunRFC5114Tests();
-static bool TestBadY();
-static bool TestASN1();
-
-int main(int argc, char *argv[]) {
- CRYPTO_library_init();
-
- if (!RunBasicTests() ||
- !RunRFC5114Tests() ||
- !TestBadY() ||
- !TestASN1()) {
- ERR_print_errors_fp(stderr);
- return 1;
- }
-
- printf("PASS\n");
- return 0;
-}
+namespace bssl {
static int GenerateCallback(int p, int n, BN_GENCB *arg) {
char c = '*';
@@ -575,7 +557,7 @@ static bool TestASN1() {
!CBB_finish(cbb.get(), &der, &der_len)) {
return false;
}
- ScopedOpenSSLBytes free_der(der);
+ ScopedBytes free_der(der);
if (der_len != sizeof(kParams) || memcmp(der, kParams, der_len) != 0) {
return false;
}
@@ -617,10 +599,27 @@ static bool TestASN1() {
!CBB_finish(cbb.get(), &der, &der_len)) {
return false;
}
- ScopedOpenSSLBytes free_der2(der);
+ ScopedBytes free_der2(der);
if (der_len != sizeof(kParamsDSA) || memcmp(der, kParamsDSA, der_len) != 0) {
return false;
}
return true;
}
+
+} // namespace bssl
+
+int main(int argc, char *argv[]) {
+ CRYPTO_library_init();
+
+ if (!bssl::RunBasicTests() ||
+ !bssl::RunRFC5114Tests() ||
+ !bssl::TestBadY() ||
+ !bssl::TestASN1()) {
+ ERR_print_errors_fp(stderr);
+ return 1;
+ }
+
+ printf("PASS\n");
+ return 0;
+}