Skip to content

Commit

Permalink
ukey2: Move to bazel and include securemessage library
Browse files Browse the repository at this point in the history
  • Loading branch information
anayw2001 committed May 16, 2023
1 parent c2436e5 commit 311ad8d
Show file tree
Hide file tree
Showing 47 changed files with 5,787 additions and 254 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build --action_env=BAZEL_CXXOPTS=-std=c++17
4 changes: 4 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
alias(
name = "ukey2",
actual = "//src/main/cpp",
)
78 changes: 0 additions & 78 deletions CMakeLists.txt

This file was deleted.

38 changes: 38 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "com_google_protobuf",
strip_prefix = "protobuf-3.22.5",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.22.5.tar.gz"],
)

http_archive(
name = "com_google_protobuf_cc",
strip_prefix = "protobuf-3.22.5",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.22.5.tar.gz"],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
# Load common dependencies.
protobuf_deps()

http_archive(
name = "com_google_googletest",
strip_prefix = "googletest-main",
urls = ["https://github.com/google/googletest/archive/main.zip"],
)

http_archive(
name = "com_google_securemessage",
strip_prefix = "securemessage-master",
urls = ["https://github.com/anayw2001/securemessage/archive/master.zip"],
)

load("@com_google_securemessage//:deps.bzl", "securemessage_deps")
securemessage_deps()

http_archive(
name = "com_google_absl",
strip_prefix = "abseil-cpp-master",
urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"],
)
18 changes: 0 additions & 18 deletions src/main/CMakeLists.txt

This file was deleted.

50 changes: 50 additions & 0 deletions src/main/cpp/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
cc_library(
name = "cpp",
srcs = [
"src/securegcm/d2d_connection_context_v1.cc",
"src/securegcm/d2d_crypto_ops.cc",
"src/securegcm/java_util.cc",
"src/securegcm/ukey2_handshake.cc",
],
hdrs = glob(["include/securegcm/*.h"]),
includes = [
"include",
],
deps = [
"//src/main/proto:cc_proto",
"//src/securemessage:securemessage_common",
"//src/securemessage:securemessage_cpp_protobuf",
"//src/securemessage:securemessage_openssl",
],
visibility = ["//visibility:public"],
)

cc_test(
name = "cpp_tests",
size = "small",
srcs = [
"test/securegcm/d2d_connection_context_v1_test.cc",
"test/securegcm/d2d_crypto_ops_test.cc",
"test/securegcm/java_util_test.cc",
],
includes = [
"include",
],
deps = [
":cpp",
"@com_google_googletest//:gtest_main",
"//src/securemessage:securemessage_common",
"//src/securemessage:securemessage_cpp_protobuf",
],
)

cc_binary(
name = "ukey2_shell",
srcs = ["src/securegcm/ukey2_shell.cc"],
deps = [
":cpp",
"@com_google_absl//absl/container:fixed_array",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/flags:parse",
],
)
21 changes: 0 additions & 21 deletions src/main/cpp/CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/cpp/include/securegcm/d2d_connection_context_v1.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <memory>
#include <string>

#include "securemessage/crypto_ops.h"
#include "src/securemessage/include/securemessage/crypto_ops.h"

namespace securegcm {

Expand Down
4 changes: 2 additions & 2 deletions src/main/cpp/include/securegcm/d2d_crypto_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <memory>
#include <string>

#include "proto/securegcm.pb.h"
#include "securemessage/crypto_ops.h"
#include "src/main/proto/securegcm.pb.h"
#include "src/securemessage/include/securemessage/crypto_ops.h"

namespace securegcm {

Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/include/securegcm/java_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef SECURITY_CRYPTAUTH_LIB_SECUREGCM_JAVA_UTIL_H_
#define SECURITY_CRYPTAUTH_LIB_SECUREGCM_JAVA_UTIL_H_

#include "securemessage/byte_buffer.h"
#include "src/securemessage/include/securemessage/byte_buffer.h"

namespace securegcm {
namespace java_util {
Expand Down
6 changes: 3 additions & 3 deletions src/main/cpp/include/securegcm/ukey2_handshake.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include <map>
#include <memory>

#include "proto/ukey.pb.h"
#include "securegcm/d2d_connection_context_v1.h"
#include "securemessage/crypto_ops.h"
#include "src/main/proto/ukey.pb.h"
#include "src/main/cpp/include/securegcm/d2d_connection_context_v1.h"
#include "src/securemessage/include/securemessage/crypto_ops.h"

namespace securegcm {

Expand Down
47 changes: 0 additions & 47 deletions src/main/cpp/src/securegcm/CMakeLists.txt

This file was deleted.

14 changes: 7 additions & 7 deletions src/main/cpp/src/securegcm/d2d_connection_context_v1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "securegcm/d2d_connection_context_v1.h"
#include "src/main/cpp/include/securegcm/d2d_connection_context_v1.h"

#include <limits>
#include <sstream>

#include "proto/device_to_device_messages.pb.h"
#include "proto/securegcm.pb.h"
#include "securegcm/d2d_crypto_ops.h"
#include "securegcm/java_util.h"
#include "securemessage/secure_message_builder.h"
#include "securemessage/util.h"
#include "src/main/proto/device_to_device_messages.pb.h"
#include "src/main/proto/securegcm.pb.h"
#include "src/main/cpp/include/securegcm/d2d_crypto_ops.h"
#include "src/main/cpp/include/securegcm/java_util.h"
#include "src/securemessage/include/securemessage/secure_message_builder.h"
#include "src/securemessage/include/securemessage/util.h"

namespace securegcm {

Expand Down
8 changes: 4 additions & 4 deletions src/main/cpp/src/securegcm/d2d_crypto_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "securegcm/d2d_crypto_ops.h"
#include "src/main/cpp/include/securegcm/d2d_crypto_ops.h"

#include <sstream>

#include "securemessage/secure_message_builder.h"
#include "securemessage/secure_message_parser.h"
#include "securemessage/util.h"
#include "src/securemessage/include/securemessage/secure_message_builder.h"
#include "src/securemessage/include/securemessage/secure_message_parser.h"
#include "src/securemessage/include/securemessage/util.h"

namespace securegcm {

Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/src/securegcm/java_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "securegcm/java_util.h"
#include "src/main/cpp/include/securegcm/java_util.h"

#include <cstring>

Expand Down
6 changes: 3 additions & 3 deletions src/main/cpp/src/securegcm/ukey2_handshake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "securegcm/ukey2_handshake.h"
#include "src/main/cpp/include/securegcm/ukey2_handshake.h"

#include <sstream>

#include "securegcm/d2d_crypto_ops.h"
#include "securemessage/public_key_proto_util.h"
#include "src/main/cpp/include/securegcm/d2d_crypto_ops.h"
#include "src/securemessage/include/securemessage/public_key_proto_util.h"

namespace securegcm {

Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/src/securegcm/ukey2_shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <iostream>
#include <memory>

#include "securegcm/ukey2_handshake.h"
#include "src/main/cpp/include/securegcm/ukey2_handshake.h"
#include "absl/container/fixed_array.h"
#include "absl/flags/flag.h"
#include "absl/flags/parse.h"
Expand Down
Loading

0 comments on commit 311ad8d

Please sign in to comment.