From 75da8751b1e5a5a39f8743b44971224b0ab34c31 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 24 Apr 2004 12:25:10 +0000 Subject: Move duplicated IO::Handle preperations for GnuPG::Interface to Echolot::Tools::make_gpg_fds. --- Echolot/Pinger/CPunk.pm | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'Echolot/Pinger') diff --git a/Echolot/Pinger/CPunk.pm b/Echolot/Pinger/CPunk.pm index 08bed0c..1aa8f07 100644 --- a/Echolot/Pinger/CPunk.pm +++ b/Echolot/Pinger/CPunk.pm @@ -19,7 +19,6 @@ This package provides functions for sending cypherpunk (type I) pings. use strict; use English; use GnuPG::Interface; -use IO::Handle; use Echolot::Log; sub encrypt_to($$$$) { @@ -40,18 +39,7 @@ sub encrypt_to($$$$) { homedir => Echolot::Config::get()->{'gnupghome'} ); $GnuPG->options->meta_interactive( 0 ); - my ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh ) - = ( IO::Handle->new(), - IO::Handle->new(), - IO::Handle->new(), - IO::Handle->new(), - ); - my $handles = GnuPG::Handles->new ( - stdin => $stdin_fh, - stdout => $stdout_fh, - stderr => $stderr_fh, - status => $status_fh - ); + my ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh, $handles ) = Echolot::Tools::make_gpg_fds(); my $pid = $GnuPG->wrap_call( commands => [ '--import' ], command_args => [qw{--no-options --no-secmem-warning --no-default-keyring --fast-list-mode --keyring}, $keyring, '--', '-' ], @@ -87,18 +75,7 @@ sub encrypt_to($$$$) { $GnuPG->options->hash_init( armor => 1 ); - ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh ) - = ( IO::Handle->new(), - IO::Handle->new(), - IO::Handle->new(), - IO::Handle->new(), - ); - $handles = GnuPG::Handles->new ( - stdin => $stdin_fh, - stdout => $stdout_fh, - stderr => $stderr_fh, - status => $status_fh - ); + ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh, $handles ) = Echolot::Tools::make_gpg_fds(); my $command_args = [qw{--no-options --no-secmem-warning --always-trust --no-default-keyring --textmode --cipher-algo 3DES --keyring}, $keyring, '--recipient', $recipient]; my $plaintextfile; -- cgit v1.2.3