mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
Removed RdpKeyFile and RdpKeyContent settings
They are a duplicate of PrivateKeyFile and PrivateKeyContent
This commit is contained in:
@@ -94,9 +94,6 @@ struct proxy_config
|
||||
|
||||
char* PrivateKeyFile;
|
||||
char* PrivateKeyContent;
|
||||
|
||||
char* RdpKeyFile;
|
||||
char* RdpKeyContent;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -687,13 +687,11 @@ typedef struct
|
||||
#define FreeRDP_CertificateName (1409)
|
||||
#define FreeRDP_CertificateFile (1410)
|
||||
#define FreeRDP_PrivateKeyFile (1411)
|
||||
#define FreeRDP_RdpKeyFile (1412)
|
||||
#define FreeRDP_RdpServerRsaKey (1413)
|
||||
#define FreeRDP_RdpServerCertificate (1414)
|
||||
#define FreeRDP_ExternalCertificateManagement (1415)
|
||||
#define FreeRDP_CertificateContent (1416)
|
||||
#define FreeRDP_PrivateKeyContent (1417)
|
||||
#define FreeRDP_RdpKeyContent (1418)
|
||||
#define FreeRDP_AutoAcceptCertificate (1419)
|
||||
#define FreeRDP_AutoDenyCertificate (1420)
|
||||
#define FreeRDP_CertificateAcceptedFingerprints (1421)
|
||||
@@ -1198,13 +1196,13 @@ struct rdp_settings
|
||||
ALIGN64 char* CertificateName; /* 1409 */
|
||||
ALIGN64 char* CertificateFile; /* 1410 */
|
||||
ALIGN64 char* PrivateKeyFile; /* 1411 */
|
||||
ALIGN64 char* RdpKeyFile; /* 1412 */
|
||||
UINT64 padding1412[1]; /* 1412 */
|
||||
ALIGN64 rdpRsaKey* RdpServerRsaKey; /* 1413 */
|
||||
ALIGN64 rdpCertificate* RdpServerCertificate; /* 1414 */
|
||||
ALIGN64 BOOL ExternalCertificateManagement; /* 1415 */
|
||||
ALIGN64 char* CertificateContent; /* 1416 */
|
||||
ALIGN64 char* PrivateKeyContent; /* 1417 */
|
||||
ALIGN64 char* RdpKeyContent; /* 1418 */
|
||||
UINT64 padding1418[1]; /* 1418 */
|
||||
ALIGN64 BOOL AutoAcceptCertificate; /* 1419 */
|
||||
ALIGN64 BOOL AutoDenyCertificate; /* 1420 */
|
||||
ALIGN64 char* CertificateAcceptedFingerprints; /* 1421 */
|
||||
|
||||
@@ -2518,12 +2518,6 @@ const char* freerdp_settings_get_string(const rdpSettings* settings, size_t id)
|
||||
case FreeRDP_RDP2TCPArgs:
|
||||
return settings->RDP2TCPArgs;
|
||||
|
||||
case FreeRDP_RdpKeyContent:
|
||||
return settings->RdpKeyContent;
|
||||
|
||||
case FreeRDP_RdpKeyFile:
|
||||
return settings->RdpKeyFile;
|
||||
|
||||
case FreeRDP_ReaderName:
|
||||
return settings->ReaderName;
|
||||
|
||||
@@ -2785,12 +2779,6 @@ char* freerdp_settings_get_string_writable(rdpSettings* settings, size_t id)
|
||||
case FreeRDP_RDP2TCPArgs:
|
||||
return settings->RDP2TCPArgs;
|
||||
|
||||
case FreeRDP_RdpKeyContent:
|
||||
return settings->RdpKeyContent;
|
||||
|
||||
case FreeRDP_RdpKeyFile:
|
||||
return settings->RdpKeyFile;
|
||||
|
||||
case FreeRDP_ReaderName:
|
||||
return settings->ReaderName;
|
||||
|
||||
@@ -3062,12 +3050,6 @@ BOOL freerdp_settings_set_string_(rdpSettings* settings, size_t id, const char*
|
||||
case FreeRDP_RDP2TCPArgs:
|
||||
return update_string(&settings->RDP2TCPArgs, cnv.cc, len, cleanup);
|
||||
|
||||
case FreeRDP_RdpKeyContent:
|
||||
return update_string(&settings->RdpKeyContent, cnv.cc, len, cleanup);
|
||||
|
||||
case FreeRDP_RdpKeyFile:
|
||||
return update_string(&settings->RdpKeyFile, cnv.cc, len, cleanup);
|
||||
|
||||
case FreeRDP_ReaderName:
|
||||
return update_string(&settings->ReaderName, cnv.cc, len, cleanup);
|
||||
|
||||
|
||||
@@ -367,8 +367,6 @@ static const struct settings_str_entry settings_map[] = {
|
||||
{ FreeRDP_ProxyPassword, 7, "FreeRDP_ProxyPassword" },
|
||||
{ FreeRDP_ProxyUsername, 7, "FreeRDP_ProxyUsername" },
|
||||
{ FreeRDP_RDP2TCPArgs, 7, "FreeRDP_RDP2TCPArgs" },
|
||||
{ FreeRDP_RdpKeyContent, 7, "FreeRDP_RdpKeyContent" },
|
||||
{ FreeRDP_RdpKeyFile, 7, "FreeRDP_RdpKeyFile" },
|
||||
{ FreeRDP_ReaderName, 7, "FreeRDP_ReaderName" },
|
||||
{ FreeRDP_RedirectionAcceptedCert, 7, "FreeRDP_RedirectionAcceptedCert" },
|
||||
{ FreeRDP_RedirectionDomain, 7, "FreeRDP_RedirectionDomain" },
|
||||
|
||||
@@ -1313,8 +1313,8 @@ BOOL nego_send_negotiation_response(rdpNego* nego)
|
||||
settings->UseRdpSecurityLayer = FALSE;
|
||||
settings->EncryptionLevel = ENCRYPTION_LEVEL_NONE;
|
||||
}
|
||||
else if (!settings->RdpServerRsaKey && !settings->RdpKeyFile &&
|
||||
!settings->RdpKeyContent)
|
||||
else if (!settings->RdpServerRsaKey && !settings->PrivateKeyFile &&
|
||||
!settings->PrivateKeyContent)
|
||||
{
|
||||
WLog_ERR(TAG, "Missing server certificate");
|
||||
return FALSE;
|
||||
|
||||
@@ -242,19 +242,19 @@ static BOOL freerdp_peer_initialize(freerdp_peer* client)
|
||||
settings->LocalConnection = client->local;
|
||||
rdp_server_transition_to_state(rdp, CONNECTION_STATE_INITIAL);
|
||||
|
||||
if (settings->RdpKeyFile)
|
||||
if (settings->PrivateKeyFile)
|
||||
{
|
||||
settings->RdpServerRsaKey = key_new(settings->RdpKeyFile);
|
||||
settings->RdpServerRsaKey = key_new(settings->PrivateKeyFile);
|
||||
|
||||
if (!settings->RdpServerRsaKey)
|
||||
{
|
||||
WLog_ERR(TAG, "invalid RDP key file %s", settings->RdpKeyFile);
|
||||
WLog_ERR(TAG, "invalid RDP key file %s", settings->PrivateKeyFile);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (settings->RdpKeyContent)
|
||||
else if (settings->PrivateKeyContent)
|
||||
{
|
||||
settings->RdpServerRsaKey = key_new_from_content(settings->RdpKeyContent, NULL);
|
||||
settings->RdpServerRsaKey = key_new_from_content(settings->PrivateKeyContent, NULL);
|
||||
|
||||
if (!settings->RdpServerRsaKey)
|
||||
{
|
||||
|
||||
@@ -376,8 +376,6 @@ static const size_t string_list_indices[] = {
|
||||
FreeRDP_ProxyPassword,
|
||||
FreeRDP_ProxyUsername,
|
||||
FreeRDP_RDP2TCPArgs,
|
||||
FreeRDP_RdpKeyContent,
|
||||
FreeRDP_RdpKeyFile,
|
||||
FreeRDP_ReaderName,
|
||||
FreeRDP_RedirectionAcceptedCert,
|
||||
FreeRDP_RedirectionDomain,
|
||||
|
||||
@@ -1021,8 +1021,7 @@ static DWORD WINAPI test_peer_mainloop(LPVOID arg)
|
||||
}
|
||||
}
|
||||
if (!freerdp_settings_set_string(settings, FreeRDP_CertificateFile, cert) ||
|
||||
!freerdp_settings_set_string(settings, FreeRDP_PrivateKeyFile, key) ||
|
||||
!freerdp_settings_set_string(settings, FreeRDP_RdpKeyFile, key))
|
||||
!freerdp_settings_set_string(settings, FreeRDP_PrivateKeyFile, key))
|
||||
{
|
||||
WLog_ERR(TAG, "Memory allocation failed (strdup)");
|
||||
freerdp_peer_free(client);
|
||||
|
||||
@@ -389,39 +389,6 @@ static BOOL pf_config_load_certificates(wIniFile* ini, proxyConfig* config)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
tmp1 = pf_config_get_str(ini, "Certificates", "RdpKeyFile", FALSE);
|
||||
if (tmp1)
|
||||
{
|
||||
if (!winpr_PathFileExists(tmp1))
|
||||
{
|
||||
WLog_ERR(TAG, "Certificates/RdpKeyFile file %s does not exist", tmp1);
|
||||
return FALSE;
|
||||
}
|
||||
config->RdpKeyFile = _strdup(tmp1);
|
||||
}
|
||||
tmp2 = pf_config_get_str(ini, "Certificates", "RdpKeyContent", FALSE);
|
||||
if (tmp2)
|
||||
{
|
||||
if (strlen(tmp2) < 1)
|
||||
{
|
||||
WLog_ERR(TAG, "Certificates/RdpKeyContent has invalid empty value");
|
||||
return FALSE;
|
||||
}
|
||||
config->RdpKeyContent = _strdup(tmp2);
|
||||
}
|
||||
if (tmp1 && tmp2)
|
||||
{
|
||||
WLog_ERR(TAG, "Certificates/RdpKeyFile and Certificates/RdpKeyContent are mutually "
|
||||
"exclusive options");
|
||||
return FALSE;
|
||||
}
|
||||
else if (!tmp1 && !tmp2)
|
||||
{
|
||||
WLog_ERR(TAG, "Certificates/RdpKeyFile or Certificates/RdpKeyContent are "
|
||||
"required settings");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -571,13 +538,6 @@ BOOL pf_server_config_dump(const char* file)
|
||||
"<Contents of some private key file in PEM format>") < 0)
|
||||
goto fail;
|
||||
|
||||
if (IniFile_SetKeyValueString(ini, "Certificates", "RdpKeyFile",
|
||||
"<absolute path to some private key file> OR") < 0)
|
||||
goto fail;
|
||||
if (IniFile_SetKeyValueString(ini, "Certificates", "RdpKeyContent",
|
||||
"<Contents of some private key file in PEM format>") < 0)
|
||||
goto fail;
|
||||
|
||||
/* store configuration */
|
||||
if (IniFile_WriteFile(ini, file) < 0)
|
||||
goto fail;
|
||||
@@ -731,8 +691,6 @@ void pf_server_config_print(const proxyConfig* config)
|
||||
CONFIG_PRINT_STR_CONTENT(config, CertificateContent);
|
||||
CONFIG_PRINT_STR(config, PrivateKeyFile);
|
||||
CONFIG_PRINT_STR_CONTENT(config, PrivateKeyContent);
|
||||
CONFIG_PRINT_STR(config, RdpKeyFile);
|
||||
CONFIG_PRINT_STR_CONTENT(config, RdpKeyContent);
|
||||
}
|
||||
|
||||
void pf_server_config_free(proxyConfig* config)
|
||||
@@ -750,8 +708,6 @@ void pf_server_config_free(proxyConfig* config)
|
||||
free(config->CertificateContent);
|
||||
free(config->PrivateKeyFile);
|
||||
free(config->PrivateKeyContent);
|
||||
free(config->RdpKeyFile);
|
||||
free(config->RdpKeyContent);
|
||||
free(config);
|
||||
}
|
||||
|
||||
@@ -854,10 +810,6 @@ BOOL pf_config_clone(proxyConfig** dst, const proxyConfig* config)
|
||||
goto fail;
|
||||
if (!pf_config_copy_string(&tmp->PrivateKeyContent, config->PrivateKeyContent))
|
||||
goto fail;
|
||||
if (!pf_config_copy_string(&tmp->RdpKeyFile, config->RdpKeyFile))
|
||||
goto fail;
|
||||
if (!pf_config_copy_string(&tmp->RdpKeyContent, config->RdpKeyContent))
|
||||
goto fail;
|
||||
|
||||
*dst = tmp;
|
||||
return TRUE;
|
||||
|
||||
@@ -198,7 +198,6 @@ BOOL pf_context_copy_settings(rdpSettings* dst, const rdpSettings* src)
|
||||
BOOL rc = FALSE;
|
||||
rdpSettings* before_copy;
|
||||
const size_t to_revert[] = { FreeRDP_ConfigPath, FreeRDP_PrivateKeyContent,
|
||||
FreeRDP_RdpKeyContent, FreeRDP_RdpKeyFile,
|
||||
FreeRDP_PrivateKeyFile, FreeRDP_CertificateFile,
|
||||
FreeRDP_CertificateName, FreeRDP_CertificateContent };
|
||||
|
||||
|
||||
@@ -492,9 +492,7 @@ static BOOL pf_server_initialize_peer_connection(freerdp_peer* peer)
|
||||
config->CertificateContent) ||
|
||||
!freerdp_settings_set_string(settings, FreeRDP_PrivateKeyFile, config->PrivateKeyFile) ||
|
||||
!freerdp_settings_set_string(settings, FreeRDP_PrivateKeyContent,
|
||||
config->PrivateKeyContent) ||
|
||||
!freerdp_settings_set_string(settings, FreeRDP_RdpKeyFile, config->RdpKeyFile) ||
|
||||
!freerdp_settings_set_string(settings, FreeRDP_RdpKeyContent, config->RdpKeyContent))
|
||||
config->PrivateKeyContent))
|
||||
{
|
||||
WLog_ERR(TAG, "Memory allocation failed (strdup)");
|
||||
return FALSE;
|
||||
|
||||
@@ -202,8 +202,6 @@ static BOOL shadow_client_context_new(freerdp_peer* peer, rdpContext* context)
|
||||
if (!freerdp_settings_set_string(settings, FreeRDP_PrivateKeyFile, server->PrivateKeyFile))
|
||||
goto fail_privkey_file;
|
||||
|
||||
if (!freerdp_settings_set_string(settings, FreeRDP_RdpKeyFile, server->PrivateKeyFile))
|
||||
goto fail_rdpkey_file;
|
||||
if (server->ipcSocket && (strncmp(bind_address, server->ipcSocket,
|
||||
strnlen(bind_address, sizeof(bind_address))) != 0))
|
||||
{
|
||||
@@ -244,8 +242,6 @@ fail_message_queue:
|
||||
fail_open_server:
|
||||
DeleteCriticalSection(&(client->lock));
|
||||
fail_client_lock:
|
||||
freerdp_settings_set_string(settings, FreeRDP_RdpKeyFile, NULL);
|
||||
fail_rdpkey_file:
|
||||
freerdp_settings_set_string(settings, FreeRDP_PrivateKeyFile, NULL);
|
||||
fail_privkey_file:
|
||||
freerdp_settings_set_string(settings, FreeRDP_CertificateFile, NULL);
|
||||
|
||||
Reference in New Issue
Block a user