Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Philippe Auphelle 2012-01-24 14:54:42 +01:00
commit 9bf13012a6
26 changed files with 52 additions and 58 deletions

View File

@ -65,6 +65,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable")
endif() endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release") if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
endif() endif()
if(WITH_SSE2_TARGET) if(WITH_SSE2_TARGET)
@ -139,7 +140,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp.pc DESTINATION ${CMAKE_INSTALL
# Build CUnit # Build CUnit
find_optional_package(CUnit) find_optional_package(CUnit)
if(CUNIT_FOUND) if(WITH_CUNIT)
enable_testing() enable_testing()
add_subdirectory(cunit) add_subdirectory(cunit)
endif() endif()

View File

@ -31,11 +31,11 @@ target_link_libraries(audin freerdp-utils)
install(TARGETS audin DESTINATION ${FREERDP_PLUGIN_PATH}) install(TARGETS audin DESTINATION ${FREERDP_PLUGIN_PATH})
if(ALSA_FOUND) if(WITH_ALSA)
add_subdirectory(alsa) add_subdirectory(alsa)
endif() endif()
if(PULSE_FOUND) if(WITH_PULSEAUDIO)
add_subdirectory(pulse) add_subdirectory(pulse)
endif() endif()

View File

@ -43,15 +43,15 @@ target_link_libraries(tsmf freerdp-utils)
install(TARGETS tsmf DESTINATION ${FREERDP_PLUGIN_PATH}) install(TARGETS tsmf DESTINATION ${FREERDP_PLUGIN_PATH})
if(FFMPEG_FOUND) if(WITH_FFMPEG)
add_subdirectory(ffmpeg) add_subdirectory(ffmpeg)
endif() endif()
if(ALSA_FOUND) if(WITH_ALSA)
add_subdirectory(alsa) add_subdirectory(alsa)
endif() endif()
if(PULSE_FOUND) if(WITH_PULSEAUDIO)
add_subdirectory(pulse) add_subdirectory(pulse)
endif() endif()

View File

@ -42,6 +42,6 @@ add_subdirectory(printer)
add_subdirectory(parallel) add_subdirectory(parallel)
add_subdirectory(serial) add_subdirectory(serial)
if(PCSC_FOUND) if(WITH_PCSC)
add_subdirectory(smartcard) add_subdirectory(smartcard)
endif() endif()

View File

@ -22,13 +22,14 @@ set(PRINTER_SRCS
printer_main.h printer_main.h
) )
if(CUPS_FOUND) if(WITH_CUPS)
set(PRINTER_SRCS set(PRINTER_SRCS
${PRINTER_SRCS} ${PRINTER_SRCS}
printer_cups.c printer_cups.c
printer_cups.h printer_cups.h
) )
include_directories(${CUPS_INCLUDE_DIR}) include_directories(${CUPS_INCLUDE_DIR})
add_definitions(-DWITH_CUPS)
endif() endif()
include_directories(..) include_directories(..)
@ -38,7 +39,7 @@ set_target_properties(printer PROPERTIES PREFIX "")
target_link_libraries(printer freerdp-utils) target_link_libraries(printer freerdp-utils)
if(CUPS_FOUND) if(WITH_CUPS)
target_link_libraries(printer ${CUPS_LIBRARIES}) target_link_libraries(printer ${CUPS_LIBRARIES})
endif() endif()

View File

@ -30,7 +30,7 @@
#include "rdpdr_constants.h" #include "rdpdr_constants.h"
#include "rdpdr_types.h" #include "rdpdr_types.h"
#ifdef CUPS_FOUND #ifdef WITH_CUPS
#include "printer_cups.h" #include "printer_cups.h"
#endif #endif
@ -300,7 +300,7 @@ int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
char* name; char* name;
char* driver_name; char* driver_name;
#ifdef CUPS_FOUND #ifdef WITH_CUPS
driver = printer_cups_get_driver(); driver = printer_cups_get_driver();
#endif #endif
if (driver == NULL) if (driver == NULL)

View File

@ -29,11 +29,11 @@ target_link_libraries(rdpsnd freerdp-utils)
install(TARGETS rdpsnd DESTINATION ${FREERDP_PLUGIN_PATH}) install(TARGETS rdpsnd DESTINATION ${FREERDP_PLUGIN_PATH})
if(ALSA_FOUND) if(WITH_ALSA)
add_subdirectory(alsa) add_subdirectory(alsa)
endif() endif()
if(PULSE_FOUND) if(WITH_PULSEAUDIO)
add_subdirectory(pulse) add_subdirectory(pulse)
endif() endif()

