libfreerdp-core: added --certificate-name option for explicitly specifying a certificate name

This commit is contained in:
Marc-André Moreau 2012-02-04 15:16:41 -05:00
parent ffec1c2062
commit 47de99062d
3 changed files with 17 additions and 1 deletions

View File

@ -358,7 +358,8 @@ struct rdp_settings
rdpCertificate* server_cert; /* 269 */
char* rdp_key_file; /* 270 */
rdpKey* server_key; /* 271 */
uint32 paddingL[280 - 272]; /* 272 */
char* certificate_name; /* 272 */
uint32 paddingL[280 - 273]; /* 273 */
/* Codecs */
boolean rfx_codec; /* 280 */

View File

@ -242,6 +242,10 @@ boolean tls_verify_certificate(rdpTls* tls, CryptoCert cert, char* hostname)
if (tls->settings->ignore_certificate)
return true; /* success! */
/* if user explicitly specified a certificate name, use it instead of the hostname */
if (tls->settings->certificate_name)
hostname = tls->settings->certificate_name;
/* attempt verification using OpenSSL and the ~/.freerdp/certs certificate store */
certificate_status = x509_verify_certificate(cert, tls->certificate_store->path);

View File

@ -306,6 +306,17 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
{
settings->ignore_certificate = true;
}
else if (strcmp("--certificate-name", argv[index]) == 0)
{
index++;
if (index == argc)
{
printf("missing certificate name\n");
return FREERDP_ARGS_PARSE_FAILURE;
}
settings->certificate_name = xstrdup(argv[index]);
}
else if (strcmp("--no-fastpath", argv[index]) == 0)
{
settings->fastpath_input = false;