diff options
author | Alexey Polyudov <apolyudov@google.com> | 2020-06-16 01:29:46 -0700 |
---|---|---|
committer | Alexey Polyudov <apolyudov@google.com> | 2020-06-22 15:51:32 -0700 |
commit | 65a1750598c4503cb22dd9dd6938f932fa4969c3 (patch) | |
tree | 51dd4bc8823d45453df3afec57ebbde2d8dee692 | |
parent | d0ef67a34a901e781c6c27e1375003888b040f29 (diff) | |
download | ukey2-65a1750598c4503cb22dd9dd6938f932fa4969c3.tar.gz |
Switch securemessage submodule project to google/
clean up gradle artifacts.
add c++ test helper app.
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I96cde0abe95a3a2995df23e0661058e4e650ae87
-rw-r--r-- | .gitmodules | 8 | ||||
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | build.gradle | 14 | ||||
-rw-r--r-- | src/.gradle/3.2.1/taskArtifacts/fileSnapshots.bin | bin | 18577 -> 0 bytes | |||
-rw-r--r-- | src/.gradle/3.2.1/taskArtifacts/taskArtifacts.bin | bin | 18786 -> 0 bytes | |||
-rw-r--r-- | src/.gradle/3.2.1/taskArtifacts/taskArtifacts.lock | bin | 17 -> 0 bytes | |||
-rw-r--r-- | src/main/cpp/src/securegcm/CMakeLists.txt | 14 | ||||
-rw-r--r-- | src/main/cpp/src/securegcm/ukey2_shell.cc | 10 | ||||
m--------- | third_party/absl | 0 |
9 files changed, 51 insertions, 6 deletions
diff --git a/.gitmodules b/.gitmodules index d49f4de..2624f19 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "third_party/secure_message"] path = third_party/secure_message - url = https://github.com/apolyudov/securemessage - branch = release + url = https://github.com/google/securemessage + branch = master [submodule "third_party/gtest"] path = third_party/gtest url = https://github.com/google/googletest @@ -10,3 +10,7 @@ path = third_party/protobuf url = https://github.com/protocolbuffers/protobuf branch = master +[submodule "third_party/absl"] + path = third_party/absl + url = https://github.com/abseil/abseil-cpp + branch = master diff --git a/CMakeLists.txt b/CMakeLists.txt index ad6b713..02ddda2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,9 @@ project(ukey2) option(ukey2_USE_LOCAL_PROTOBUF "Use local copy of protobuf library and compiler" OFF) +option(ukey2_USE_LOCAL_ABSL + "Use local copy of abseil-cpp library" OFF) + include(cmake/proto_defs.cmake) include(cmake/local_build_setup.cmake) @@ -26,6 +29,14 @@ if (ukey2_USE_LOCAL_PROTOBUF) include(cmake/local_build_protobuf.cmake) endif() +if (ukey2_USE_LOCAL_ABSL) + if (NOT TARGET absl::base) + add_subdirectory(third_party/absl) + endif() +else() + find_package(absl REQUIRED) +endif() + find_package(Protobuf REQUIRED) enable_testing() diff --git a/build.gradle b/build.gradle index 2564533..e319422 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + apply plugin: 'java' apply plugin: 'com.google.protobuf' diff --git a/src/.gradle/3.2.1/taskArtifacts/fileSnapshots.bin b/src/.gradle/3.2.1/taskArtifacts/fileSnapshots.bin Binary files differdeleted file mode 100644 index f0cc1a8..0000000 --- a/src/.gradle/3.2.1/taskArtifacts/fileSnapshots.bin +++ /dev/null diff --git a/src/.gradle/3.2.1/taskArtifacts/taskArtifacts.bin b/src/.gradle/3.2.1/taskArtifacts/taskArtifacts.bin Binary files differdeleted file mode 100644 index b1f5426..0000000 --- a/src/.gradle/3.2.1/taskArtifacts/taskArtifacts.bin +++ /dev/null diff --git a/src/.gradle/3.2.1/taskArtifacts/taskArtifacts.lock b/src/.gradle/3.2.1/taskArtifacts/taskArtifacts.lock Binary files differdeleted file mode 100644 index 6fa2a90..0000000 --- a/src/.gradle/3.2.1/taskArtifacts/taskArtifacts.lock +++ /dev/null diff --git a/src/main/cpp/src/securegcm/CMakeLists.txt b/src/main/cpp/src/securegcm/CMakeLists.txt index a0d751d..b562756 100644 --- a/src/main/cpp/src/securegcm/CMakeLists.txt +++ b/src/main/cpp/src/securegcm/CMakeLists.txt @@ -31,3 +31,17 @@ target_link_libraries(ukey2 proto_ukey_cc_proto securemessage ) + +add_executable(ukey2_shell + ukey2_shell.cc +) + +target_link_libraries(ukey2_shell + PUBLIC + securemessage + ukey2 + absl::base + absl::container + absl::flags + absl::flags_parse +) diff --git a/src/main/cpp/src/securegcm/ukey2_shell.cc b/src/main/cpp/src/securegcm/ukey2_shell.cc index c12ea13..99a35a8 100644 --- a/src/main/cpp/src/securegcm/ukey2_shell.cc +++ b/src/main/cpp/src/securegcm/ukey2_shell.cc @@ -34,16 +34,18 @@ // will have the following simple format: // [ length | bytes ] // where |length| is a 4 byte big-endian encoded unsigned integer. +#include <cassert> #include <cstdio> #include <iostream> #include <memory> -#include "base/commandlineflags.h" -#include "base/init_google.h" -#include "base/logging.h" #include "securegcm/ukey2_handshake.h" #include "absl/container/fixed_array.h" #include "absl/flags/flag.h" +#include "absl/flags/parse.h" + +#define LOG(ERROR) std::cerr +#define CHECK_EQ(a, b) do { if ((a) != (b)) abort(); } while(0) ABSL_FLAG( int, verification_string_length, 32, @@ -270,7 +272,7 @@ bool UKey2Shell::RunAsResponder() { } // namespace securegcm int main(int argc, char** argv) { - InitGoogle(argv[0], &argc, &argv, true /* remove_flags */); + absl::ParseCommandLine(argc, argv); const int verification_string_length = absl::GetFlag(FLAGS_verification_string_length); diff --git a/third_party/absl b/third_party/absl new file mode 160000 +Subproject 62f05b1f57ad660e9c09e02ce7d591dcc4d0ca0 |