File IO-Socket-SSL-1.16-verify_hostname.diff of Package perl-IO-Socket-SSL

--- SSL.pm
+++ SSL.pm
@@ -1078,7 +1078,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!";
 			}
@@ -1100,7 +1100,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;
 		};
--- t/verify_hostname.t
+++ t/verify_hostname.t
@@ -25,7 +25,7 @@
 	( eval { require Net::LibIDN } || eval { require Net::IDN::Encode } );
 
 $|=1;
-my $max = 37;
+my $max = 40;
 $max+=3 if $can_idn;
 print "1..$max\n";
 
@@ -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
openSUSE Build Service is sponsored by