Skip to content

Commit

Permalink
Merge pull request #305 from Aorimn/revert-280-master
Browse files Browse the repository at this point in the history
Revert "fix: Make compatible with macOS 12 Monterey & mbedtls 3"
  • Loading branch information
Aorimn authored Apr 20, 2023
2 parents 1e92c11 + a6d77dc commit 179c51b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,3 @@ Makefile
cmake_install.cmake
cmake_uninstall.cmake
install_manifest.txt

# macOS produced files
*.dylib
*.bundle
4 changes: 2 additions & 2 deletions cmake/FindPolarSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ endif()

if( NOT CMAKE_CROSSCOMPILING )
execute_process(
COMMAND echo "#include <${POLARSSL_INC_FOLDER}/build_info.h>\n#include <stdio.h>\nint main(){printf(${POLARSSL_REAL_NAME}_VERSION_STRING);return 0;}"
COMMAND echo "#include <${POLARSSL_INC_FOLDER}/version.h>\n#include <stdio.h>\nint main(){printf(${POLARSSL_REAL_NAME}_VERSION_STRING);return 0;}"
OUTPUT_FILE a.c
)
execute_process(
Expand All @@ -70,7 +70,7 @@ if( NOT CMAKE_CROSSCOMPILING )
)
else()
execute_process(
COMMAND grep -w "MBEDTLS_VERSION_STRING" ${POLARSSL_INCLUDE_DIRS}/${POLARSSL_INC_FOLDER}/build_info.h
COMMAND grep -w "MBEDTLS_VERSION_STRING" ${POLARSSL_INCLUDE_DIRS}/${POLARSSL_INC_FOLDER}/version.h
COMMAND sed -e "s@\s\+@ @g"
COMMAND cut -d\ -f3
COMMAND sed -e "s@\"@@g"
Expand Down
9 changes: 7 additions & 2 deletions include/dislocker/ssl_bindings.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@
/*
* Here stand the bindings for polarssl SHA256/SHA2/SHA-2 function for dislocker
*/
#include "@POLARSSL_INC_FOLDER@/build_info.h"
#include "@POLARSSL_INC_FOLDER@/config.h"
#include "@POLARSSL_INC_FOLDER@/version.h"
#include "@POLARSSL_INC_FOLDER@/aes.h"

// Function's name changed
#if defined(MBEDTLS_SHA256_C)
# include "mbedtls/sha256.h"
# define SHA256(input, len, output) mbedtls_sha256(input, len, output, 0)
# if MBEDTLS_VERSION_NUMBER >= 0x02070000
# define SHA256(input, len, output) mbedtls_sha256_ret(input, len, output, 0)
# else
# define SHA256(input, len, output) mbedtls_sha256(input, len, output, 0)
# endif /* POLARSSL_VERSION_NUMBER >= 0x02070000 */
#else /* defined(MBEDTLS_SHA256_C) */

# if defined(POLARSSL_SHA256_C)
Expand Down

0 comments on commit 179c51b

Please sign in to comment.