Merge pull request #161 from mfleisz/certcallback

settings: Added --ignore-certificates command line
This commit is contained in:
Marc-André Moreau 2011-10-19 04:32:43 -07:00
commit 505426e31f
3 changed files with 19 additions and 11 deletions

View File

@ -240,6 +240,7 @@ struct rdp_settings
char* privatekey_file;
boolean autologon;
boolean ignore_certificate;
boolean compression;
boolean ipv6;

View File

@ -259,19 +259,21 @@ int tls_verify_certificate(CryptoCert cert, rdpSettings* settings, char* hostnam
if (certstore->match == 1)
{
char* issuer = crypto_cert_issuer(cert->px509);
char* subject = crypto_cert_subject(cert->px509);
char* fingerprint = crypto_cert_fingerprint(cert->px509);
boolean accept_certificate = settings->ignore_certificate;
if(!accept_certificate)
{
char* issuer = crypto_cert_issuer(cert->px509);
char* subject = crypto_cert_subject(cert->px509);
char* fingerprint = crypto_cert_fingerprint(cert->px509);
boolean accept_certificate = False;
freerdp* instance = (freerdp*)settings->instance;
freerdp* instance = (freerdp*)settings->instance;
if(instance->VerifyCertificate)
accept_certificate = instance->VerifyCertificate(instance, subject, issuer, fingerprint);
if(instance->VerifyCertificate)
accept_certificate = instance->VerifyCertificate(instance, subject, issuer, fingerprint);
xfree(issuer);
xfree(subject);
xfree(fingerprint);
xfree(issuer);
xfree(subject);
xfree(fingerprint);
}
if(!accept_certificate)
return 1;

View File

@ -89,6 +89,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
" --no-rdp: disable Standard RDP encryption\n"
" --no-tls: disable TLS encryption\n"
" --no-nla: disable network level authentication\n"
" --ignore-certificate: ignore verification of logon certificate\n"
" --sec: force protocol security (rdp, tls or nla)\n"
" --version: print version information\n"
"\n", argv[0]);
@ -257,6 +258,10 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
{
settings->authentication = False;
}
else if (strcmp("--ignore-certificate", argv[index]) == 0)
{
settings->ignore_certificate = True;
}
else if (strcmp("--no-fastpath", argv[index]) == 0)
{
settings->fastpath_input = False;