From cdfc47a7e1357f76047015704ee61fe25d3c8f01 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Thu, 30 Nov 2017 20:12:22 -0700 Subject: [PATCH] avoid declaring unused vars for stdin --- lib/App/GroupSecret/Crypt.pm | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/lib/App/GroupSecret/Crypt.pm b/lib/App/GroupSecret/Crypt.pm index 9016348..a7110f7 100644 --- a/lib/App/GroupSecret/Crypt.pm +++ b/lib/App/GroupSecret/Crypt.pm @@ -37,10 +37,9 @@ sub generate_secure_random_bytes { my @cmd = (qw{openssl rand}, $size); - my ($in, $out); - my $pid = open2($out, $in, @cmd); + my $out; + my $pid = open2($out, undef, @cmd); - close($in); waitpid($pid, 0); my $status = $?; @@ -63,10 +62,8 @@ sub read_openssh_public_key { my @cmd = (qw{ssh-keygen -e -m PKCS8 -f}, $filepath); - my ($in, $out); - my $pid = open2($out, $in, @cmd); - - close($in); + my $out; + my $pid = open2($out, undef, @cmd); waitpid($pid, 0); my $status = $?; @@ -141,10 +138,8 @@ sub decrypt_rsa { my @cmd = (qw{openssl rsautl -decrypt -oaep -in}, $filepath, '-inkey', $privkey); push @cmd, ('-out', $outfile) if $outfile; - my ($in, $out); - my $pid = open2($out, $in, @cmd); - - close($in); + my $out; + my $pid = open2($out, undef, @cmd); waitpid($pid, 0); my $status = $?; @@ -189,10 +184,8 @@ sub encrypt_rsa { my @cmd = (qw{openssl rsautl -encrypt -oaep -pubin -inkey}, $keypath, '-in', $filepath); push @cmd, ('-out', $outfile) if $outfile; - my ($in, $out); - my $pid = open2($out, $in, @cmd); - - close($in); + my $out; + my $pid = open2($out, undef, @cmd); waitpid($pid, 0); my $status = $?; -- 2.45.2