No deprecated (#7107)

* Removed cmake options disabling compiler warnings

* Added deprecation compile options

* Fixed android client use of deprecated symbols

* Removed obsolete callback
This commit is contained in:
akallabeth 2021-06-22 14:39:10 +02:00 committed by GitHub
parent 8e3997b294
commit 534d30beb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 170 additions and 91 deletions

View File

@ -108,6 +108,11 @@ message("FREERDP_VERSION=${FREERDP_VERSION_FULL}")
set(FREERDP_INCLUDE_DIR "include/freerdp${FREERDP_VERSION_MAJOR}/")
option(WITH_FREERDP_DEPRECATED "Build FreeRDP deprecated symbols" OFF)
if (WITH_FREERDP_DEPRECATED)
add_definitions(-DWITH_FREERDP_DEPRECATED)
endif()
# Compatibility options
if(DEFINED STATIC_CHANNELS)
message(WARNING "STATIC_CHANNELS is obsolete, please use BUILTIN_CHANNELS instead")
@ -248,29 +253,10 @@ if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
CHECK_C_COMPILER_FLAG (-Wno-unused-result Wno-unused-result)
if(Wno-unused-result)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result")
endif()
CHECK_C_COMPILER_FLAG (-Wno-unused-but-set-variable Wno-unused-but-set-variable)
if(Wno-unused-but-set-variable)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable")
endif()
CHECK_C_COMPILER_FLAG(-Wno-deprecated-declarations Wno-deprecated-declarations)
if(Wno-deprecated-declarations)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
endif()
if(NOT EXPORT_ALL_SYMBOLS)
message(STATUS "GCC default symbol visibility: hidden")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
endif()
if(BUILD_TESTING)
CHECK_C_COMPILER_FLAG(-Wno-format Wno-format)
if(Wno-format)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format")
endif()
endif()
CHECK_C_COMPILER_FLAG (-Wimplicit-function-declaration Wimplicit-function-declaration)
if(Wimplicit-function-declaration)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wimplicit-function-declaration")
@ -302,14 +288,7 @@ if (CMAKE_GENERATOR MATCHES "Unix Makefile*")
endif()
if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-macros -Wno-padded")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-c11-extensions -Wno-gnu")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument")
CHECK_C_COMPILER_FLAG(-Wno-deprecated-declarations Wno-deprecated-declarations)
if(Wno-deprecated-declarations)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
endif()
endif()
set(THREAD_PREFER_PTHREAD_FLAG TRUE)

View File

@ -957,8 +957,8 @@ public class SessionActivity extends AppCompatActivity
}
@Override
public int OnVerifiyCertificate(String commonName, String subject, String issuer,
String fingerprint, boolean mismatch)
public int OnVerifiyCertificateEx(String host, long port, String commonName, String subject,
String issuer, String fingerprint, long flags)
{
// see if global settings says accept all
if (ApplicationSettingsActivity.getAcceptAllCertificates(this))
@ -969,8 +969,19 @@ public class SessionActivity extends AppCompatActivity
// set message
String msg = getResources().getString(R.string.dlg_msg_verify_certificate);
msg = msg + "\n\nSubject: " + subject + "\nIssuer: " + issuer +
"\nFingerprint: " + fingerprint;
String type = "RDP-Server";
if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_GATEWAY) != 0)
type = "RDP-Gateway";
if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_REDIRECT) != 0)
type = "RDP-Redirect";
msg += "\n\n" + type + ": " + host + ":" + port;
msg += "\n\nSubject: " + subject + "\nIssuer: " + issuer;
if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_FP_IS_PEM) != 0)
msg += "\nCertificate: " + fingerprint;
else
msg += "\nFingerprint: " + fingerprint;
dlgVerifyCertificate.setMessage(msg);
// start dialog in UI thread
@ -992,9 +1003,10 @@ public class SessionActivity extends AppCompatActivity
}
@Override
public int OnVerifyChangedCertificate(String commonName, String subject, String issuer,
String fingerprint, String oldSubject, String oldIssuer,
String oldFingerprint)
public int OnVerifyChangedCertificateEx(String host, long port, String commonName,
String subject, String issuer, String fingerprint,
String oldSubject, String oldIssuer,
String oldFingerprint, long flags)
{
// see if global settings says accept all
if (ApplicationSettingsActivity.getAcceptAllCertificates(this))
@ -1005,8 +1017,17 @@ public class SessionActivity extends AppCompatActivity
// set message
String msg = getResources().getString(R.string.dlg_msg_verify_certificate);
msg = msg + "\n\nSubject: " + subject + "\nIssuer: " + issuer +
"\nFingerprint: " + fingerprint;
String type = "RDP-Server";
if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_GATEWAY) != 0)
type = "RDP-Gateway";
if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_REDIRECT) != 0)
type = "RDP-Redirect";
msg += "\n\n" + type + ": " + host + ":" + port;
msg += "\n\nSubject: " + subject + "\nIssuer: " + issuer;
if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_FP_IS_PEM) != 0)
msg += "\nCertificate: " + fingerprint;
else
msg += "\nFingerprint: " + fingerprint;
dlgVerifyCertificate.setMessage(msg);
// start dialog in UI thread

