Skip to content

Commit

Permalink
Review comments addressed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj committed May 26, 2022
1 parent 4884971 commit e37bb31
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 56 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
script -q -e -c "make pull"
sudo df -h
script -q -e -c "CONCORD_BFT_CMAKE_OMIT_TEST_OUTPUT=TRUE CONCORD_BFT_CMAKE_KEEP_APOLLO_LOGS=FALSE CONCORD_BFT_CMAKE_ASAN=TRUE CONCORD_BFT_CMAKE_USE_FAKE_CLOCK_IN_TIME_SERVICE=TRUE \
CONCORD_BFT_CMAKE_USE_CRYPTOPP_SHA_256=FALSE \
CONCORD_BFT_CMAKE_USE_OPENSSL_SHA_256=FALSE \
CONCORD_BFT_CMAKE_USE_OPENSSL_SHA3_256=TRUE \
make build" \
&& script -q -e -c "make test"
- name: Check if ASAN passed
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/build_and_test_clang_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@ jobs:
-DUSE_OPENTRACING=ON \
-DOMIT_TEST_OUTPUT=OFF\
-DKEEP_APOLLO_LOGS=TRUE\
-DUSE_OPENSSL_SHA3_256=TRUE\
-DUSE_FAKE_CLOCK_IN_TIME_SERVICE=TRUE\" "\
&& script -q -e -c "make test"
# Use below macros if CryptoPP SHA_256 and OpenSSL SHA_256 hashing are required.
# -DUSE_CRYPTOPP_SHA_256=FALSE
# -DUSE_OPENSSL_SHA_256=FALSE

- name: Prepare artifacts
if: failure()
run: |
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/build_and_test_clang_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,8 @@ jobs:
-DUSE_OPENTRACING=ON \
-DOMIT_TEST_OUTPUT=OFF\
-DKEEP_APOLLO_LOGS=TRUE\
-DUSE_OPENSSL_SHA3_256=TRUE\
-DUSE_FAKE_CLOCK_IN_TIME_SERVICE=TRUE\" "\
&& script -q -e -c "make test"
# Use below macros if CryptoPP SHA_256 and OpenSSL SHA_256 hashing are required.
# -DUSE_CRYPTOPP_SHA_256=FALSE
# -DUSE_OPENSSL_SHA_256=FALSE

- name: Prepare artifacts
if: failure()
run: |
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/build_and_test_gcc_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@ jobs:
-DOMIT_TEST_OUTPUT=OFF\
-DKEEP_APOLLO_LOGS=TRUE\
-DRUN_APOLLO_TESTS=FALSE\
-DUSE_OPENSSL_SHA3_256=TRUE\
-DUSE_FAKE_CLOCK_IN_TIME_SERVICE=TRUE\" "\
&& script -q -e -c "make test"
# Use below macros if CryptoPP SHA_256 and OpenSSL SHA_256 hashing are required.
# -DUSE_CRYPTOPP_SHA_256=FALSE
# -DUSE_OPENSSL_SHA_256=FALSE

- name: Prepare artifacts
if: failure()
run: |
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/build_and_test_gcc_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@ jobs:
-DOMIT_TEST_OUTPUT=OFF\
-DKEEP_APOLLO_LOGS=TRUE\
-DRUN_APOLLO_TESTS=FALSE\
-DUSE_OPENSSL_SHA3_256=TRUE\
-DUSE_FAKE_CLOCK_IN_TIME_SERVICE=TRUE\" "\
&& script -q -e -c "make test"
# Use below macros if CryptoPP SHA_256 and OpenSSL SHA_256 hashing are required.
# -DUSE_CRYPTOPP_SHA_256=FALSE
# -DUSE_OPENSSL_SHA_256=FALSE

- name: Prepare artifacts
if: failure()
run: |
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ jobs:
-DUSE_S3_OBJECT_STORE=TRUE \
-DUSE_OPENTRACING=ON \
-DOMIT_TEST_OUTPUT=OFF\
-DUSE_OPENSSL_SHA3_256=TRUE\
-DUSE_FAKE_CLOCK_IN_TIME_SERVICE=TRUE\" "\
# Use below macros if CryptoPP SHA_256 and OpenSSL SHA_256 hashing are required.
# -DUSE_CRYPTOPP_SHA_256=FALSE
# -DUSE_OPENSSL_SHA_256=FALSE