View File

@ -25,13 +25,13 @@ if(NOT WIN32)
# Build X11 Client # Build X11 Client
find_suggested_package(X11) find_suggested_package(X11)
if(X11_FOUND) if(WITH_X11)
add_subdirectory(X11) add_subdirectory(X11)
endif() endif()
# Build DirectFB Client # Build DirectFB Client
find_optional_package(DirectFB) find_optional_package(DirectFB)
if(DIRECTFB_FOUND) if(WITH_DIRECTFB)
add_subdirectory(DirectFB) add_subdirectory(DirectFB)
endif() endif()
else() else()

View File

@ -58,28 +58,28 @@ if(WITH_MANPAGES)
endif(WITH_MANPAGES) endif(WITH_MANPAGES)
find_suggested_package(Xinerama) find_suggested_package(Xinerama)
if(XINERAMA_FOUND) if(WITH_XINERAMA)
add_definitions(-DWITH_XINERAMA -DWITH_XEXT) add_definitions(-DWITH_XINERAMA -DWITH_XEXT)
include_directories(${XINERAMA_INCLUDE_DIRS}) include_directories(${XINERAMA_INCLUDE_DIRS})
target_link_libraries(xfreerdp ${XINERAMA_LIBRARIES}) target_link_libraries(xfreerdp ${XINERAMA_LIBRARIES})
endif() endif()
find_suggested_package(Xext) find_suggested_package(Xext)
if(XEXT_FOUND) if(WITH_XEXT)
add_definitions(-DWITH_XEXT) add_definitions(-DWITH_XEXT)
include_directories(${XEXT_INCLUDE_DIRS}) include_directories(${XEXT_INCLUDE_DIRS})
target_link_libraries(xfreerdp ${XEXT_LIBRARIES}) target_link_libraries(xfreerdp ${XEXT_LIBRARIES})
endif() endif()
find_suggested_package(Xcursor) find_suggested_package(Xcursor)
if(XCURSOR_FOUND) if(WITH_XCURSOR)
add_definitions(-DWITH_XCURSOR) add_definitions(-DWITH_XCURSOR)
include_directories(${XCURSOR_INCLUDE_DIRS}) include_directories(${XCURSOR_INCLUDE_DIRS})
target_link_libraries(xfreerdp ${XCURSOR_LIBRARIES}) target_link_libraries(xfreerdp ${XCURSOR_LIBRARIES})
endif() endif()
find_suggested_package(Xv) find_suggested_package(Xv)
if(XV_FOUND) if(WITH_XV)
add_definitions(-DWITH_XV) add_definitions(-DWITH_XV)
include_directories(${XV_INCLUDE_DIRS}) include_directories(${XV_INCLUDE_DIRS})
target_link_libraries(xfreerdp ${XV_LIBRARIES}) target_link_libraries(xfreerdp ${XV_LIBRARIES})

View File

