|
|
0c7016 |
From 500b87127e6c4edc5f7182cc1a5261c4f96f38e1 Mon Sep 17 00:00:00 2001
|
|
|
0c7016 |
From: Chris <ccpp@gmx.at>
|
|
|
0c7016 |
Date: Mon, 17 Jun 2013 21:26:35 +0200
|
|
|
0c7016 |
Subject: [PATCH 4/5] Using the more efficient code for comparing host names
|
|
|
0c7016 |
|
|
|
0c7016 |
---
|
|
|
0c7016 |
libfreerdp-core/tls.c | 24 ------------------------
|
|
|
0c7016 |
1 file changed, 24 deletions(-)
|
|
|
0c7016 |
|
|
|
0c7016 |
diff --git a/libfreerdp-core/tls.c b/libfreerdp-core/tls.c
|
|
|
0c7016 |
index db09960..2fbaa2c 100644
|
|
|
0c7016 |
--- a/libfreerdp-core/tls.c
|
|
|
0c7016 |
+++ b/libfreerdp-core/tls.c
|
|
|
0c7016 |
@@ -268,30 +268,6 @@ boolean tls_match_hostname(char *pattern, int pattern_length, char *hostname)
|
|
|
0c7016 |
return true;
|
|
|
0c7016 |
}
|
|
|
0c7016 |
|
|
|
0c7016 |
- /* ccpp: Check for wildcard certificates */
|
|
|
0c7016 |
- if (memchr(pattern, '*', pattern_length) != NULL)
|
|
|
0c7016 |
- {
|
|
|
0c7016 |
- /* The wildcard matches one subdomain level (all except a dot) */
|
|
|
0c7016 |
-
|
|
|
0c7016 |
- int pattern_position = 0;
|
|
|
0c7016 |
- int hostname_position = 0;
|
|
|
0c7016 |
-
|
|
|
0c7016 |
- for(; hostname[hostname_position] && pattern_position < pattern_length; pattern_position++, hostname_position++)
|
|
|
0c7016 |
- {
|
|
|
0c7016 |
- if( pattern[pattern_position] == '*' ) {
|
|
|
0c7016 |
- while( hostname[hostname_position] != '.' && hostname[hostname_position] != '\0' )
|
|
|
0c7016 |
- hostname_position++;
|
|
|
0c7016 |
-
|
|
|
0c7016 |
- pattern_position++;
|
|
|
0c7016 |
- }
|
|
|
0c7016 |
-
|
|
|
0c7016 |
- if (hostname[hostname_position] != pattern[pattern_position] )
|
|
|
0c7016 |
- {
|
|
|
0c7016 |
- return false;
|
|
|
0c7016 |
- }
|
|
|
0c7016 |
- }
|
|
|
0c7016 |
- }
|
|
|
0c7016 |
-
|
|
|
0c7016 |
if (pattern_length > 2 && pattern[0] == '*' && pattern[1] == '.')
|
|
|
0c7016 |
{
|
|
|
0c7016 |
char *check_hostname = &hostname[ strlen(hostname) - pattern_length+1 ];
|
|
|
0c7016 |
--
|
|
|
0c7016 |
2.5.5
|
|
|
0c7016 |
|