1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
Index: libio-socket-ssl-perl/SSL.pm
===================================================================
--- libio-socket-ssl-perl.orig/SSL.pm 2009-07-06 22:12:02.000000000 +0100
+++ libio-socket-ssl-perl/SSL.pm 2009-07-06 22:23:40.000000000 +0100
@@ -1036,7 +1036,7 @@
$ip4 = inet_aton( $identity ) or croak "'$identity' is not IPv4, but neither IPv6 nor hostname";
} else {
# assume hostname
- if ( $identity !~m{^[a-zA-Z0-9-_\.]+$} ) {
+ if ( $identity !~m{^[\w\-\.]+$} ) {
$identity = idn_to_ascii($identity) or
croak "Warning: Given name '$identity' could not be converted to IDNA!";
}
@@ -1058,7 +1058,7 @@
} elsif ( $wtyp eq 'leftmost' and $name =~m{^\*(\..+)$} ) {
$pattern = qr{^[\w\-]*\Q$1\E$}i;
} else {
- $pattern = qr{^\Q$name}i;
+ $pattern = qr{^\Q$name\E$}i;
}
return $identity =~ $pattern;
};
Index: libio-socket-ssl-perl/t/verify_hostname.t
===================================================================
--- libio-socket-ssl-perl.orig/t/verify_hostname.t 2009-07-06 22:12:02.000000000 +0100
+++ libio-socket-ssl-perl/t/verify_hostname.t 2009-07-06 22:24:08.000000000 +0100
@@ -88,6 +88,7 @@
'www-13.lala.other.local' => [],
'smtp.mydomain.local' => [qw(smtp ldap www)],
'xn--lwe-sna.idntest.local' => [qw(smtp ldap www)],
+ 'smtp.mydomain.localizing.useless.local' => [],
);
if ( $can_idn ) {
# check IDN handling
|