View File

@ -32,6 +32,15 @@ public class LibFreeRDP
private static final LongSparseArray<Boolean> mInstanceState = new LongSparseArray<>();
public static final long VERIFY_CERT_FLAG_NONE = 0x00;
public static final long VERIFY_CERT_FLAG_LEGACY = 0x02;
public static final long VERIFY_CERT_FLAG_REDIRECT = 0x10;
public static final long VERIFY_CERT_FLAG_GATEWAY = 0x20;
public static final long VERIFY_CERT_FLAG_CHANGED = 0x40;
public static final long VERIFY_CERT_FLAG_MISMATCH = 0x80;
public static final long VERIFY_CERT_FLAG_MATCH_LEGACY_SHA1 = 0x100;
public static final long VERIFY_CERT_FLAG_FP_IS_PEM = 0x200;
static
{
final String h264 = "openh264";
@ -517,31 +526,34 @@ public class LibFreeRDP
return false;
}
private static int OnVerifyCertificate(long inst, String commonName, String subject,
String issuer, String fingerprint, boolean hostMismatch)
private static int OnVerifyCertificateEx(long inst, String host, long port, String commonName,
String subject, String issuer, String fingerprint,
long flags)
{
SessionState s = GlobalApp.getSession(inst);
if (s == null)
return 0;
UIEventListener uiEventListener = s.getUIEventListener();
if (uiEventListener != null)
return uiEventListener.OnVerifiyCertificate(commonName, subject, issuer, fingerprint,
hostMismatch);
return uiEventListener.OnVerifiyCertificateEx(host, port, commonName, subject, issuer,
fingerprint, flags);
return 0;
}
private static int OnVerifyChangedCertificate(long inst, String commonName, String subject,
String issuer, String fingerprint,
String oldSubject, String oldIssuer,
String oldFingerprint)
private static int OnVerifyChangedCertificateEx(long inst, String host, long port,
String commonName, String subject,
String issuer, String fingerprint,
String oldSubject, String oldIssuer,
String oldFingerprint, long flags)
{
SessionState s = GlobalApp.getSession(inst);
if (s == null)
return 0;
UIEventListener uiEventListener = s.getUIEventListener();
if (uiEventListener != null)
return uiEventListener.OnVerifyChangedCertificate(
commonName, subject, issuer, fingerprint, oldSubject, oldIssuer, oldFingerprint);
return uiEventListener.OnVerifyChangedCertificateEx(host, port, commonName, subject,
issuer, fingerprint, oldSubject,
oldIssuer, oldFingerprint, flags);
return 0;
}
@ -601,12 +613,12 @@ public class LibFreeRDP
boolean OnGatewayAuthenticate(StringBuilder username, StringBuilder domain,
StringBuilder password);
int OnVerifiyCertificate(String commonName, String subject, String issuer,
String fingerprint, boolean mismatch);
int OnVerifiyCertificateEx(String host, long port, String commonName, String subject, String issuer,
String fingerprint, long flags);
int OnVerifyChangedCertificate(String commonName, String subject, String issuer,
int OnVerifyChangedCertificateEx(String host, long port, String commonName, String subject, String issuer,
String fingerprint, String oldSubject, String oldIssuer,
String oldFingerprint);
String oldFingerprint, long flags);
void OnGraphicsUpdate(int x, int y, int width, int height);

View File

@ -378,11 +378,11 @@ static BOOL android_gw_authenticate(freerdp* instance, char** username, char** p
return android_authenticate_int(instance, username, password, domain, "OnGatewayAuthenticate");
}
static DWORD android_verify_certificate(freerdp* instance, const char* common_name,
const char* subject, const char* issuer,
const char* fingerprint, BOOL host_mismatch)
static DWORD android_verify_certificate_ex(freerdp* instance, const char* host, UINT16 port,
const char* common_name, const char* subject,
const char* issuer, const char* fingerprint, DWORD flags)
{
WLog_DBG(TAG, "Certificate details:");
WLog_DBG(TAG, "Certificate details [%s:%" PRIu16 ":", host, port);
WLog_DBG(TAG, "\tSubject: %s", subject);
WLog_DBG(TAG, "\tIssuer: %s", issuer);
WLog_DBG(TAG, "\tThumbprint: %s", fingerprint);
@ -392,14 +392,16 @@ static DWORD android_verify_certificate(freerdp* instance, const char* common_na
"Please look at the OpenSSL documentation on how to add a private CA to the store.\n");
JNIEnv* env;
jboolean attached = jni_attach_thread(&env);
jstring jstr0 = (*env)->NewStringUTF(env, common_name);
jstring jstr1 = (*env)->NewStringUTF(env, subject);
jstring jstr2 = (*env)->NewStringUTF(env, issuer);
jstring jstr3 = (*env)->NewStringUTF(env, fingerprint);
jint res = freerdp_callback_int_result(
"OnVerifyCertificate",
"(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I",
(jlong)instance, jstr0, jstr1, jstr2, jstr3, host_mismatch);
jstring jstr0 = (*env)->NewStringUTF(env, host);
jstring jstr1 = (*env)->NewStringUTF(env, common_name);
jstring jstr2 = (*env)->NewStringUTF(env, subject);
jstring jstr3 = (*env)->NewStringUTF(env, issuer);
jstring jstr4 = (*env)->NewStringUTF(env, fingerprint);
jint res = freerdp_callback_int_result("OnVerifyCertificateEx",
"(JLjava/lang/String;ILjava/lang/String;Ljava/lang/"
"String;Ljava/lang/String;Ljava/lang/String;J)I",
(jlong)instance, jstr0, (jlong)port, jstr1, jstr2, jstr3,
(jlong)flags);
if (attached == JNI_TRUE)
jni_detach_thread();
@ -407,14 +409,15 @@ static DWORD android_verify_certificate(freerdp* instance, const char* common_na
return res;
}
static DWORD android_verify_changed_certificate(freerdp* instance, const char* common_name,
const char* subject, const char* issuer,
const char* new_fingerprint,
const char* old_subject, const char* old_issuer,
const char* old_fingerprint)
static DWORD android_verify_changed_certificate_ex(freerdp* instance, const char* host, UINT16 port,
const char* common_name, const char* subject,
const char* issuer, const char* new_fingerprint,
const char* old_subject, const char* old_issuer,
const char* old_fingerprint, DWORD flags)
{
JNIEnv* env;
jboolean attached = jni_attach_thread(&env);
jstring jhost = (*env)->NewStringUTF(env, host);
jstring jstr0 = (*env)->NewStringUTF(env, common_name);
jstring jstr1 = (*env)->NewStringUTF(env, subject);
jstring jstr2 = (*env)->NewStringUTF(env, issuer);
@ -422,11 +425,13 @@ static DWORD android_verify_changed_certificate(freerdp* instance, const char* c
jstring jstr4 = (*env)->NewStringUTF(env, old_subject);
jstring jstr5 = (*env)->NewStringUTF(env, old_issuer);
jstring jstr6 = (*env)->NewStringUTF(env, old_fingerprint);
jint res = freerdp_callback_int_result(
"OnVerifyChangedCertificate",
"(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I",
(jlong)instance, jstr0, jstr1, jstr2, jstr3, jstr4, jstr5, jstr6);
jint res =
freerdp_callback_int_result("OnVerifyChangedCertificateEx",
"(JLjava/lang/String;JLjava/lang/String;Ljava/lang/"
"String;Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)I",
(jlong)instance, jhost, (jlong)port, jstr0, jstr1, jstr2, jstr3,
jstr4, jstr5, jstr6, (jlong)flags);
if (attached == JNI_TRUE)
jni_detach_thread();
@ -624,8 +629,8 @@ static BOOL android_client_new(freerdp* instance, rdpContext* context)
instance->PostDisconnect = android_post_disconnect;
instance->Authenticate = android_authenticate;
instance->GatewayAuthenticate = android_gw_authenticate;
instance->VerifyCertificate = android_verify_certificate;
instance->VerifyChangedCertificate = android_verify_changed_certificate;
instance->VerifyCertificateEx = android_verify_certificate_ex;
instance->VerifyChangedCertificateEx = android_verify_changed_certificate_ex;
instance->LogonErrorInfo = NULL;
return TRUE;
}

View File

@ -163,9 +163,11 @@ static const COMMAND_LINE_ARGUMENT_A args[] = {
#ifdef WITH_GFX_H264
{ "gfx", COMMAND_LINE_VALUE_OPTIONAL, "[[RFX|AVC420|AVC444],mask:<value>]", NULL, NULL, -1,
NULL, "RDP8 graphics pipeline" },
#if defined(WITH_FREERDP_DEPRECATED)
{ "gfx-h264", COMMAND_LINE_VALUE_OPTIONAL,
"[[AVC420|AVC444],mask:<value>] [DEPRECATED] use /gfx:avc420 instead", NULL, NULL, -1, NULL,
"RDP8.1 graphics pipeline using H264 codec" },
#endif
#else
{ "gfx", COMMAND_LINE_VALUE_OPTIONAL, "RFX", NULL, NULL, -1, NULL, "RDP8 graphics pipeline" },
#endif

View File

@ -105,23 +105,27 @@ extern "C"
FREERDP_API BOOL client_cli_gw_authenticate(freerdp* instance, char** username, char** password,
char** domain);
#if defined(WITH_FREERDP_DEPRECATED)
FREERDP_API WINPR_DEPRECATED_VAR(
"Use client_cli_verify_certificate_ex",
DWORD client_cli_verify_certificate(freerdp* instance, const char* common_name,
const char* subject, const char* issuer,
const char* fingerprint, BOOL host_mismatch));
#endif
FREERDP_API DWORD client_cli_verify_certificate_ex(freerdp* instance, const char* host,
UINT16 port, const char* common_name,
const char* subject, const char* issuer,
const char* fingerprint, DWORD flags);
#if defined(WITH_FREERDP_DEPRECATED)
FREERDP_API WINPR_DEPRECATED_VAR("Use client_cli_verify_changed_certificate_ex",
DWORD client_cli_verify_changed_certificate(
freerdp* instance, const char* common_name,
const char* subject, const char* issuer,
const char* fingerprint, const char* old_subject,
const char* old_issuer, const char* old_fingerprint));
#endif
FREERDP_API DWORD client_cli_verify_changed_certificate_ex(
freerdp* instance, const char* host, UINT16 port, const char* common_name,

View File

@ -44,8 +44,11 @@ extern "C"
typedef struct _NSC_CONTEXT NSC_CONTEXT;
#if defined(WITH_FREERDP_DEPRECATED)
FREERDP_API WINPR_DEPRECATED(BOOL nsc_context_set_pixel_format(NSC_CONTEXT* context,
UINT32 pixel_format));
#endif
FREERDP_API BOOL nsc_context_set_parameters(NSC_CONTEXT* context, NSC_PARAMETER what,
UINT32 value);

View File

@ -100,11 +100,13 @@ extern "C"
* @return 1 to accept and store a certificate, 2 to accept
* a certificate only for this session, 0 otherwise.
*/
#if defined(WITH_FREERDP_DEPRECATED)
typedef WINPR_DEPRECATED_VAR(
"Use pVerifyCertificateEx",
DWORD (*pVerifyCertificate)(freerdp* instance, const char* common_name, const char* subject,
const char* issuer, const char* fingerprint,
BOOL host_mismatch));
#endif
/** @brief Callback used if user interaction is required to accept
* an unknown certificate.
@ -140,13 +142,14 @@ extern "C"
* @return 1 to accept and store a certificate, 2 to accept
* a certificate only for this session, 0 otherwise.
*/
#if defined(WITH_FREERDP_DEPRECATED)
typedef WINPR_DEPRECATED_VAR(
"Use pVerifyChangedCertificateEx",
DWORD (*pVerifyChangedCertificate)(freerdp* instance, const char* common_name,
const char* subject, const char* issuer,
const char* new_fingerprint, const char* old_subject,
const char* old_issuer, const char* old_fingerprint));
#endif
/** @brief Callback used if user interaction is required to accept
* a changed certificate.
@ -371,16 +374,17 @@ extern "C"
Callback for authentication.
It is used to get the username/password when it was not
provided at connection time. */
ALIGN64 WINPR_DEPRECATED_VAR("Use pVerifyCertificateEx",
pVerifyCertificate VerifyCertificate); /**< (offset 51)
Callback for certificate validation.
Used to verify that an unknown certificate is
#if defined(WITH_FREERDP_DEPRECATED)
ALIGN64 pVerifyCertificate VerifyCertificate; /**< (offset 51)
Callback for certificate validation.
Used to verify that an unknown certificate is
trusted. DEPRECATED: Use VerifyChangedCertificateEx*/
ALIGN64 WINPR_DEPRECATED_VAR("Use VerifyChangedCertificateEx",
pVerifyChangedCertificate VerifyChangedCertificate); /**<
ALIGN64 pVerifyChangedCertificate VerifyChangedCertificate; /**<
(offset 52) Callback for changed certificate validation. Used when a certificate differs from stored
fingerprint. DEPRECATED: Use VerifyChangedCertificateEx */
#else
ALIGN64 UINT64 reserved[2];
#endif
ALIGN64 pVerifyX509Certificate
VerifyX509Certificate; /**< (offset 53) Callback for X509 certificate verification (PEM
format) */

View File

@ -29,10 +29,12 @@
#define RAIL_SVC_CHANNEL_NAME "rail"
/* DEPRECATED: RAIL PDU flags use the spec conformant naming with TS_ prefix */
#if defined(WITH_FREERDP_DEPRECATED)
#define RAIL_EXEC_FLAG_EXPAND_WORKINGDIRECTORY 0x0001
#define RAIL_EXEC_FLAG_TRANSLATE_FILES 0x0002
#define RAIL_EXEC_FLAG_FILE 0x0004
#define RAIL_EXEC_FLAG_EXPAND_ARGUMENTS 0x0008
#endif
/* RAIL PDU flags */
#define TS_RAIL_EXEC_FLAG_EXPAND_WORKINGDIRECTORY 0x0001

View File

@ -1644,7 +1644,9 @@ extern "C"
FREERDP_API BOOL freerdp_static_channel_collection_del(rdpSettings* settings, const char* name);
FREERDP_API ADDIN_ARGV* freerdp_static_channel_collection_find(rdpSettings* settings,
const char* name);
#if defined(WITH_FREERDP_DEPRECATED)
FREERDP_API WINPR_DEPRECATED(ADDIN_ARGV* freerdp_static_channel_clone(ADDIN_ARGV* channel));
#endif
FREERDP_API void freerdp_static_channel_collection_free(rdpSettings* settings);
@ -1655,7 +1657,10 @@ extern "C"
FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_collection_find(const rdpSettings* settings,
const char* name);
#if defined(WITH_FREERDP_DEPRECATED)
FREERDP_API WINPR_DEPRECATED(ADDIN_ARGV* freerdp_dynamic_channel_clone(ADDIN_ARGV* channel));
#endif
FREERDP_API void freerdp_dynamic_channel_collection_free(rdpSettings* settings);
FREERDP_API void freerdp_target_net_addresses_free(rdpSettings* settings);
@ -1673,6 +1678,7 @@ extern "C"
* the functions freerdp_get_param_* and freerdp_set_param_* are deprecated.
* use freerdp_settings_get_* and freerdp_settings_set_* as a replacement!
*/
#if defined(WITH_FREERDP_DEPRECATED)
FREERDP_API WINPR_DEPRECATED(BOOL freerdp_get_param_bool(const rdpSettings* settings, int id));
FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_bool(rdpSettings* settings, int id,
BOOL param));
@ -1695,6 +1701,7 @@ extern "C"
int id));
FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_string(rdpSettings* settings, int id,
const char* param));
#endif
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings* settings, size_t id);
FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings* settings, size_t id, BOOL param);

View File

@ -215,7 +215,7 @@ if(FAAC_FOUND)
endif()
if(WITH_NEON)
set_source_files_properties(${CODEC_NEON_SRCS} PROPERTIES COMPILE_FLAGS "-mfpu=neon -Wno-unused-variable" )
set_source_files_properties(${CODEC_NEON_SRCS} PROPERTIES COMPILE_FLAGS "-mfpu=neon" )
set(CODEC_SRCS ${CODEC_SRCS} ${CODEC_NEON_SRCS})
endif()

View File

@ -1435,6 +1435,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U
if (!use_pem)
free(fp);
}
#if defined(WITH_FREERDP_DEPRECATED)
else if (instance->VerifyCertificate)
{
char* fp = crypto_cert_fingerprint(cert->px509);
@ -1444,6 +1445,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U
issuer, fp, !hostname_match);
free(fp);
}
#endif
}
else if (match == -1)
{
@ -1500,6 +1502,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U
if (!old_pem)
free(fp);
}
#if defined(WITH_FREERDP_DEPRECATED)
else if (instance->VerifyChangedCertificate)
{
char* fp = crypto_cert_fingerprint(cert->px509);
@ -1514,6 +1517,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U
old_fingerprint);
free(fp);
}
#endif
certificate_data_free(stored_data);
}

View File

@ -97,13 +97,6 @@ static BOOL shw_authenticate(freerdp* instance, char** username, char** password
return TRUE;
}
static DWORD shw_verify_certificate(freerdp* instance, const char* common_name, const char* subject,
const char* issuer, const char* fingerprint, BOOL host_mismatch)
{
WLog_WARN(TAG, "Certificate checks not implemented, access granted to everyone!");
return 1;
}
static int shw_verify_x509_certificate(freerdp* instance, const BYTE* data, size_t length,
const char* hostname, UINT16 port, DWORD flags)
{
@ -281,7 +274,6 @@ static BOOL shw_freerdp_client_new(freerdp* instance, rdpContext* context)
instance->PreConnect = shw_pre_connect;
instance->PostConnect = shw_post_connect;
instance->Authenticate = shw_authenticate;
instance->VerifyCertificate = shw_verify_certificate;
instance->VerifyX509Certificate = shw_verify_x509_certificate;
settings = instance->settings;
shw->settings = instance->context->settings;

View File

@ -35,6 +35,11 @@ endif()
option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON)
option(WITH_WINPR_TOOLS "Build WinPR helper binaries" ON)
option(WITH_WINPR_DEPRECATED "Build WinPR deprecated symbols" OFF)
if (WITH_WINPR_DEPRECATED)
add_definitions(-DWITH_WINPR_DEPRECATED)
endif()
if (WITH_VERBOSE_WINPR_ASSERT)
add_definitions(-DWITH_VERBOSE_WINPR_ASSERT)
@ -182,7 +187,7 @@ set(OPENSSL_FEATURE_TYPE "RECOMMENDED")
# Configure files
add_definitions("-DHAVE_CONFIG_H")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
enable_testing()

30
winpr/config.h.in Normal file
View File

@ -0,0 +1,30 @@
#ifndef WINPR_CONFIG_H
#define WINPR_CONFIG_H
/* Include files */
#cmakedefine HAVE_FCNTL_H
#if defined(__APPLE__) && !defined(__IOS__)
#cmakedefine01 HAVE_UNISTD_H
#else
#cmakedefine HAVE_UNISTD_H
#endif
#cmakedefine HAVE_INTTYPES_H
#cmakedefine HAVE_SYS_MODEM_H
#cmakedefine HAVE_SYS_FILIO_H
#cmakedefine HAVE_SYS_SELECT_H
#cmakedefine HAVE_SYS_SOCKIO_H
#cmakedefine HAVE_SYS_STRTIO_H
#cmakedefine HAVE_SYS_EVENTFD_H
#cmakedefine HAVE_SYS_TIMERFD_H
#cmakedefine HAVE_TM_GMTOFF
#cmakedefine HAVE_AIO_H
#cmakedefine HAVE_POLL_H
#cmakedefine HAVE_SYSLOG_H
#cmakedefine HAVE_JOURNALD_H
#cmakedefine HAVE_PTHREAD_MUTEX_TIMEDLOCK
#cmakedefine HAVE_VALGRIND_MEMCHECK_H
#cmakedefine HAVE_EXECINFO_H
#cmakedefine HAVE_GETLOGIN_R
#cmakedefine HAVE_STRNDUP
#endif /* WINPR_CONFIG_H */

