From owner-svn-ports-all@FreeBSD.ORG Sun Aug 3 08:41:27 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD010AA0 for ; Sun, 3 Aug 2014 08:41:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCA312ECF for ; Sun, 3 Aug 2014 08:41:27 +0000 (UTC) Received: from pi (uid 1338) (envelope-from pi@svn.freebsd.org) id 6035 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 08:41:26 +0000 From: Kurt Jaeger Date: Sun, 3 Aug 2014 08:41:26 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r363856 - in head/security/tinyca: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ddf5b7.6035.526c16ce@svn.freebsd.org> X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 08:41:27 -0000 Author: pi Date: Sun Aug 3 08:41:26 2014 New Revision: 363856 URL: http://svnweb.freebsd.org/changeset/ports/363856 QAT: https://qat.redports.org/buildarchive/r363856/ Log: security/tinyca: 0.7.5 -> 0.7.6, new distsite PR: 189762 Submitted by: timp87@gmail.com Approved by: jmohacsi@bsd.hu (maintainer timeout) Added: head/security/tinyca/files/patch-GUI.pm (contents, props changed) head/security/tinyca/files/patch-OpenSSL.pm (contents, props changed) Modified: head/security/tinyca/Makefile head/security/tinyca/distinfo head/security/tinyca/pkg-descr Modified: head/security/tinyca/Makefile ============================================================================== --- head/security/tinyca/Makefile Sun Aug 3 08:07:20 2014 (r363855) +++ head/security/tinyca/Makefile Sun Aug 3 08:41:26 2014 (r363856) @@ -1,23 +1,21 @@ -# Created by: Janos.Mohacsi@bsd.hu # $FreeBSD$ PORTNAME= tinyca -PORTVERSION= 0.7.5 -PORTREVISION= 5 +PORTVERSION= 0.7.6 CATEGORIES= security net -MASTER_SITES= http://tinyca.sm-zone.net/ \ - http://tinyca.sm-zone.net/old/ -DISTNAME= ${PORTNAME}2-${PORTVERSION} +MASTER_SITES= http://opsec.eu/src/${PORTNAME}/ MAINTAINER= jmohacsi@bsd.hu COMMENT= Simple graphical interface to manage a small Certification Authority +LICENSE= GPLv2 + RUN_DEPENDS= p5-Gtk2>=0:${PORTSDIR}/x11-toolkits/p5-Gtk2 \ p5-Locale-gettext>=0:${PORTSDIR}/devel/p5-Locale-gettext \ zip:${PORTSDIR}/archivers/zip \ p5-MIME-Base64>=0:${PORTSDIR}/converters/p5-MIME-Base64 -USES= perl5 tar:bzip2 shebangfix +USES= perl5 tar:xz shebangfix USE_OPENSSL= yes SHEBANG_FILES= tinyca2 NO_BUILD= yes Modified: head/security/tinyca/distinfo ============================================================================== --- head/security/tinyca/distinfo Sun Aug 3 08:07:20 2014 (r363855) +++ head/security/tinyca/distinfo Sun Aug 3 08:41:26 2014 (r363856) @@ -1,2 +1,2 @@ -SHA256 (tinyca2-0.7.5.tar.bz2) = dc7d8180bf1db572fa4b08e15ecf8a47fc1c5bfdb55109bf2b3a54f86e5e60b7 -SIZE (tinyca2-0.7.5.tar.bz2) = 172779 +SHA256 (tinyca-0.7.6.tar.xz) = 0910899d8461791bf60d44080c2ff283c629d49524d1bd748d274fd845cf652e +SIZE (tinyca-0.7.6.tar.xz) = 104760 Added: head/security/tinyca/files/patch-GUI.pm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/tinyca/files/patch-GUI.pm Sun Aug 3 08:41:26 2014 (r363856) @@ -0,0 +1,103 @@ +--- lib/GUI.pm-orig 2014-07-20 22:28:16.000000000 +0200 ++++ lib/GUI.pm 2014-07-20 22:33:27.000000000 +0200 +@@ -992,7 +992,7 @@ + $piter = $store->append($root); + $store->set($piter, 0 => $t); + +- for my $l qw(CN EMAIL O OU C ST L) { ++ for my $l (qw(CN EMAIL O OU C ST L)) { + if(defined($parsed->{$l})) { + if($l eq "OU") { + foreach my $ou (@{$parsed->{'OU'}}) { +@@ -1017,7 +1017,7 @@ + $piter = $store->append($root); + $store->set($piter, 0 => $t); + +- for my $l qw(CN EMAIL O OU C ST L) { ++ for my $l (qw(CN EMAIL O OU C ST L)) { + if(defined($parsed->{'ISSUERDN'}->{$l})) { + if($l eq "OU") { + foreach my $ou (@{$parsed->{'ISSUERDN'}->{'OU'}}) { +@@ -1043,7 +1043,7 @@ + $piter = $store->append($root); + $store->set($piter, 0 => $t); + +- for my $l qw(STATUS NOTBEFORE NOTAFTER) { ++ for my $l (qw(STATUS NOTBEFORE NOTAFTER)) { + if(defined($parsed->{$l})) { + $citer = $store->append($piter); + $store->set($citer, +@@ -1059,7 +1059,7 @@ + $store->set($piter, 0 => $t); + + +- for my $l qw(STATUS SERIAL KEYSIZE PK_ALGORITHM SIG_ALGORITHM TYPE) { ++ for my $l (qw(STATUS SERIAL KEYSIZE PK_ALGORITHM SIG_ALGORITHM TYPE)) { + if(defined($parsed->{$l})) { + $citer = $store->append($piter); + $store->set($citer, +@@ -1074,7 +1074,7 @@ + $piter = $store->append($root); + $store->set($piter, 0 => $t); + +- for my $l qw(FINGERPRINTMD5 FINGERPRINTSHA1) { ++ for my $l (qw(FINGERPRINTMD5 FINGERPRINTSHA1)) { + if(defined($parsed->{$l})) { + $citer = $store->append($piter); + $store->set($citer, +@@ -1263,7 +1263,7 @@ + # table for request data + my $cc=0; + my $ous = 1; +- if(defined($opts->{'OU'})) { ++ if(defined($opts->{'OU'}) and ref($opts->{'OU'}) eq 'ARRAY') { + $ous = @{$opts->{'OU'}} - 1; + } + $reqtable = Gtk2::Table->new(1, 13 + $ous, 0); +@@ -1311,7 +1311,7 @@ + _("Organization Name (eg. company):"), + \$opts->{'O'}, $reqtable, 10, 1); + +- if(defined($opts->{'OU'})) { ++ if(defined($opts->{'OU'}) and ref($opts->{'OU'}) eq 'ARRAY') { + foreach my $ou (@{$opts->{'OU'}}) { + $entry = GUI::HELPERS::entry_to_table( + _("Organizational Unit Name (eg. section):"), +@@ -2545,7 +2545,7 @@ + return; + } + +- $aboutdialog->set_name("TinyCA2"); ++ $aboutdialog->set_program_name("TinyCA2"); + $aboutdialog->set_version($main->{'version'}); + $aboutdialog->set_copyright("2002-2006 Stephan Martin"); + $aboutdialog->set_license("GNU Public License (GPL)"); +@@ -2558,6 +2558,8 @@ + _("French: Thibault Le Meur ")); + + $aboutdialog->show_all(); ++ $aboutdialog->run; ++ $aboutdialog->destroy; + + return; + } +@@ -2658,7 +2660,7 @@ + + my ($box, $button_ok, $button_cancel, $t); + +- $t = _("The Certificate will be longer valid than your CA!"); ++ $t = _("The certificate will be valid longer than its CA!"); + $t .= "\n"; + $t .= _("This may cause problems with some software!!"); + +@@ -3118,9 +3120,9 @@ + for $value (keys %values) { + my $display_name = $values{$value}; + my $key = Gtk2::RadioButton->new($previous_key, $display_name); +- $key->set_active(1) if(defined($$var) && $$var eq $value); + $key->signal_connect('toggled' => + sub{GUI::CALLBACK::toggle_to_var($key, $var, $value)}); ++ $key->set_active(1) if(defined($$var) && $$var eq $value); + $radiobox->add($key); + $previous_key = $key; + } Added: head/security/tinyca/files/patch-OpenSSL.pm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/tinyca/files/patch-OpenSSL.pm Sun Aug 3 08:41:26 2014 (r363856) @@ -0,0 +1,142 @@ +--- lib/OpenSSL.pm.orig ++++ lib/OpenSSL.pm +@@ -22,6 +22,7 @@ + + use POSIX; + use IPC::Open3; ++use IO::Select; + use Time::Local; + + sub new { +@@ -41,7 +42,7 @@ + close(TEST); + + # set version (format: e.g. 0.9.7 or 0.9.7a) +- if($v =~ /\b(0\.9\.[678][a-z]?)\b/) { ++ if($v =~ /\b(0\.9\.[6-9][a-z]?)\b/ || $v =~ /\b(1\.0\.[01][a-z]?)\b/) { + $self->{'version'} = $1; + } + +@@ -817,7 +818,7 @@ + my $self = shift; + my $opts = { @_ }; + +- my ($tmp, $ext, $ret, $file, $pid, $cmd); ++ my ($tmp, $ext, $ret, $file, $pid, $cmd, $cmdout, $cmderr); + $file = HELPERS::mktmp($self->{'tmp'}."/data"); + + $cmd = "$self->{'bin'} $opts->{'cmd'}"; +@@ -830,16 +831,7 @@ + $cmd .= " -outform $opts->{'outform'}"; + } + +- my($rdfh, $wtfh); +- $ext = "$cmd\n\n"; +- $pid = open3($wtfh, $rdfh, $rdfh, $cmd); +- print $wtfh "$opts->{'data'}\n"; +- while(<$rdfh>){ +- $ext .= $_; +- # print STDERR "DEBUG: cmd ret: $_"; +- }; +- waitpid($pid, 0); +- $ret = $?>>8; ++ ($ret, $tmp, $ext) = _run_with_fixed_input($cmd, $opts->{'data'}); + + if($self->{'broken'}) { + if(($ret != 0 && $opts->{'cmd'} ne 'crl') || +@@ -859,14 +851,15 @@ + } + } + +- open(IN, $file) || do { +- my $t = sprintf(_("Can't open file %s: %s"), $file, $!); +- GUI::HELPERS::print_warning($t); +- return; +- }; +- $tmp .= $_ while(); +- close(IN); +- ++ if (-s $file) { # If the file is empty, the payload is in $tmp (via STDOUT of the called process). ++ open(IN, $file) || do { ++ my $t = sprintf(_("Can't open file %s: %s"), $file, $!); ++ GUI::HELPERS::print_warning($t); ++ return; ++ }; ++ $tmp .= $_ while(); ++ close(IN); ++ } + unlink($file); + + return($ret, $tmp, $ext); +@@ -1076,4 +1069,72 @@ + } + } + ++ ++=over ++ ++=item _run_with_fixed_input($cmd, $input) ++ ++This function runs C<$cmd> and writes the C<$input> to STDIN of the ++new process (all at once). ++ ++While the command runs, all of its output to STDOUT and STDERR is ++collected. ++ ++After the command terminates (closes both STDOUT and STDIN) the ++function returns the command's return value as well as everything it ++wrote to its STDOUT and STDERR in a list. ++ ++=back ++ ++=cut ++ ++sub _run_with_fixed_input { ++ my $cmd = shift; ++ my $input = shift; ++ ++ my ($wtfh, $rdfh, $erfh, $pid, $sel, $ret, $stdout, $stderr); ++ $erfh = Symbol::gensym; # Must not be false, otherwise it is lumped together with rdfh ++ ++ # Run the command ++ $pid = open3($wtfh, $rdfh, $erfh, $cmd); ++ print $wtfh $input, "\n"; ++ ++ $stdout = ''; ++ $stderr = ''; ++ $sel = new IO::Select($rdfh, $erfh); ++ while (my @fhs = $sel->can_read()) { ++ foreach my $fh (@fhs) { ++ if ($fh == $rdfh) { # STDOUT ++ my $bytes_read = sysread($fh, my $buf='', 1024); ++ if ($bytes_read == -1) { ++ warn("Error reading from child's STDOUT: $!\n"); ++ $sel->remove($fh); ++ } elsif ($bytes_read == 0) { ++ # print("Child's STDOUT closed.\n"); ++ $sel->remove($fh); ++ } else { ++ $stdout .= $buf; ++ } ++ } ++ elsif ($fh == $erfh) { # STDERR ++ my $bytes_read = sysread($fh, my $buf='', 1024); ++ if ($bytes_read == -1) { ++ warn("Error reading from child's STDERR: $!\n"); ++ $sel->remove($fh); ++ } elsif ($bytes_read == 0) { ++ # print("Child's STDERR closed.\n"); ++ $sel->remove($fh); ++ } else { ++ $stderr .= $buf; ++ } ++ } ++ } ++ } ++ ++ waitpid($pid, 0); ++ $ret = $?>>8; ++ ++ return ($ret, $stdout, $stderr) ++ } ++ Modified: head/security/tinyca/pkg-descr ============================================================================== --- head/security/tinyca/pkg-descr Sun Aug 3 08:07:20 2014 (r363855) +++ head/security/tinyca/pkg-descr Sun Aug 3 08:41:26 2014 (r363856) @@ -18,6 +18,4 @@ Currently TinyCA supports the following * Certificate Revocation List o CRLs can be exported as: PEM, DER and TXT -WWW: http://tinyca.sm-zone.net/ - -Janos Mohacsi +WWW: http://tinyca.sm-zone.net/ (no longer available)