-
Notifications
You must be signed in to change notification settings - Fork 466
feat: add openHiTLS backend support #2058
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
Changes from all commits
Commits
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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -119,11 +119,11 @@ set(DTLS_BACKEND | |
| STRING | ||
| "\ | ||
| Name of the dtls backend, only relevant if `ENABLE_DTLS` is ON which is default. \ | ||
| Possible values: default, gnutls, openssl, wolfssl, mbedtls and tinydtls. \ | ||
| Possible values: default, gnutls, openssl, wolfssl, mbedtls, tinydtls and openhitls. \ | ||
| If specified then this library will be searched and if found also used. \ | ||
| If not found then the cmake configuration will stop with an error. \ | ||
| If not specified, then cmake will try to use the first one found in the following order: \ | ||
| gnutls, openssl, wolfssl, mbedtls, tinydtls \ | ||
| gnutls, openssl, wolfssl, mbedtls, tinydtls, openhitls \ | ||
| ") | ||
| set_property( | ||
| CACHE DTLS_BACKEND | ||
|
|
@@ -134,22 +134,24 @@ set_property( | |
| openssl | ||
| wolfssl | ||
| mbedtls | ||
| tinydtls) | ||
| tinydtls | ||
| openhitls) | ||
| set(OSCORE_BACKEND | ||
| "none" | ||
| CACHE | ||
| STRING | ||
| "\ | ||
| Name of the oscore backend, only relevant if `ENABLE_DTLS` is OFF which is not the \ | ||
| default. Possible values: none and mbedtls. \ | ||
| default. Possible values: none, mbedtls and openhitls. \ | ||
| If specified then this library will be searched and if found also used. \ | ||
| If not found then the cmake configuration will stop with an error. \ | ||
| ") | ||
| set_property( | ||
| CACHE OSCORE_BACKEND | ||
| PROPERTY STRINGS | ||
| none | ||
| mbedtls) | ||
| mbedtls | ||
| openhitls) | ||
| option( | ||
| USE_VENDORED_TINYDTLS | ||
| "compile with the tinydtls project in the submodule if on, otherwise try to find the compiled lib with find_package" | ||
|
|
@@ -528,6 +530,8 @@ set(WITH_TINYDTLS OFF) | |
| set(WITH_MBEDTLS OFF) | ||
| set(WITH_MBEDTLS_OSCORE OFF) | ||
| set(WITH_WOLFSSL OFF) | ||
| set(WITH_OPENHITLS OFF) | ||
| set(WITH_OPENHITLS_OSCORE OFF) | ||
|
|
||
| if(ENABLE_DTLS) | ||
| message(STATUS "compiling with DTLS support") | ||
|
|
@@ -616,6 +620,17 @@ if(ENABLE_DTLS) | |
| endif() | ||
| endif() | ||
|
|
||
| if((DTLS_BACKEND STREQUAL "openhitls") OR ((DTLS_BACKEND STREQUAL "default") AND (NOT DTLS_FOUND))) | ||
| # libopenhitls | ||
| find_package(openHiTLS ${DTLS_REQUIRED}) | ||
| if(openHiTLS_FOUND) | ||
| set(WITH_OPENHITLS_OSCORE ON) | ||
| message(STATUS "compiling with openHiTLS support") | ||
| set(COAP_WITH_LIBOPENHITLS 1) | ||
| set(DTLS_FOUND ON) | ||
| endif() | ||
| endif() | ||
|
|
||
|
mrdeep1 marked this conversation as resolved.
|
||
| if(((DTLS_BACKEND STREQUAL "default") OR (DTLS_BACKEND STREQUAL "ignore")) AND (NOT DTLS_FOUND)) | ||
| # no cryto lib found | ||
| message( | ||
|
|
@@ -639,6 +654,17 @@ elseif(NOT ((OSCORE_BACKEND STREQUAL "none") OR (OSCORE_BACKEND STREQUAL ""))) | |
| endif() | ||
| endif() | ||
|
|
||
| if((OSCORE_BACKEND STREQUAL "openhitls") AND (NOT DTLS_FOUND)) | ||
| # libopenhitls | ||
| find_package(openHiTLS REQUIRED) | ||
| if(openHiTLS_FOUND) | ||
| set(WITH_OPENHITLS_OSCORE ON) | ||
| message(STATUS "compiling with openHiTLS OSCORE support") | ||
| set(COAP_WITH_LIBOPENHITLS_OSCORE 1) | ||
| set(DTLS_FOUND ON) | ||
| endif() | ||
| endif() | ||
|
|
||
|
Comment on lines
+657
to
+667
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, add checks |
||
| if((ZEPHYR_BASE) AND (OSCORE_BACKEND STREQUAL "zephyr") AND (NOT DTLS_FOUND)) | ||
| set(WITH_MBEDTLS_OSCORE ON) | ||
| message(STATUS "compiling with mbedtls OSCORE support") | ||
|
|
@@ -721,11 +747,14 @@ message(STATUS "WITH_OPENSSL:....................${WITH_OPENSSL}") | |
| message(STATUS "WITH_WOLFSSL:....................${WITH_WOLFSSL}") | ||
| message(STATUS "WITH_MBEDTLS:....................${WITH_MBEDTLS}") | ||
| message(STATUS "WITH_MBEDTLS_OSCORE:.............${WITH_MBEDTLS_OSCORE}") | ||
| message(STATUS "WITH_OPENHITLS:..................${WITH_OPENHITLS}") | ||
| message(STATUS "WITH_OPENHITLS_OSCORE:...........${WITH_OPENHITLS_OSCORE}") | ||
| message(STATUS "HAVE_LIBTINYDTLS:................${TinyDTLS_VERSION}") | ||
| message(STATUS "HAVE_LIBGNUTLS:..................${GNUTLS_VERSION}") | ||
| message(STATUS "HAVE_LIBOPENSSL:.................${OPENSSL_VERSION}") | ||
| message(STATUS "HAVE_LIBWOLFSSL:.................${wolfssl_VERSION}") | ||
| message(STATUS "HAVE_LIBMBEDTLS:.................${MbedTLS_VERSION}") | ||
| message(STATUS "HAVE_LIBOPENHITLS:...............${openHiTLS_VERSION}") | ||
| message(STATUS "WITH_EPOLL:......................${WITH_EPOLL}") | ||
| message(STATUS "WITH_OBSERVE_PERSIST:............${WITH_OBSERVE_PERSIST}") | ||
| message(STATUS "BUILD_SHARED_LIBS:...............${BUILD_SHARED_LIBS}") | ||
|
|
@@ -809,6 +838,8 @@ target_sources( | |
| $<$<BOOL:${COAP_WITH_LIBGNUTLS}>:${CMAKE_CURRENT_LIST_DIR}/src/coap_gnutls.c> | ||
| $<$<BOOL:${COAP_WITH_LIBMBEDTLS}>:${CMAKE_CURRENT_LIST_DIR}/src/coap_mbedtls.c> | ||
| $<$<BOOL:${COAP_WITH_LIBMBEDTLS_OSCORE}>:${CMAKE_CURRENT_LIST_DIR}/src/coap_mbedtls.c> | ||
| $<$<BOOL:${COAP_WITH_LIBOPENHITLS}>:${CMAKE_CURRENT_LIST_DIR}/src/coap_openhitls.c> | ||
| $<$<BOOL:${COAP_WITH_LIBOPENHITLS_OSCORE}>:${CMAKE_CURRENT_LIST_DIR}/src/coap_openhitls.c> | ||
| # needed for OSCORE if enabled | ||
| $<$<BOOL:${COAP_OSCORE_SUPPORT}>:${CMAKE_CURRENT_LIST_DIR}/src/oscore/oscore.c> | ||
| $<$<BOOL:${COAP_OSCORE_SUPPORT}>:${CMAKE_CURRENT_LIST_DIR}/src/oscore/oscore_cbor.c> | ||
|
|
@@ -856,6 +887,8 @@ target_link_libraries( | |
| $<$<BOOL:${COAP_WITH_LIBMBEDTLS}>:MbedTLS::mbedtls> | ||
| $<$<BOOL:${COAP_WITH_LIBMBEDTLS_OSCORE}>:MbedTLS::mbedtls> | ||
| $<$<BOOL:${COAP_WITH_LIBWOLFSSL}>:wolfssl::wolfssl> | ||
| $<$<BOOL:${COAP_WITH_LIBOPENHITLS}>:openHiTLS::openhitls> | ||
| $<$<BOOL:${COAP_WITH_LIBOPENHITLS_OSCORE}>:openHiTLS::openhitls> | ||
| $<$<BOOL:${WIN32}>:ws2_32> | ||
| $<$<BOOL:${WIN32}>:iphlpapi> | ||
| $<$<BOOL:${MINGW}>:pthread>) | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.