View File

@ -124,7 +124,10 @@ extern "C"
WINPR_API void ArrayList_Clear(wArrayList* arrayList);
WINPR_API BOOL ArrayList_Contains(wArrayList* arrayList, const void* obj);
#if defined(WITH_WINPR_DEPRECATED)
WINPR_API WINPR_DEPRECATED(int ArrayList_Add(wArrayList* arrayList, const void* obj));
#endif
WINPR_API BOOL ArrayList_Append(wArrayList* arrayList, const void* obj);
WINPR_API BOOL ArrayList_Insert(wArrayList* arrayList, size_t index, const void* obj);
@ -297,8 +300,12 @@ extern "C"
typedef BOOL (*HASH_TABLE_FOREACH_FN)(const void* key, void* value, void* arg);
WINPR_API size_t HashTable_Count(wHashTable* table);
#if defined(WITH_WINPR_DEPRECATED)
WINPR_API WINPR_DEPRECATED(int HashTable_Add(wHashTable* table, const void* key,
const void* value));
#endif
WINPR_API BOOL HashTable_Insert(wHashTable* table, const void* key, const void* value);
WINPR_API BOOL HashTable_Remove(wHashTable* table, const void* key);
WINPR_API void HashTable_Clear(wHashTable* table);

View File

@ -195,10 +195,12 @@ extern "C"
WINPR_API wLogLayout* WLog_GetLogLayout(wLog* log);
WINPR_API BOOL WLog_Layout_SetPrefixFormat(wLog* log, wLogLayout* layout, const char* format);
#if defined(WITH_WINPR_DEPRECATED)
/** Deprecated */
WINPR_API WINPR_DEPRECATED(BOOL WLog_Init(void));
/** Deprecated */
WINPR_API WINPR_DEPRECATED(BOOL WLog_Uninit(void));
#endif
typedef BOOL (*wLogCallbackMessage_t)(const wLogMessage* msg);
typedef BOOL (*wLogCallbackData_t)(const wLogMessage* msg);