Skip to content

Commit

Permalink
[MBEDTLS] Use mbedtls as a lightweight schannel TLS/SSL back-end. Thi…
Browse files Browse the repository at this point in the history
…s is an initial checkpoint and more will follow in due time. Brought to you by Peter Hater, Ismael Ferreras Morezuelas, Sebastian Lackner and Michael Müller. CORE-9065

svn path=/trunk/; revision=69394
  • Loading branch information
AmineKhaldi committed Sep 28, 2015
1 parent 79dd485 commit af1f741
Show file tree
Hide file tree
Showing 10 changed files with 1,082 additions and 37 deletions.
3 changes: 1 addition & 2 deletions reactos/dll/3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ add_subdirectory(libjpeg)
add_subdirectory(libpng)
add_subdirectory(libtiff)
add_subdirectory(libxslt)
# FIXME CORE-9065
#add_subdirectory(mbedtls)
add_subdirectory(mbedtls)
9 changes: 7 additions & 2 deletions reactos/dll/3rdparty/mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

spec2def(mbedtls.dll mbedtls.spec ADD_IMPORTLIB)

include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/mbedtls
${REACTOS_SOURCE_DIR}/include/reactos/zlib)

Expand Down Expand Up @@ -71,7 +74,10 @@ list(APPEND src
x509write_csr.c
xtea.c)

add_library(mbedtls SHARED ${src})
add_library(mbedtls SHARED
${src}
${CMAKE_CURRENT_BINARY_DIR}/mbedtls.def)

set_module_type(mbedtls win32dll)
target_link_libraries(mbedtls zlib)
add_importlibs(mbedtls advapi32 ws2_32 msvcrt kernel32)
Expand All @@ -87,4 +93,3 @@ if(NOT MSVC)
add_target_compile_flags(mbedtls "-Wno-unused-but-set-variable")
endif()
endif()

22 changes: 22 additions & 0 deletions reactos/dll/3rdparty/mbedtls/mbedtls.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@ cdecl ctr_drbg_free(ptr)
@ cdecl ctr_drbg_init(ptr ptr ptr str long)
@ cdecl ctr_drbg_random(ptr str long)
@ cdecl entropy_free(ptr)
@ cdecl entropy_func(ptr str long)
@ cdecl entropy_init(ptr)
@ cdecl ssl_ciphersuite_from_id(long)
@ cdecl ssl_free(ptr)
@ cdecl ssl_get_ciphersuite(ptr)
@ cdecl ssl_get_ciphersuite_id(ptr)
@ cdecl ssl_get_version(ptr)
@ cdecl ssl_handshake(ptr)
@ cdecl ssl_init(ptr)
@ cdecl ssl_read(ptr ptr long)
@ cdecl ssl_set_authmode(ptr long)
@ cdecl ssl_set_bio(ptr ptr ptr ptr)
@ cdecl ssl_set_endpoint(ptr long)
@ cdecl ssl_set_hostname(ptr str)
@ cdecl ssl_set_max_version(ptr long long)
@ cdecl ssl_set_min_version(ptr long long)
@ cdecl ssl_set_rng(ptr ptr ptr)
@ cdecl ssl_write(ptr ptr ptr)
6 changes: 3 additions & 3 deletions reactos/dll/win32/schannel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

include_directories(
${REACTOS_SOURCE_DIR}/include/reactos/wine
${REACTOS_SOURCE_DIR}/include/reactos/libs/gnutls)
${REACTOS_SOURCE_DIR}/include/reactos/libs/mbedtls)


add_definitions(-D__WINESRC__ -D_WINE)
spec2def(schannel.dll schannel.spec)

list(APPEND SOURCE
lsamode.c
schannel_gnutls.c
schannel_mbedtls.c
schannel_main.c
schannel_wine.c
secur32_wine.c
Expand All @@ -25,6 +25,6 @@ add_library(schannel SHARED

set_module_type(schannel win32dll)
target_link_libraries(schannel wine)
add_importlibs(schannel crypt32 secur32 advapi32 msvcrt kernel32 ntdll)
add_importlibs(schannel mbedtls crypt32 secur32 advapi32 msvcrt kernel32 ntdll)
add_pch(schannel precomp.h SOURCE)
add_cd_file(TARGET schannel DESTINATION reactos/system32 FOR all)
4 changes: 2 additions & 2 deletions reactos/dll/win32/schannel/schannel_gnutls.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define __wine_dbch_secur32 __wine_dbch_schannel

#if defined(SONAME_LIBGNUTLS) && !defined(HAVE_SECURITY_SECURITY_H)
#if defined(SONAME_LIBGNUTLS) && !defined(HAVE_SECURITY_SECURITY_H) && !defined(SONAME_LIBMBEDTLS)

static void *libgnutls_handle;

Expand Down Expand Up @@ -602,4 +602,4 @@ void schan_imp_deinit(void)
libgnutls_handle = NULL;
}

#endif /* SONAME_LIBGNUTLS && !HAVE_SECURITY_SECURITY_H */
#endif /* SONAME_LIBGNUTLS && !HAVE_SECURITY_SECURITY_H && !SONAME_LIBMBEDTLS */
Loading

0 comments on commit af1f741

Please sign in to comment.