-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hmac,md5,sha: add mbedtls backend (#871)
* hmac,md5,sha: add mbedtls backend * cmake: MBEDTLS - use uppercase letters for find_package variables * tls: add a stub for USE_OPENSSL=no * cmake: decide between openssl and mbedtls
- Loading branch information
Showing
7 changed files
with
571 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -535,6 +535,7 @@ else() | |
list(APPEND SRCS | ||
src/aes/stub.c | ||
src/hmac/hmac.c | ||
src/tls/stub.c | ||
) | ||
endif() | ||
|
||
|
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,30 @@ | ||
find_path(MBEDTLS_INCLUDE_DIR | ||
NAMES mbedtls/ssl.h mbedtls/md.h mbedtls/md5.h mbedtls/error.h | ||
mbedtls/sha1.h mbedtls/sha256.h | ||
HINTS | ||
"${MBEDTLS_INCLUDE_DIRS}" | ||
"${MBEDTLS_HINTS}/include" | ||
PATHS /usr/local/include /usr/include | ||
) | ||
|
||
find_library(MBEDTLS_LIBRARY | ||
NAMES mbedtls mbedx509 mbedcrypto | ||
HINTS | ||
"${MBEDTLS_LIBRARY_DIRS}" | ||
"${MBEDTLS_HINTS}/lib" | ||
PATHS /usr/local/lib /usr/lib | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(MBEDTLS DEFAULT_MSG | ||
MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY) | ||
|
||
if(MBEDTLS_FOUND) | ||
set( MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR} ) | ||
set( MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ) | ||
else() | ||
set( MBEDTLS_INCLUDE_DIRS ) | ||
set( MBEDTLS_LIBRARIES ) | ||
endif() | ||
|
||
mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARIES) |
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
Oops, something went wrong.