@ -37,7 +37,7 @@ find_library(CUNIT_LIBRARY NAMES cunit
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CUNIT DEFAULT_MSG CUNIT_LIBRARY CUNIT_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(CUnit DEFAULT_MSG CUNIT_LIBRARY CUNIT_INCLUDE_DIR)
if(CUNIT_FOUND) if(CUNIT_FOUND)
set( CUNIT_LIBRARIES ${CUNIT_LIBRARY} ) set( CUNIT_LIBRARIES ${CUNIT_LIBRARY} )

View File

@ -38,7 +38,7 @@ find_library(DIRECTFB_LIBRARY NAMES directfb
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DIRECTFB DEFAULT_MSG DIRECTFB_LIBRARY DIRECTFB_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectFB DEFAULT_MSG DIRECTFB_LIBRARY DIRECTFB_INCLUDE_DIR)
if(DIRECTFB_FOUND) if(DIRECTFB_FOUND)
set( DIRECTFB_LIBRARIES ${DIRECTFB_LIBRARY} ) set( DIRECTFB_LIBRARIES ${DIRECTFB_LIBRARY} )

View File

@ -1 +1 @@
pkg_check_modules(PULSE libpulse) pkg_check_modules(PULSEAUDIO libpulse)

View File

@ -38,7 +38,7 @@ find_library(XKBFILE_LIBRARY NAMES xkbfile
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XKBFILE DEFAULT_MSG XKBFILE_LIBRARY XKBFILE_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(XKBFile DEFAULT_MSG XKBFILE_LIBRARY XKBFILE_INCLUDE_DIR)
if(XKBFILE_FOUND) if(XKBFILE_FOUND)
set( XKBFILE_LIBRARIES ${XKBFILE_LIBRARY} ) set( XKBFILE_LIBRARIES ${XKBFILE_LIBRARY} )

View File

@ -38,7 +38,7 @@ find_library(XSHM_LIBRARY NAMES Xext
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XSHM DEFAULT_MSG XSHM_LIBRARY XSHM_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(XShm DEFAULT_MSG XSHM_LIBRARY XSHM_INCLUDE_DIR)
if(XSHM_FOUND) if(XSHM_FOUND)
set( XSHM_LIBRARIES ${XSHM_LIBRARY} ) set( XSHM_LIBRARIES ${XSHM_LIBRARY} )

View File

@ -38,7 +38,7 @@ find_library(XTEST_LIBRARY NAMES Xtst
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XTEST DEFAULT_MSG XTEST_LIBRARY XTEST_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(XTest DEFAULT_MSG XTEST_LIBRARY XTEST_INCLUDE_DIR)
if(XTEST_FOUND) if(XTEST_FOUND)
set( XTEST_LIBRARIES ${XTEST_LIBRARY} ) set( XTEST_LIBRARIES ${XTEST_LIBRARY} )

View File

@ -38,7 +38,7 @@ find_library(XCURSOR_LIBRARY NAMES Xcursor
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XCURSOR DEFAULT_MSG XCURSOR_LIBRARY XCURSOR_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xcursor DEFAULT_MSG XCURSOR_LIBRARY XCURSOR_INCLUDE_DIR)
if(XCURSOR_FOUND) if(XCURSOR_FOUND)
set( XCURSOR_LIBRARIES ${XCURSOR_LIBRARY} ) set( XCURSOR_LIBRARIES ${XCURSOR_LIBRARY} )

View File

@ -38,11 +38,12 @@ find_library(XDAMAGE_LIBRARY NAMES Xdamage
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDAMAGE DEFAULT_MSG XDAMAGE_LIBRARY XDAMAGE_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xdamage DEFAULT_MSG XDAMAGE_LIBRARY XDAMAGE_INCLUDE_DIR)
if(XDAMAGE_FOUND) if(XDAMAGE_FOUND)
set( XDAMAGE_LIBRARIES ${XDAMAGE_LIBRARY} ) set( XDAMAGE_LIBRARIES ${XDAMAGE_LIBRARY} )
set( XDAMAGE_INCLUDE_DIRS ${XDAMAGE_INCLUDE_DIR} ) set( XDAMAGE_INCLUDE_DIRS ${XDAMAGE_INCLUDE_DIR} )
endif() endif()
mark_as_advanced(XDAMAGE_INCLUDE_DIR XDAMAGE_LIBRARY) mark_as_advanced(XDAMAGE_INCLUDE_DIR XDAMAGE_LIBRARY)

View File

@ -38,7 +38,7 @@ find_library(XEXT_LIBRARY NAMES Xext
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XEXT DEFAULT_MSG XEXT_LIBRARY XEXT_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xext DEFAULT_MSG XEXT_LIBRARY XEXT_INCLUDE_DIR)
if(XEXT_FOUND) if(XEXT_FOUND)
set( XEXT_LIBRARIES ${XEXT_LIBRARY} ) set( XEXT_LIBRARIES ${XEXT_LIBRARY} )

View File

@ -38,7 +38,7 @@ find_library(XFIXES_LIBRARY NAMES Xfixes
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XFIXES DEFAULT_MSG XFIXES_LIBRARY XFIXES_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xfixes DEFAULT_MSG XFIXES_LIBRARY XFIXES_INCLUDE_DIR)
if(XFIXES_FOUND) if(XFIXES_FOUND)
set( XFIXES_LIBRARIES ${XFIXES_LIBRARY} ) set( XFIXES_LIBRARIES ${XFIXES_LIBRARY} )

View File

@ -38,7 +38,7 @@ find_library(XINERAMA_LIBRARY NAMES Xinerama
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XINERAMA DEFAULT_MSG XINERAMA_LIBRARY XINERAMA_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xinerama DEFAULT_MSG XINERAMA_LIBRARY XINERAMA_INCLUDE_DIR)
if(XINERAMA_FOUND) if(XINERAMA_FOUND)
set( XINERAMA_LIBRARIES ${XINERAMA_LIBRARY} ) set( XINERAMA_LIBRARIES ${XINERAMA_LIBRARY} )

View File

@ -38,7 +38,7 @@ find_library(XV_LIBRARY NAMES Xv
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XV DEFAULT_MSG XV_LIBRARY XV_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xv DEFAULT_MSG XV_LIBRARY XV_INCLUDE_DIR)
if(XV_FOUND) if(XV_FOUND)
set( XV_LIBRARIES ${XV_LIBRARY} ) set( XV_LIBRARIES ${XV_LIBRARY} )

View File

@ -18,9 +18,6 @@
#cmakedefine HAVE_STDBOOL_H #cmakedefine HAVE_STDBOOL_H
#cmakedefine HAVE_INTTYPES_H #cmakedefine HAVE_INTTYPES_H
/* Found packages */
#cmakedefine CUPS_FOUND
/* Endian */ /* Endian */
#cmakedefine BIG_ENDIAN #cmakedefine BIG_ENDIAN
@ -50,5 +47,4 @@
#cmakedefine WITH_DEBUG_REDIR #cmakedefine WITH_DEBUG_REDIR
#cmakedefine WITH_DEBUG_CLIPRDR #cmakedefine WITH_DEBUG_CLIPRDR
#cmakedefine WITH_DEBUG_WND #cmakedefine WITH_DEBUG_WND
#endif #endif

View File

@ -180,7 +180,7 @@ boolean rdp_client_redirect(rdpRdp* rdp)
return rdp_client_connect(rdp); return rdp_client_connect(rdp);
} }
static boolean rdp_establish_keys(rdpRdp* rdp) static boolean rdp_client_establish_keys(rdpRdp* rdp)
{ {
uint8 client_random[32]; uint8 client_random[32];
uint8 crypt_client_random[256 + 8]; uint8 crypt_client_random[256 + 8];
@ -206,17 +206,10 @@ static boolean rdp_establish_keys(rdpRdp* rdp)
crypto_rsa_public_encrypt(client_random, 32, key_len, mod, exp, crypt_client_random); crypto_rsa_public_encrypt(client_random, 32, key_len, mod, exp, crypt_client_random);
/* send crypt client random to server */ /* send crypt client random to server */
length = 7 + 8 + 4 + 4 + key_len + 8; length = RDP_PACKET_HEADER_LENGTH + RDP_SECURITY_HEADER_LENGTH + 4 + key_len + 8;
s = transport_send_stream_init(rdp->mcs->transport, length); s = transport_send_stream_init(rdp->mcs->transport, length);
tpkt_write_header(s, length); rdp_write_header(rdp, s, length, MCS_GLOBAL_CHANNEL_ID);
tpdu_write_header(s, 2, 0xf0); rdp_write_security_header(s, SEC_EXCHANGE_PKT);
per_write_choice(s, DomainMCSPDU_SendDataRequest << 2);
per_write_integer16(s, rdp->mcs->user_id, MCS_BASE_CHANNEL_ID);
per_write_integer16(s, MCS_GLOBAL_CHANNEL_ID, 0);
stream_write_uint8(s, 0x70);
length = (4 + 4 + key_len + 8) | 0x8000;
stream_write_uint16_be(s, length);
stream_write_uint32(s, 1); /* SEC_CLIENT_RANDOM */
length = key_len + 8; length = key_len + 8;
stream_write_uint32(s, length); stream_write_uint32(s, length);
stream_write(s, crypt_client_random, length); stream_write(s, crypt_client_random, length);
@ -335,7 +328,7 @@ boolean rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s)
if (rdp->mcs->user_channel_joined && rdp->mcs->global_channel_joined && all_joined) if (rdp->mcs->user_channel_joined && rdp->mcs->global_channel_joined && all_joined)
{ {
if (!rdp_establish_keys(rdp)) if (!rdp_client_establish_keys(rdp))
return false; return false;
if (!rdp_send_client_info(rdp)) if (!rdp_send_client_info(rdp))
return false; return false;

View File

@ -30,16 +30,18 @@ set(FREERDP_KBD_SRCS
add_library(freerdp-kbd ${FREERDP_KBD_SRCS}) add_library(freerdp-kbd ${FREERDP_KBD_SRCS})
find_suggested_package(X11) find_suggested_package(X11)
if(X11_FOUND) if(WITH_X11)
target_link_libraries(freerdp-kbd ${X11_LIBRARIES}) target_link_libraries(freerdp-kbd ${X11_LIBRARIES})
endif() endif()
if(NOT APPLE) if(NOT APPLE)
find_suggested_package(XKBFile) find_suggested_package(XKBFile)
if(XKBFILE_FOUND) if(WITH_X11)
add_definitions(-DWITH_XKBFILE) if(WITH_XKBFILE)
include_directories(${XKBFILE_INCLUDE_DIRS}) add_definitions(-DWITH_XKBFILE)
target_link_libraries(freerdp-kbd ${XKBFILE_LIBRARIES}) include_directories(${XKBFILE_INCLUDE_DIRS})
target_link_libraries(freerdp-kbd ${XKBFILE_LIBRARIES})
endif()
endif() endif()
endif() endif()

View File

@ -26,7 +26,7 @@ if(NOT WIN32)
# Build X11 Server # Build X11 Server
find_suggested_package(X11) find_suggested_package(X11)
if(X11_FOUND) if(WITH_X11)
add_subdirectory(X11) add_subdirectory(X11)
endif() endif()

View File

@ -25,34 +25,34 @@ add_executable(xfreerdp-server
xfreerdp.c) xfreerdp.c)
find_suggested_package(XShm) find_suggested_package(XShm)
if(XSHM_FOUND) if(WITH_XSHM)
add_definitions(-DWITH_XSHM) add_definitions(-DWITH_XSHM)
include_directories(${XSHM_INCLUDE_DIRS}) include_directories(${XSHM_INCLUDE_DIRS})
endif() endif()
find_suggested_package(Xext) find_suggested_package(Xext)
if(XEXT_FOUND) if(WITH_XEXT)
add_definitions(-DWITH_XEXT) add_definitions(-DWITH_XEXT)
include_directories(${XEXT_INCLUDE_DIRS}) include_directories(${XEXT_INCLUDE_DIRS})
target_link_libraries(xfreerdp-server ${XEXT_LIBRARIES}) target_link_libraries(xfreerdp-server ${XEXT_LIBRARIES})
endif() endif()
find_suggested_package(Xdamage) find_suggested_package(Xdamage)
if(XDAMAGE_FOUND) if(WITH_XDAMAGE)
add_definitions(-DWITH_XDAMAGE) add_definitions(-DWITH_XDAMAGE)
include_directories(${XDAMAGE_INCLUDE_DIRS}) include_directories(${XDAMAGE_INCLUDE_DIRS})
target_link_libraries(xfreerdp-server ${XDAMAGE_LIBRARIES}) target_link_libraries(xfreerdp-server ${XDAMAGE_LIBRARIES})
endif() endif()
find_suggested_package(Xfixes) find_suggested_package(Xfixes)
if(XFIXES_FOUND) if(WITH_XFIXES)
add_definitions(-DWITH_XFIXES) add_definitions(-DWITH_XFIXES)
include_directories(${XFIXES_INCLUDE_DIRS}) include_directories(${XFIXES_INCLUDE_DIRS})
target_link_libraries(xfreerdp-server ${XFIXES_LIBRARIES}) target_link_libraries(xfreerdp-server ${XFIXES_LIBRARIES})
endif() endif()
find_suggested_package(XTest) find_suggested_package(XTest)
if(XTEST_FOUND) if(WITH_XTEST)
add_definitions(-DWITH_XTEST) add_definitions(-DWITH_XTEST)
include_directories(${XTEST_INCLUDE_DIRS}) include_directories(${XTEST_INCLUDE_DIRS})
target_link_libraries(xfreerdp-server ${XTEST_LIBRARIES}) target_link_libraries(xfreerdp-server ${XTEST_LIBRARIES})