diff options
author | Danilo Egea Gondolfo <danilo@FreeBSD.org> | 2021-01-05 14:10:03 +0000 |
---|---|---|
committer | Danilo Egea Gondolfo <danilo@FreeBSD.org> | 2021-01-05 14:10:03 +0000 |
commit | 398e9c2b2b5c8a41f6d27e0f51e24b08d7a8fcea (patch) | |
tree | 0d11ce9e83c0d8bdb805c1a97d044258b39f6e3e /security/s2n | |
parent | d8af35ddd42ddee139869b8886547c0a232ab1e5 (diff) | |
download | ports-398e9c2b2b5c8a41f6d27e0f51e24b08d7a8fcea.tar.gz ports-398e9c2b2b5c8a41f6d27e0f51e24b08d7a8fcea.zip |
Notes
Diffstat (limited to 'security/s2n')
-rw-r--r-- | security/s2n/Makefile | 20 | ||||
-rw-r--r-- | security/s2n/distinfo | 6 | ||||
-rw-r--r-- | security/s2n/files/patch-CMakeLists.txt | 94 | ||||
-rw-r--r-- | security/s2n/files/patch-cmake_modules_FindLibCrypto.cmake | 11 | ||||
-rw-r--r-- | security/s2n/files/patch-utils_s2n__random.c | 26 | ||||
-rw-r--r-- | security/s2n/pkg-plist | 15 |
6 files changed, 27 insertions, 145 deletions
diff --git a/security/s2n/Makefile b/security/s2n/Makefile index ac4823b2b46f..a73ddd9ffccc 100644 --- a/security/s2n/Makefile +++ b/security/s2n/Makefile @@ -2,7 +2,9 @@ # $FreeBSD$ PORTNAME= s2n -PORTVERSION= 20180802 +PORTVERSION= 0.10.23 +DISTVERSIONPREFIX= v +PORTEPOCH= 1 CATEGORIES= security MAINTAINER= danilo@FreeBSD.org @@ -14,28 +16,16 @@ USES= cmake ssl USE_GITHUB= yes GH_ACCOUNT= awslabs -GH_TAGNAME= 15fa0de OPTIONS_DEFINE= DOCS EXAMPLES TEST USE_LDCONFIG= yes -CFLAGS+= -D__USE_BSD=1 +CMAKE_ARGS+= -DBUILD_SHARED_LIBS=ON SUB_FILES= pkg-message -TEST_CMAKE_BOOL= BUILD_TESTING -TEST_BUILD_DEPENDS= gmake:devel/gmake - -post-patch: - @${REINPLACE_CMD} -e 's|CRYPTO_LDFLAGS |&+|' \ - ${WRKSRC}/tests/testlib/Makefile \ - ${WRKSRC}/tests/unit/Makefile - @${REINPLACE_CMD} -e 's|-ldl||g' ${WRKSRC}/tests/LD_PRELOAD/Makefile \ - ${WRKSRC}/tests/fuzz/LD_PRELOAD/Makefile - post-build-TEST-on: - ${GMAKE} PLATFORM=FreeBSD S2N_DONT_MLOCK=yes \ - CRYPTO_LDFLAGS=-L${LOCALBASE}/lib -C ${WRKSRC}/tests + (cd ${WRKDIR}/.build && ninja test) post-install: ${LN} -s libs2n.so ${STAGEDIR}${LOCALBASE}/lib/libs2n.so.0 diff --git a/security/s2n/distinfo b/security/s2n/distinfo index 667318c74249..2d967bd8da99 100644 --- a/security/s2n/distinfo +++ b/security/s2n/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1533600732 -SHA256 (awslabs-s2n-20180802-15fa0de_GH0.tar.gz) = 0b1a4322c264911650e25a802a84faf8ce4f36534c68c318487c3ae8ba4d09c5 -SIZE (awslabs-s2n-20180802-15fa0de_GH0.tar.gz) = 1342691 +TIMESTAMP = 1609762871 +SHA256 (awslabs-s2n-v0.10.23_GH0.tar.gz) = 0f752e384cfa929da3dcd8f6223b2fe262f937e7cc771ac4c824cd4b33849dd5 +SIZE (awslabs-s2n-v0.10.23_GH0.tar.gz) = 6188649 diff --git a/security/s2n/files/patch-CMakeLists.txt b/security/s2n/files/patch-CMakeLists.txt index d3141b2ee24c..399e74eb7fbc 100644 --- a/security/s2n/files/patch-CMakeLists.txt +++ b/security/s2n/files/patch-CMakeLists.txt @@ -1,89 +1,11 @@ ---- CMakeLists.txt.orig 2018-08-02 17:06:27 UTC +--- CMakeLists.txt.orig 2021-01-05 11:46:44 UTC +++ CMakeLists.txt -@@ -8,6 +8,8 @@ set(INSTALL_LIB_DIR lib CACHE PATH "Installaction dire - set(INSTALL_INCLUDE_DIR include CACHE PATH "installaction directory for header files") - set(INSTALL_CMAKE_DIR lib/cmake CACHE PATH "Installation directory for cmake files") +@@ -177,7 +177,7 @@ set(CMAKE_C_FLAGS_DEBUGOPT "") -+option(BUILD_TESTING "Build tests" ON) -+ - ##header files - file(GLOB API_HEADERS - "api/*.h" -@@ -97,7 +99,7 @@ file(GLOB S2N_HEADERS - ${UTILS_SRC} - ) + target_compile_options(${PROJECT_NAME} PRIVATE -pedantic -std=gnu99 -Wall -Werror -Wimplicit -Wunused -Wcomment -Wchar-subscripts + -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -Wno-deprecated-declarations -Wno-unknown-pragmas -Wformat-security +- -Wno-missing-braces -fvisibility=hidden -DS2N_EXPORTS) ++ -Wno-missing-braces -DS2N_EXPORTS) --add_library(s2n ${S2N_HEADERS} ${S2N_SRC}) -+add_library(s2n SHARED ${S2N_HEADERS} ${S2N_SRC}) - set_target_properties(s2n PROPERTIES LINKER_LANGUAGE C) - - set(CMAKE_C_FLAGS_DEBUGOPT "") -@@ -127,39 +129,41 @@ target_include_directories(s2n PUBLIC $<BUILD_INTERFAC - target_include_directories(s2n PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/api> $<INSTALL_INTERFACE:include>) - target_include_directories(s2n PUBLIC $<TARGET_PROPERTY:LibCrypto::Crypto,INTERFACE_INCLUDE_DIRECTORIES>) - --file(GLOB TESTLIB_SRC "tests/testlib/*.c") --file(GLOB TESTLIB_HEADERS "tests/testlib/*.h") -+if(BUILD_TESTING) -+ file(GLOB TESTLIB_SRC "tests/testlib/*.c") -+ file(GLOB TESTLIB_HEADERS "tests/testlib/*.h") - --add_library(testss2n ${TESTLIB_HEADERS} ${TESTLIB_SRC}) --target_include_directories(testss2n PRIVATE tests) --target_compile_options(testss2n PRIVATE -std=c99) --target_link_libraries(testss2n PUBLIC s2n) -+ add_library(testss2n ${TESTLIB_HEADERS} ${TESTLIB_SRC}) -+ target_include_directories(testss2n PRIVATE tests) -+ target_compile_options(testss2n PRIVATE -std=c99) -+ target_link_libraries(testss2n PUBLIC s2n) - --#run unit tests --file (GLOB TEST_LD_PRELOAD "tests/LD_PRELOAD/*.c") --add_library(allocator_overrides SHARED ${TEST_LD_PRELOAD}) -+ #run unit tests -+ file (GLOB TEST_LD_PRELOAD "tests/LD_PRELOAD/*.c") -+ add_library(allocator_overrides SHARED ${TEST_LD_PRELOAD}) - --include(CTest) --enable_testing() -+ include(CTest) -+ enable_testing() - --file(GLOB UNITTESTS_SRC "tests/unit/*.c") -- foreach(test_case ${UNITTESTS_SRC}) -- string(REGEX REPLACE ".+\\/(.+)\\.c" "\\1" test_case_name ${test_case}) -- add_executable(${test_case_name} ${test_case}) -- target_link_libraries(${test_case_name} PRIVATE testss2n PRIVATE m pthread) -- target_include_directories(${test_case_name} PRIVATE api) -- target_include_directories(${test_case_name} PRIVATE ./) -- target_include_directories(${test_case_name} PRIVATE tests) -- target_compile_options(${test_case_name} PRIVATE -Wno-implicit-function-declaration -std=c99) -- add_test(NAME ${test_case_name} COMMAND $<TARGET_FILE:${test_case_name}> WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/unit) -+ file(GLOB UNITTESTS_SRC "tests/unit/*.c") -+ foreach(test_case ${UNITTESTS_SRC}) -+ string(REGEX REPLACE ".+\\/(.+)\\.c" "\\1" test_case_name ${test_case}) -+ add_executable(${test_case_name} ${test_case}) -+ target_link_libraries(${test_case_name} PRIVATE testss2n PRIVATE m pthread) -+ target_include_directories(${test_case_name} PRIVATE api) -+ target_include_directories(${test_case_name} PRIVATE ./) -+ target_include_directories(${test_case_name} PRIVATE tests) -+ target_compile_options(${test_case_name} PRIVATE -Wno-implicit-function-declaration -std=c99) -+ add_test(NAME ${test_case_name} COMMAND $<TARGET_FILE:${test_case_name}> WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/unit) - -- set_property( -- TEST -- ${test_case_name} -- PROPERTY -- ENVIRONMENT LD_PRELOAD=$<TARGET_FILE:allocator_overrides>) -+ set_property( -+ TEST -+ ${test_case_name} -+ PROPERTY -+ ENVIRONMENT LD_PRELOAD=$<TARGET_FILE:allocator_overrides>) - --endforeach(test_case) -+ endforeach(test_case) -+endif() - - add_executable(s2nc "bin/s2nc.c" "bin/echo.c") - target_link_libraries(s2nc s2n) + if(S2N_NO_PQ) + target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_NO_PQ) diff --git a/security/s2n/files/patch-cmake_modules_FindLibCrypto.cmake b/security/s2n/files/patch-cmake_modules_FindLibCrypto.cmake deleted file mode 100644 index 3cb8990e2f9b..000000000000 --- a/security/s2n/files/patch-cmake_modules_FindLibCrypto.cmake +++ /dev/null @@ -1,11 +0,0 @@ ---- cmake/modules/FindLibCrypto.cmake.orig 2018-06-25 03:06:06 UTC -+++ cmake/modules/FindLibCrypto.cmake -@@ -28,7 +28,7 @@ find_path(LibCrypto_INCLUDE_DIR - ) - - find_library(LibCrypto_LIBRARY -- NAMES libcrypto.a libcrypto.so -+ NAMES libcrypto.so - HINTS ${LibCrypto_ROOT_DIR}/build/crypto - ${LibCrypto_ROOT_DIR}/build - ${LibCrypto_ROOT_DIR} diff --git a/security/s2n/files/patch-utils_s2n__random.c b/security/s2n/files/patch-utils_s2n__random.c deleted file mode 100644 index 0d07b17543f6..000000000000 --- a/security/s2n/files/patch-utils_s2n__random.c +++ /dev/null @@ -1,26 +0,0 @@ ---- utils/s2n_random.c.orig 2018-08-07 15:09:08 UTC -+++ utils/s2n_random.c -@@ -324,8 +324,13 @@ int s2n_get_rdrand_data(struct s2n_blob *out) - int space_remaining = 0; - struct s2n_stuffer stuffer = {{0}}; - union { -- uint64_t u64; -+#if defined(__x86_64__) -+ uint64_t value; - uint8_t u8[8]; -+#else -+ uint32_t value; -+ uint8_t u8[4]; -+#endif - } output; - - GUARD(s2n_stuffer_init(&stuffer, out)); -@@ -334,7 +339,7 @@ int s2n_get_rdrand_data(struct s2n_blob *out) - int success = 0; - - for (int tries = 0; tries < 10; tries++) { -- __asm__ __volatile__(".byte 0x48;\n" ".byte 0x0f;\n" ".byte 0xc7;\n" ".byte 0xf0;\n" "adcl $0x00, %%ebx;\n":"=b"(success), "=a"(output.u64) -+ __asm__ __volatile__(".byte 0x48;\n" ".byte 0x0f;\n" ".byte 0xc7;\n" ".byte 0xf0;\n" "adcl $0x00, %%ebx;\n":"=b"(success), "=a"(output.value) - :"b"(0) - :"cc"); - diff --git a/security/s2n/pkg-plist b/security/s2n/pkg-plist index 0217ab342840..ef33dc4a4b45 100644 --- a/security/s2n/pkg-plist +++ b/security/s2n/pkg-plist @@ -1,13 +1,14 @@ include/s2n.h -lib/cmake/LibCrypto/LibCryptoConfig.cmake -lib/cmake/s2n/s2nConfig.cmake -lib/cmake/s2n/s2nTargets-%%CMAKE_BUILD_TYPE%%.cmake -lib/cmake/s2n/s2nTargets.cmake lib/libs2n.so lib/libs2n.so.0 +lib/s2n/cmake/modules/FindLibCrypto.cmake +lib/s2n/cmake/s2n-config.cmake +lib/s2n/cmake/shared/s2n-targets-release.cmake +lib/s2n/cmake/shared/s2n-targets.cmake %%PORTDOCS%%%%DOCSDIR%%/BINDINGS.md %%PORTDOCS%%%%DOCSDIR%%/DEVELOPMENT-GUIDE.md %%PORTDOCS%%%%DOCSDIR%%/READING-LIST.md +%%PORTDOCS%%%%DOCSDIR%%/STATE-MACHINE.md %%PORTDOCS%%%%DOCSDIR%%/USAGE-GUIDE.md %%PORTDOCS%%%%DOCSDIR%%/images/s2n-logo-final.pdf %%PORTDOCS%%%%DOCSDIR%%/images/s2n-logo-final.svg @@ -16,6 +17,12 @@ lib/libs2n.so.0 %%PORTDOCS%%%%DOCSDIR%%/images/s2n_logo_github.png %%PORTDOCS%%%%DOCSDIR%%/images/s2n_stuffer_layout.png %%PORTDOCS%%%%DOCSDIR%%/images/s2n_tls_layers.png +%%PORTDOCS%%%%DOCSDIR%%/images/scram_example.png +%%PORTDOCS%%%%DOCSDIR%%/images/scram_intro.png +%%PORTDOCS%%%%DOCSDIR%%/images/tls12_state_machine.svg +%%PORTDOCS%%%%DOCSDIR%%/images/tls13_state_machine.svg +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/common.c %%PORTEXAMPLES%%%%EXAMPLESDIR%%/echo.c +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/https.c %%PORTEXAMPLES%%%%EXAMPLESDIR%%/s2nc.c %%PORTEXAMPLES%%%%EXAMPLESDIR%%/s2nd.c |