- name: Print failure info
if: failure()
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ jobs:
sudo df -h
script -q -e -c "CONCORD_BFT_CONTAINER_CC=clang CONCORD_BFT_CONTAINER_CXX=clang++ \
CONCORD_BFT_CMAKE_CODECOVERAGE=TRUE CONCORD_BFT_CMAKE_TRANSPORT=UDP \
CONCORD_BFT_CMAKE_USE_CRYPTOPP_SHA_256=FALSE \
CONCORD_BFT_CMAKE_USE_OPENSSL_SHA_256=FALSE \
CONCORD_BFT_CMAKE_USE_OPENSSL_SHA3_256=TRUE \
make build" && script -q -e -c "make test"
continue-on-error: true

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
script -q -e -c "make pull"
sudo df -h
script -q -e -c "CONCORD_BFT_CMAKE_OMIT_TEST_OUTPUT=TRUE CONCORD_BFT_CMAKE_KEEP_APOLLO_LOGS=FALSE CONCORD_BFT_CMAKE_TSAN=TRUE CONCORD_BFT_CMAKE_USE_FAKE_CLOCK_IN_TIME_SERVICE=TRUE \
CONCORD_BFT_CMAKE_USE_CRYPTOPP_SHA_256=FALSE \
CONCORD_BFT_CMAKE_USE_OPENSSL_SHA_256=FALSE \
CONCORD_BFT_CMAKE_USE_OPENSSL_SHA3_256=TRUE \
make build" \
&& script -q -e -c "make test"
- name: Check if TSAN passed
Expand Down
13 changes: 0 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,6 @@ if(CODECOVERAGE)
message( "-- Building with llvm Code Coverage Tools")
endif()

if(USE_CRYPTOPP_SHA_256)
message("-- USE_CRYPTOPP_SHA_256 Enabled")
string(APPEND CMAKE_CXX_FLAGS " -DUSE_CRYPTOPP_SHA_256")
elseif(USE_OPENSSL_SHA_256)
message("-- USE_OPENSSL_SHA_256 Enabled")
string(APPEND CMAKE_CXX_FLAGS " -DUSE_OPENSSL_SHA_256")
elseif(USE_OPENSSL_SHA3_256)
message("-- USE_OPENSSL_SHA3_256 Enabled")
string(APPEND CMAKE_CXX_FLAGS " -DUSE_OPENSSL_SHA3_256")
else()
message(FATAL_ERROR "None of the cryptographic hashing libraries are enabled.")
endif()

if(USE_S3_OBJECT_STORE)
add_compile_definitions(USE_S3_OBJECT_STORE=1)
endif()
Expand Down
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ CONCORD_BFT_CMAKE_TSAN?=FALSE
CONCORD_BFT_CMAKE_CODECOVERAGE?=FALSE
CONCORD_BFT_CMAKE_USE_FAKE_CLOCK_IN_TIME_SERVICE?=FALSE
ENABLE_RESTART_RECOVERY_TESTS?=FALSE
CONCORD_BFT_CMAKE_USE_CRYPTOPP_SHA_256?=FALSE
CONCORD_BFT_CMAKE_USE_OPENSSL_SHA_256?=FALSE
CONCORD_BFT_CMAKE_USE_OPENSSL_SHA3_256?=TRUE

ifeq (${CONCORD_BFT_CMAKE_ASAN},TRUE)
CONCORD_BFT_CMAKE_CXX_FLAGS_RELEASE='-O0 -g'
Expand Down Expand Up @@ -94,10 +91,7 @@ CONCORD_BFT_CMAKE_FLAGS?= \
-DTHREADCHECK=${CONCORD_BFT_CMAKE_TSAN} \
-DCODECOVERAGE=${CONCORD_BFT_CMAKE_CODECOVERAGE} \
-DTXN_SIGNING_ENABLED=${CONCORD_BFT_CMAKE_TRANSACTION_SIGNING_ENABLED} \
-DENABLE_RESTART_RECOVERY_TESTS=${ENABLE_RESTART_RECOVERY_TESTS} \
-DUSE_OPENSSL_SHA_256=${CONCORD_BFT_CMAKE_USE_OPENSSL_SHA_256} \
-DUSE_OPENSSL_SHA3_256=${CONCORD_BFT_CMAKE_USE_OPENSSL_SHA3_256} \
-DUSE_CRYPTOPP_SHA_256=${CONCORD_BFT_CMAKE_USE_CRYPTOPP_SHA_256}
-DENABLE_RESTART_RECOVERY_TESTS=${ENABLE_RESTART_RECOVERY_TESTS}

# The consistency parameter makes sense only at MacOS.
# It is ignored at all other platforms.
Expand Down
6 changes: 6 additions & 0 deletions util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ set(util_source_files
add_library(util STATIC ${util_source_files})
add_library(util_shared SHARED ${util_source_files})

# Use below macros to use CryptoPP's SHA_256 or OpenSSL's SHA_256 hashing.
# USE_CRYPTOPP_SHA_256=FALSE
# USE_OPENSSL_SHA_256=FALSE
target_compile_definitions(util PUBLIC USE_OPENSSL_SHA3_256)
target_compile_definitions(util_shared PUBLIC USE_OPENSSL_SHA3_256)

if(USE_OPENSSL)
if(NOT BUILD_THIRDPARTY)
find_package(OpenSSL REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion util/include/digest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "digest_type.hpp"
#include "digest_holder.hpp"
#include "cryptopp_digest_creator.hpp"
#include "openssl_digest_creator.ipp"
#include "openssl_digest_creator.hpp"

namespace concord::util::digest {

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion util/test/openssl_digest_creator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "gtest/gtest.h"
#include "hex_tools.h"
#include "sha_hash.hpp"
#include "openssl_digest_creator.ipp"
#include "openssl_digest_creator.hpp"

using concord::util::SHA2_256;
using concord::util::SHA3_256;
Expand Down

0 comments on commit e37bb31

Please sign in to comment.