diff --git a/libfreerdp/crypto/certificate.c b/libfreerdp/crypto/certificate.c index 5bb04c037..e8d292377 100644 --- a/libfreerdp/crypto/certificate.c +++ b/libfreerdp/crypto/certificate.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -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) @@ -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); @@ -599,6 +601,9 @@ rdpCertificateData* certificate_data_new(char* hostname, UINT16 port, char* subj !certdata->issuer || !certdata->fingerprint) goto fail; + for (i=0; ihostname[i] = tolower(certdata->hostname[i]); + return certdata; fail: