-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace OpenSSL dependency with pinned BoringSSL #1599
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2ff2b9c
replace openssl with boringssl
spoonincode 636117f
warning fixes
spoonincode fffa8f9
add generated boringssl files
spoonincode b832c7e
use data_size() for sha256 length
spoonincode e2be85a
prevent anything from find_package(OpenSSL)ing
spoonincode d755b72
Merge remote-tracking branch 'origin/main' into HEAD
spoonincode f409cc7
Merge remote-tracking branch 'origin/main' into HEAD
spoonincode 9979695
replace committed boringssl files with boringssl-build submodule
spoonincode 705fd14
use fc::rand_bytes
spoonincode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,15 +54,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS "ON") | |
set(BUILD_DOXYGEN FALSE CACHE BOOL "Build doxygen documentation on every make") | ||
set(ENABLE_MULTIVERSION_PROTOCOL_TEST FALSE CACHE BOOL "Enable nodeos multiversion protocol test") | ||
|
||
# add defaults for openssl | ||
if(APPLE AND UNIX AND "${OPENSSL_ROOT_DIR}" STREQUAL "") | ||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") | ||
set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl@3;/opt/homebrew/opt/[email protected]") | ||
else() | ||
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl@3;/usr/local/opt/[email protected]") | ||
endif() | ||
endif() | ||
|
||
option(ENABLE_OC "Enable eosvm-oc on supported platforms" ON) | ||
|
||
# WASM runtimes to enable. Each runtime in this list will have: | ||
|
@@ -226,6 +217,7 @@ configure_file(libraries/eos-vm/LICENSE licen | |
configure_file(libraries/prometheus/prometheus-cpp/LICENSE licenses/leap/LICENSE.prom COPYONLY) | ||
configure_file(programs/cleos/LICENSE.CLI11 licenses/leap/LICENSE.CLI11 COPYONLY) | ||
configure_file(libraries/libfc/libraries/bls12-381/LICENSE licenses/leap/LICENSE.bls12-381 COPYONLY) | ||
configure_file(libraries/libfc/libraries/boringssl/boringssl/src/LICENSE licenses/leap/LICENSE.boringssl COPYONLY) | ||
|
||
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/licenses/leap" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/" COMPONENT base) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ pkg update && pkg install \ | |
curl \ | ||
boost-all \ | ||
python3 \ | ||
openssl \ | ||
llvm11 \ | ||
pkgconf | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
find_package(Python COMPONENTS Interpreter) | ||
add_custom_target(regenerate_boringssl COMMAND "${Python_EXECUTABLE}" src/util/generate_build_files.py cmake WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/boringssl") | ||
|
||
#avoid erroring out the cmake project generation when boringssl's generated files do not exist. The overall build would still fail, of | ||
# course, but the 'regenerate_boringssl' target still will be alive to use | ||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/boringssl/CMakeLists.txt") | ||
return() | ||
endif() | ||
|
||
add_subdirectory(boringssl EXCLUDE_FROM_ALL) | ||
target_compile_options(fipsmodule PRIVATE -Wno-error) | ||
target_compile_options(crypto PRIVATE -Wno-error) | ||
target_compile_options(decrepit PRIVATE -Wno-error) | ||
|
||
#paranoia for when a dependent library depends on openssl (such as libcurl) | ||
set_target_properties(fipsmodule PROPERTIES C_VISIBILITY_PRESET hidden) | ||
set_target_properties(crypto PROPERTIES C_VISIBILITY_PRESET hidden) | ||
set_target_properties(decrepit PROPERTIES C_VISIBILITY_PRESET hidden) | ||
|
||
add_library(boringssl INTERFACE) | ||
target_link_libraries(boringssl INTERFACE crypto decrepit) | ||
target_include_directories(boringssl INTERFACE boringssl/src/include) | ||
|
||
# avoid conflict with system lib | ||
set_target_properties(crypto PROPERTIES PREFIX libbs) | ||
|
||
install( TARGETS crypto | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL | ||
) | ||
|
||
install( TARGETS decrepit | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL | ||
) | ||
|
||
install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/boringssl/src/include/" DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/leapboringssl" COMPONENT dev EXCLUDE_FROM_ALL ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something we'll need to be mindful of on boost bumps (or really any bundled dependency).