Skip to content

Update to June 2022 release of boringssl. #1362

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

Merged
merged 4 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ if(DESKTOP)

if(FIREBASE_USE_BORINGSSL)
# Use BoringSSL instead of OpenSSL.
set(BORINGSSL_ROOT_DIR ${PROJECT_BINARY_DIR}/external/src/boringssl/src CACHE STRING "" FORCE)
set(BORINGSSL_ROOT_DIR ${PROJECT_BINARY_DIR}/external/src/boringssl CACHE STRING "" FORCE)
set(BORINGSSL_BINARY_DIR ${PROJECT_BINARY_DIR}/external/src/boringssl-build CACHE STRING "" FORCE)
set(OPENSSL_ROOT_DIR ${BORINGSSL_ROOT_DIR} CACHE STRING "" FORCE)

Expand Down
5 changes: 2 additions & 3 deletions cmake/external/boringssl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ if(TARGET boringssl OR NOT DOWNLOAD_BORINGSSL)
return()
endif()

set(patch_file
${CMAKE_CURRENT_LIST_DIR}/../../scripts/git/patches/boringssl/0001-disable-warnings.patch)
set(patch_file ${CMAKE_CURRENT_LIST_DIR}/../../scripts/git/patches/boringssl/0001-disable-warnings.patch)

set(boringssl_commit_tag 83da28a68f32023fd3b95a8ae94991a07b1f6c62)
set(boringssl_commit_tag fips-20220613)

ExternalProject_Add(
boringssl
Expand Down
10 changes: 5 additions & 5 deletions cmake/external_rules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ function(download_external_sources)
if (FIREBASE_USE_BORINGSSL)
# CMake's find_package(OpenSSL) doesn't quite work right with BoringSSL
# unless the header file contains OPENSSL_VERSION_NUMBER.
file(READ ${PROJECT_BINARY_DIR}/external/src/boringssl/src/include/openssl/opensslv.h TMP_HEADER_CONTENTS)
file(READ ${PROJECT_BINARY_DIR}/external/src/boringssl/include/openssl/opensslv.h TMP_HEADER_CONTENTS)
if (NOT TMP_HEADER_CONTENTS MATCHES OPENSSL_VERSION_NUMBER)
file(APPEND ${PROJECT_BINARY_DIR}/external/src/boringssl/src/include/openssl/opensslv.h
file(APPEND ${PROJECT_BINARY_DIR}/external/src/boringssl/include/openssl/opensslv.h
"\n#ifndef OPENSSL_VERSION_NUMBER\n# define OPENSSL_VERSION_NUMBER 0x10010107L\n#endif\n")
endif()
# Also add an #include <stdlib.h> since openssl has it and boringssl
# doesn't, and some of our code depends on the transitive dependency (this
# is a bug).
file(READ ${PROJECT_BINARY_DIR}/external/src/boringssl/src/include/openssl/rand.h TMP_HEADER2_CONTENTS)
file(READ ${PROJECT_BINARY_DIR}/external/src/boringssl/include/openssl/rand.h TMP_HEADER2_CONTENTS)
if (NOT TMP_HEADER2_CONTENTS MATCHES "<stdlib.h>")
file(APPEND ${PROJECT_BINARY_DIR}/external/src/boringssl/src/include/openssl/rand.h
file(APPEND ${PROJECT_BINARY_DIR}/external/src/boringssl/include/openssl/rand.h
"\n#include <stdlib.h>\n")
endif()
endif()
Expand Down Expand Up @@ -241,7 +241,7 @@ function(build_external_dependencies)
if(NOT ANDROID AND NOT IOS)
if (FIREBASE_USE_BORINGSSL)
execute_process(
COMMAND ${ENV_COMMAND} cmake -DOPENSSL_NO_ASM=TRUE ${CMAKE_SUB_CONFIGURE_OPTIONS} ../boringssl/src
COMMAND ${ENV_COMMAND} cmake -DOPENSSL_NO_ASM=TRUE ${CMAKE_SUB_CONFIGURE_OPTIONS} ../boringssl
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external/src/boringssl-build
RESULT_VARIABLE boringssl_configure_status
)
Expand Down
6 changes: 3 additions & 3 deletions scripts/git/patches/boringssl/0001-disable-warnings.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -193,6 +193,11 @@ elseif(MSVC)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -197,6 +197,11 @@ elseif(MSVC)
# possible loss of data
"C4244" # 'function' : conversion from 'int' to 'uint8_t',
# possible loss of data
Expand Down