Debian lenny version packages
[pkg-perl] / deb-src / libio-socket-ssl-perl / libio-socket-ssl-perl-1.16 / debian / patches / partial_hostname_fix.patch
diff --git a/deb-src/libio-socket-ssl-perl/libio-socket-ssl-perl-1.16/debian/patches/partial_hostname_fix.patch b/deb-src/libio-socket-ssl-perl/libio-socket-ssl-perl-1.16/debian/patches/partial_hostname_fix.patch
new file mode 100644 (file)
index 0000000..116a858
--- /dev/null
@@ -0,0 +1,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