mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
[server,proxy] use rdpPrivateKey and rdpCertificate
This commit is contained in:
parent
fe287e199b
commit
87e90903ab
@ -217,9 +217,7 @@ BOOL pf_context_copy_settings(rdpSettings* dst, const rdpSettings* src)
|
|||||||
{
|
{
|
||||||
BOOL rc = FALSE;
|
BOOL rc = FALSE;
|
||||||
rdpSettings* before_copy;
|
rdpSettings* before_copy;
|
||||||
const size_t to_revert[] = { FreeRDP_ConfigPath, FreeRDP_PrivateKeyContent,
|
const size_t to_revert[] = { FreeRDP_ConfigPath, FreeRDP_CertificateName };
|
||||||
FreeRDP_PrivateKeyFile, FreeRDP_CertificateFile,
|
|
||||||
FreeRDP_CertificateName, FreeRDP_CertificateContent };
|
|
||||||
|
|
||||||
if (!dst || !src)
|
if (!dst || !src)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -444,31 +444,38 @@ original_cb:
|
|||||||
|
|
||||||
static BOOL pf_server_initialize_peer_connection(freerdp_peer* peer)
|
static BOOL pf_server_initialize_peer_connection(freerdp_peer* peer)
|
||||||
{
|
{
|
||||||
pServerContext* ps;
|
|
||||||
rdpSettings* settings;
|
|
||||||
proxyData* pdata;
|
|
||||||
const proxyConfig* config;
|
|
||||||
proxyServer* server;
|
|
||||||
|
|
||||||
WINPR_ASSERT(peer);
|
WINPR_ASSERT(peer);
|
||||||
|
|
||||||
ps = (pServerContext*)peer->context;
|
pServerContext* ps = (pServerContext*)peer->context;
|
||||||
if (!ps)
|
if (!ps)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
settings = peer->context->settings;
|
rdpSettings* settings = peer->context->settings;
|
||||||
WINPR_ASSERT(settings);
|
WINPR_ASSERT(settings);
|
||||||
|
|
||||||
pdata = proxy_data_new();
|
proxyData* pdata = proxy_data_new();
|
||||||
if (!pdata)
|
if (!pdata)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
server = (proxyServer*)peer->ContextExtra;
|
proxyServer* server = (proxyServer*)peer->ContextExtra;
|
||||||
WINPR_ASSERT(server);
|
WINPR_ASSERT(server);
|
||||||
|
|
||||||
proxy_data_set_server_context(pdata, ps);
|
proxy_data_set_server_context(pdata, ps);
|
||||||
|
|
||||||
pdata->module = server->module;
|
pdata->module = server->module;
|
||||||
config = pdata->config = server->config;
|
const proxyConfig* config = pdata->config = server->config;
|
||||||
|
|
||||||
|
rdpPrivateKey* key = freerdp_key_new_from_pem(config->PrivateKeyPEM);
|
||||||
|
if (!key)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!freerdp_settings_set_pointer_len(settings, FreeRDP_RdpServerRsaKey, key, 1))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
rdpCertificate* cert = freerdp_certificate_new_from_pem(config->CertificatePEM);
|
||||||
|
if (!cert)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!freerdp_settings_set_pointer_len(settings, FreeRDP_RdpServerCertificate, cert, 1))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* currently not supporting GDI orders */
|
/* currently not supporting GDI orders */
|
||||||
ZeroMemory(settings->OrderSupport, 32);
|
ZeroMemory(settings->OrderSupport, 32);
|
||||||
@ -487,17 +494,6 @@ static BOOL pf_server_initialize_peer_connection(freerdp_peer* peer)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!freerdp_settings_set_string(settings, FreeRDP_CertificateFile, config->CertificateFile) ||
|
|
||||||
!freerdp_settings_set_string(settings, FreeRDP_CertificateContent,
|
|
||||||
config->CertificateContent) ||
|
|
||||||
!freerdp_settings_set_string(settings, FreeRDP_PrivateKeyFile, config->PrivateKeyFile) ||
|
|
||||||
!freerdp_settings_set_string(settings, FreeRDP_PrivateKeyContent,
|
|
||||||
config->PrivateKeyContent))
|
|
||||||
{
|
|
||||||
PROXY_LOG_ERR(TAG, ps, "Memory allocation failed (strdup)");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config->RemoteApp)
|
if (config->RemoteApp)
|
||||||
{
|
{
|
||||||
const UINT32 mask =
|
const UINT32 mask =
|
||||||
|
Loading…
Reference in New Issue
Block a user