From fada84d0290e263ca213d36ea0e72a2dc46fc564 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Moreau?= Date: Tue, 28 Feb 2012 17:10:06 -0500 Subject: [PATCH] wfreerdp: minor fixes --- client/Windows/wfreerdp.c | 29 ++++++++++++++++++++++++++++- libfreerdp-crypto/tls.c | 2 ++ libfreerdp-utils/file.c | 4 ++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/client/Windows/wfreerdp.c b/client/Windows/wfreerdp.c index d293edb..2ffec2d 100644 --- a/client/Windows/wfreerdp.c +++ b/client/Windows/wfreerdp.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #ifdef _MSC_VER @@ -178,7 +179,7 @@ boolean wf_pre_connect(freerdp* instance) wfi->clrconv = (HCLRCONV) xzalloc(sizeof(CLRCONV)); wfi->clrconv->palette = NULL; - wfi->clrconv->alpha = 0; + wfi->clrconv->alpha = false; instance->context->cache = cache_new(settings); @@ -385,6 +386,32 @@ boolean wf_post_connect(freerdp* instance) boolean wf_verify_certificate(freerdp* instance, char* subject, char* issuer, char* fingerprint) { +#if 0 + DWORD mode; + int read_size; + DWORD read_count; + TCHAR answer[2]; + TCHAR* read_buffer; + HANDLE input_handle; +#endif + + printf("Certificate details:\n"); + printf("\tSubject: %s\n", subject); + printf("\tIssuer: %s\n", issuer); + printf("\tThumbprint: %s\n", fingerprint); + printf("The above X.509 certificate could not be verified, possibly because you do not have " + "the CA certificate in your certificate store, or the certificate has expired. " + "Please look at the documentation on how to create local certificate store for a private CA.\n"); + + /* TODO: ask for user validation */ +#if 0 + input_handle = GetStdHandle(STD_INPUT_HANDLE); + + GetConsoleMode(input_handle, &mode); + mode |= ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT; + SetConsoleMode(input_handle, mode); +#endif + return true; } diff --git a/libfreerdp-crypto/tls.c b/libfreerdp-crypto/tls.c index 09df895..ca342ad 100644 --- a/libfreerdp-crypto/tls.c +++ b/libfreerdp-crypto/tls.c @@ -404,6 +404,7 @@ boolean tls_verify_certificate(rdpTls* tls, CryptoCert cert, char* hostname) xfree(fingerprint); } +#ifndef _WIN32 if (common_name) xfree(common_name); @@ -414,6 +415,7 @@ boolean tls_verify_certificate(rdpTls* tls, CryptoCert cert, char* hostname) xfree(alt_names); } +#endif if (certificate_data) { diff --git a/libfreerdp-utils/file.c b/libfreerdp-utils/file.c index 05fc597..ba0706c 100644 --- a/libfreerdp-utils/file.c +++ b/libfreerdp-utils/file.c @@ -44,7 +44,7 @@ #include #define PATH_SEPARATOR_STR "\\" #define PATH_SEPARATOR_CHR '\\' -#define HOME_ENV_VARIABLE "HOMEPATH" +#define HOME_ENV_VARIABLE "HOME" #endif #ifdef _WIN32 @@ -94,7 +94,7 @@ char* freerdp_get_config_path(rdpSettings* settings) return settings->config_path; settings->config_path = (char*) xmalloc(strlen(settings->home_path) + sizeof(FREERDP_CONFIG_DIR) + 2); - sprintf(settings->config_path, "%s/%s", settings->home_path, FREERDP_CONFIG_DIR); + sprintf(settings->config_path, "%s" PATH_SEPARATOR_STR "%s", settings->home_path, FREERDP_CONFIG_DIR); if (!freerdp_check_file_exists(settings->config_path)) freerdp_mkdir(settings->config_path); -- 2.7.4