From: Charles McGarvey Date: Fri, 1 Dec 2017 03:12:22 +0000 (-0700) Subject: avoid declaring unused vars for stdin X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fgroupsecret;a=commitdiff_plain;h=cdfc47a7e1357f76047015704ee61fe25d3c8f01 avoid declaring unused vars for stdin --- 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 = $?;