Skip to content

Commit

Permalink
Using lowercase hostname for comparison now.
Browse files Browse the repository at this point in the history
fixed argument mixup.
  • Loading branch information
akallabeth committed Jul 13, 2015
1 parent ca7c34f commit fc929fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libfreerdp/crypto/certificate.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>

#include <winpr/crypto.h>
#include <winpr/crt.h>
Expand Down Expand Up @@ -571,6 +572,7 @@ BOOL certificate_data_print(rdpCertificateStore* certificate_store, rdpCertifica

rdpCertificateData* certificate_data_new(char* hostname, UINT16 port, char* subject, char* issuer, char* fingerprint)
{
size_t i;
rdpCertificateData* certdata;

if (!hostname)
Expand All @@ -590,7 +592,7 @@ rdpCertificateData* certificate_data_new(char* hostname, UINT16 port, char* subj
else
certdata->subject = crypto_base64_encode((BYTE*)"", 0);
if (issuer)
certdata->issuer = crypto_base64_encode((BYTE*)issuer, strlen(subject));
certdata->issuer = crypto_base64_encode((BYTE*)issuer, strlen(issuer));
else
certdata->issuer = crypto_base64_encode((BYTE*)"", 0);
certdata->fingerprint = _strdup(fingerprint);
Expand All @@ -599,6 +601,9 @@ rdpCertificateData* certificate_data_new(char* hostname, UINT16 port, char* subj
!certdata->issuer || !certdata->fingerprint)
goto fail;

for (i=0; i<strlen(hostname); i++)
certdata->hostname[i] = tolower(certdata->hostname[i]);

return certdata;

fail:
Expand Down

0 comments on commit fc929fb

Please sign in to comment.