Hello community, here is the log from the commit of package perl-IO-Socket-SSL for openSUSE:Factory checked in at Tue Oct 18 14:27:00 CEST 2011.
-------- --- openSUSE:Factory/perl-IO-Socket-SSL/perl-IO-Socket-SSL.changes 2011-09-23 12:37:30.000000000 +0200 +++ /mounts/work_src_done/STABLE/perl-IO-Socket-SSL/perl-IO-Socket-SSL.changes 2011-10-17 16:44:21.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Oct 17 01:35:42 UTC 2011 - vci...@suse.com + +- update to 1.45 +- fix readline to continue when getting interrupt waiting for more + data. Thanks to kgc[AT]corp[DOT]sonic[DOT]net for reporting problem + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- IO-Socket-SSL-1.44.tar.gz New: ---- IO-Socket-SSL-1.45.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-IO-Socket-SSL.spec ++++++ --- /var/tmp/diff_new_pack.EJxhiK/_old 2011-10-18 14:26:56.000000000 +0200 +++ /var/tmp/diff_new_pack.EJxhiK/_new 2011-10-18 14:26:56.000000000 +0200 @@ -18,7 +18,7 @@ Name: perl-IO-Socket-SSL -Version: 1.44 +Version: 1.45 Release: 1 License: GPL+ or Artistic %define cpan_name IO-Socket-SSL @@ -26,17 +26,17 @@ Url: http://search.cpan.org/dist/IO-Socket-SSL/ Group: Development/Libraries/Perl Source: http://www.cpan.org/authors/id/S/SU/SULLR/%{cpan_name}-%{version}.tar.gz -BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl -BuildRequires: perl-macros -BuildRequires: perl(Net::SSLeay) >= 1.21 -Requires: perl(Net::SSLeay) >= 1.21 # MANUAL BEGIN BuildRequires: perl(IO::Socket::INET6) BuildRequires: perl(Net::LibIDN) +BuildRequires: perl(Net::SSLeay) >= 1.21 +BuildRequires: perl-macros +Requires: perl(Net::SSLeay) >= 1.21 Recommends: perl(IO::Socket::INET6) Recommends: perl(Net::LibIDN) +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch # MANUAL END %{perl_requires} @@ -64,8 +64,8 @@ %setup -q -n %{cpan_name}-%{version} %build -%{__perl} Makefile.PL INSTALLDIRS=vendor -%{__make} %{?_smp_mflags} +perl Makefile.PL INSTALLDIRS=vendor +make %{?_smp_mflags} %install %perl_make_install @@ -73,7 +73,7 @@ %perl_gen_filelist %clean -%{__rm} -rf %{buildroot} +rm -rf %{buildroot} %files -f %{name}.files %defattr(-,root,root,755) ++++++ IO-Socket-SSL-1.44.tar.gz -> IO-Socket-SSL-1.45.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-SSL-1.44/Changes new/IO-Socket-SSL-1.45/Changes --- old/IO-Socket-SSL-1.44/Changes 2011-05-27 13:37:39.000000000 +0200 +++ new/IO-Socket-SSL-1.45/Changes 2011-10-12 11:03:23.000000000 +0200 @@ -1,4 +1,7 @@ +v1.45 2011.10.12 +- fix readline to continue when getting interrupt waiting for more + data. Thanks to kgc[AT]corp[DOT]sonic[DOT]net for reporting problem v1.44 2011.05.27 - fix invalid call to inet_pton in verify_hostname_of_cert when identity should be verified as ipv6 address, because it contains diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-SSL-1.44/MANIFEST new/IO-Socket-SSL-1.45/MANIFEST --- old/IO-Socket-SSL-1.44/MANIFEST 2011-05-27 13:38:31.000000000 +0200 +++ new/IO-Socket-SSL-1.45/MANIFEST 2011-10-13 06:31:29.000000000 +0200 @@ -42,5 +42,6 @@ t/inet6.t t/testlib.pl t/memleak_bad_handshake.t +t/signal-readline.t util/export_certs.pl META.yml Module meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-SSL-1.44/META.yml new/IO-Socket-SSL-1.45/META.yml --- old/IO-Socket-SSL-1.44/META.yml 2011-05-27 13:38:31.000000000 +0200 +++ new/IO-Socket-SSL-1.45/META.yml 2011-10-13 06:31:29.000000000 +0200 @@ -1,6 +1,6 @@ --- #YAML:1.0 name: IO-Socket-SSL -version: 1.44 +version: 1.45 abstract: Nearly transparent SSL encapsulation for IO::Socket::INET. author: - Steffen Ullrich & Peter Behroozi & Marko Asplund diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-SSL-1.44/SSL.pm new/IO-Socket-SSL-1.45/SSL.pm --- old/IO-Socket-SSL-1.44/SSL.pm 2011-05-27 13:37:46.000000000 +0200 +++ new/IO-Socket-SSL-1.45/SSL.pm 2011-10-13 06:29:31.000000000 +0200 @@ -78,7 +78,7 @@ }) { @ISA = qw(IO::Socket::INET); } - $VERSION = '1.44'; + $VERSION = '1.45'; $GLOBAL_CONTEXT_ARGS = {}; #Make $DEBUG another name for $Net::SSLeay::trace @@ -718,14 +718,27 @@ sub readline { my $self = shift; - my $ssl = $self->_get_ssl_object || return; - if (wantarray) { - my ($buf,$err) = Net::SSLeay::ssl_read_all($ssl); - return $self->error( "SSL read error" ) if $err; - if ( !defined($/) ) { - return $buf; - } elsif ( ref($/) ) { + if ( not defined $/ or wantarray) { + # read all and split + + my $buf = ''; + my $was_blocking = $self->blocking(1); + while (1) { + my $rv = $self->sysread($buf,2**16,length($buf)); + if ( ! defined $rv ) { + next if $!{EINTR} or $!{EAGAIN}; + $self->blocking(0) if ! $was_blocking; + return; + } elsif ( ! $rv ) { + last + } + } + $self->blocking(0) if ! $was_blocking; + + if ( ! defined $/ ) { + return $buf + } elsif ( ref($/)) { my $size = ${$/}; die "bad value in ref \$/: $size" unless $size>0; return $buf=~m{\G(.{1,$size})}g; @@ -736,59 +749,108 @@ } } - if ( !defined($/) ) { - my ($buf,$err) = Net::SSLeay::ssl_read_all($ssl); - return $self->error( "SSL read error" ) if $err; - return $buf; - } elsif ( ref($/) ) { + # read only one line + if ( ref($/) ) { my $size = ${$/}; + # read record of $size bytes die "bad value in ref \$/: $size" unless $size>0; - my ($buf,$err) = Net::SSLeay::ssl_read_all($ssl,$size); - return $self->error( "SSL read error" ) if $err; + my $buf = ''; + my $was_blocking = $self->blocking(1); + while ( $size>length($buf)) { + my $rv = $self->sysread($buf,$size-length($buf),length($buf)); + if ( ! defined $rv ) { + next if $!{EINTR} or $!{EAGAIN}; + $self->blocking(0) if ! $was_blocking; + return; + } elsif ( ! $rv ) { + last + } + } + $self->blocking(0) if ! $was_blocking; return $buf; - } elsif ( $/ ne '' ) { - my $line = Net::SSLeay::ssl_read_until($ssl,$/); - return $self->error( "SSL read error" ) if $line eq ''; - return $line; - } else { - # $/ is '' - # ^.*?\n\n+, need peek to find all \n at the end - die "empty \$/ is not supported if I don't have peek" - if Net::SSLeay::OPENSSL_VERSION_NUMBER() < 0x0090601f; + } - # find first occurence of \n\n + my ($delim0,$delim1) = $/ eq '' ? ("\n\n","\n"):($/,''); + + if ( Net::SSLeay::OPENSSL_VERSION_NUMBER() < 0x0090601f ) { + # no usable peek - need to read byte after byte + die "empty \$/ is not supported if I don't have peek" if $delim1 ne ''; my $buf = ''; - my $eon = 0; + my $was_blocking = $self->blocking(1); while (1) { - defined( Net::SSLeay::peek($ssl,1)) || last; # peek more, can block - my $pending = Net::SSLeay::pending($ssl); - $buf .= Net::SSLeay::peek( $ssl,$pending ); # will not block - if ( !$eon ) { - my $pos = index( $buf,"\n\n"); - next if $pos<0; # newlines not found - $eon = $pos+2; # pos after second newline - } - # $eon >= 2 == bytes incl last known \n - while ( index( $buf,"\n",$eon ) == $eon ) { - # the next char ist \n too - $eon++; - } - last if $eon < length($buf); # found last \n before end of buf - } - if ( $eon > 0 ) { - # found something - # readed peeked data until $eon from $ssl - return Net::SSLeay::ssl_read_all( $ssl,$eon ); + my $rv = $self->sysread($buf,1,length($buf)); + if ( ! defined $rv ) { + next if $!{EINTR} or $!{EAGAIN}; + $self->blocking(0) if ! $was_blocking; + return; + } elsif ( ! $rv ) { + last + } + index($buf,$delim0) >= 0 and last; + } + $self->blocking(0) if ! $was_blocking; + return $buf; + } + + + # find first occurence of $delim0 followed by as much as possible $delim1 + my $buf = ''; + my $eod = 0; # pointer into $buf after $delim0 $delim1* + my $was_blocking = $self->blocking(1); + my $ssl = $self->_get_ssl_object or return; + while (1) { + + # block until we have more data or eof + my $poke = Net::SSLeay::peek($ssl,1); + if ( ! defined $poke or $poke eq '' ) { + next if $!{EINTR} or $!{EAGAIN}; + } + + my $skip = 0; + + # peek into available data w/o reading + my $pending = Net::SSLeay::pending($ssl); + if ( $pending and my $pb = Net::SSLeay::peek( $ssl,$pending ) ) { + $buf .= $pb } else { - # found nothing - # return all what we have - if ( my $l = length($buf)) { - return Net::SSLeay::ssl_read_all( $ssl,$l ); + $self->blocking(0) if ! $was_blocking; + return; + }; + if ( !$eod ) { + my $pos = index( $buf,$delim0 ); + if ( $pos<0 ) { + $skip = $pending } else { - return $self->error( "SSL read error" ); + $eod = $pos + length($delim0); # pos after delim0 + } + } + + if ( $eod ) { + if ( $delim1 ne '' ) { + # delim0 found, check for as much delim1 as possible + while ( index( $buf,$delim1,$eod ) == $eod ) { + $eod+= length($delim1); + } } + $skip = $pending - ( length($buf) - $eod ); + } + + # remove data from $self which I already have in buf + while ( $skip>0 ) { + if ($self->sysread(my $p,$skip,0)) { + $skip -= length($p); + next; + } + $!{EINTR} or $!{EAGAIN} or last; + } + + if ( $eod and ( $delim1 eq '' or $eod < length($buf))) { + # delim0 found and there can be no more delim1 pending + last } } + $self->blocking(0) if ! $was_blocking; + return substr($buf,0,$eod); } sub close { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-SSL-1.44/t/signal-readline.t new/IO-Socket-SSL-1.45/t/signal-readline.t --- old/IO-Socket-SSL-1.44/t/signal-readline.t 1970-01-01 01:00:00.000000000 +0100 +++ new/IO-Socket-SSL-1.45/t/signal-readline.t 2011-10-12 09:10:05.000000000 +0200 @@ -0,0 +1,70 @@ +#!perl -w + +use strict; +use Net::SSLeay; +use Socket; +use IO::Socket::SSL; + +if ( grep { $^O =~m{$_} } qw( MacOS VOS vmesa riscos amigaos ) ) { + print "1..0 # Skipped: fork not implemented on this platform\n"; + exit +} + +use vars qw( $SSL_SERVER_ADDR ); +do "t/ssl_settings.req" || do "ssl_settings.req"; + +print "1..9\n"; + +my $server = IO::Socket::SSL->new( + LocalAddr => $SSL_SERVER_ADDR, + Listen => 2, + ReuseAddr => 1, + SSL_server => 1, + SSL_ca_file => "certs/test-ca.pem", + SSL_cert_file => "certs/server-wildcard.pem", + SSL_key_file => "certs/server-wildcard.pem", +); +warn "\$!=$!, \$\@=$@, S\$SSL_ERROR=$SSL_ERROR" if ! $server; +print "not ok\n", exit if !$server; +ok("Server Initialization"); +my $SSL_SERVER_PORT = $server->sockport; + +defined( my $pid = fork() ) || die $!; +if ( $pid == 0 ) { + + $SIG{HUP} = sub { ok("got hup") }; + + close($server); + my $client = IO::Socket::SSL->new( "$SSL_SERVER_ADDR:$SSL_SERVER_PORT" ) + || print "not "; + ok( "client ssl connect" ); + + my $line = <$client>; + print "not " if $line ne "foobar\n"; + ok("got line"); + + exit; +} + +my $csock = $server->accept; +ok("accept"); +$SIG{PIPE} = 'IGNORE'; + +syswrite($csock,"foo") or print "not "; +ok("wrote foo"); +sleep(1); + +kill HUP => $pid or print "not "; +ok("send hup"); +sleep(1); + +syswrite($csock,"bar\n") or print "not "; +ok("wrote bar\\n"); + +wait; +ok("wait: $?"); + + + +sub ok { print "ok #$_[0]\n"; } + continue with "q"... Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org