GnuPG-0.19/0000755000175000017500000000000011742601276011747 5ustar yanickyanickGnuPG-0.19/MANIFEST0000644000175000017500000000065211742601276013103 0ustar yanickyanickCOPYING NEWS ChangeLog gpgmailtunl GnuPG.pm GnuPG/Tie.pm GnuPG/Tie/Encrypt.pm GnuPG/Tie/Decrypt.pm GnuPG/Tie/ClearSign.pm GnuPG/Tie/Sign.pm GnuPG.spec MANIFEST README Makefile.PL test.pl test/key1.pub test/key2.pub test/file.txt debian/changelog debian/copyright META.yml Module meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) GnuPG-0.19/gpgmailtunl0000644000175000017500000001445711662575230014231 0ustar yanickyanick#!/usr/bin/perl # # gpgmailtunl - Program that sends encrypted email. # # This file is part of GnuPG.pm. # # Author: Francis J. Lacoste # # Copyright (C) 1999, 2000 iNsu Innovations Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # use strict; use GnuPG; use Getopt::Long; sub usage() { die <; close SECRET; chomp $secret; return $secret; } sub encrypt($\%) { my ( $gpg, $opts ) = @_; my $from = $opts->{from}; $opts->{subject} ||= "Encrypted mail"; $opts->{recipient} ||= $opts->{to}; my $cmd = "/usr/sbin/sendmail -oi -t"; $cmd .= " -F\"$from\"" if $from; open( SENDMAIL, "|". $cmd ) or bounce( "error opening pipe to sendmail: $!" ); select SENDMAIL; $| = 1; print SENDMAIL "From: $from\n" if $from; print SENDMAIL <{to} Subject: $opts->{subject} EOF eval { $gpg->encrypt( output => \*SENDMAIL, armor => 1, sign => $opts->{sign}, passphrase => $opts->{passphrase}, recipient => $opts->{recipient}, "local-user" => $opts->{"local-user"}, ); }; bounce ( $@ ) if $@; close SENDMAIL or bounce( "error while waiting for sendmail: $!" ); exit 0; }; sub decrypt($\%) { my ( $gpg, $opts ) = @_; open( SENDMAIL, "|/usr/sbin/sendmail -oi -t" ) or bounce( "error opening pipe to sendmail: $!" ); select SENDMAIL; $| = 1; eval { $gpg->decrypt( output => \*SENDMAIL, passphrase => $opts->{passphrase}, ); }; bounce ( $@ ) if $@; close SENDMAIL or bounce( "error while waiting for sendmail: $!" ); exit 0; } my %opt = (); GetOptions( \%opt, "encrypt", "decrypt", "sign", "secret-file=s", "from=s", "to=s", "subject=s", "homedir=s", "local-user=s", "recipient=s", ) or usage; bounce( "can't use encrypt and decrypt at the same time" ) if $opt{encrypt} and $opt{decrypt}; if ( $opt{decrypt} ) { map { bounce( "conflicting options with encrypt: $_" ) if $opt{$_} } qw( to from subject sign recipient local-user ); } elsif ( $opt{encrypt} ) { bounce( "missing to option" ) unless $opt{to}; } else { bounce( "missing encrypt or decrypt" ); } $opt{passphrase} = read_secret( $opt{"secret-file"}) if $opt{"secret-file"}; my $gpg = new GnuPG( homedir => $opt{homedir} ); if ($opt{encrypt}) { encrypt $gpg, %opt; } else { decrypt $gpg, %opt; } __END__ =pod =head1 NAME gpgmailtunl - Encrypts an email message into the body of another email. =head1 SYNOPSIS gpgmailtunl [options] --encrypt | --decrypt =head1 DESCRIPTION B is a filter program that either encrypts an email message using the Gnu Privacy Guard and sends it to another recipient or decrypt an email message and forwards unencrypted to another destination. It can be used to exchange emails across an open network betweeen two trusted systems. =head1 TYPICAL USAGE This program is intended to run from program like B or B to create an email tunnel between two systems. Of course this is not as secure as using B as an end user program, it may be convenient in certain case. =head1 ENCRYPTION To encapsulates an email within another you pipe the message to B. =head2 OPTIONS GetOptions( \%opt, "encrypt", "decrypt", "sign", "secret-file=s", "from=s", "to=s", "subject=s", "homedir=s", "local-user=s", "recipient=s", ) or usage; =over =item to This is the address to which the encrypted message will be sent. This is the only required fields. =item recipient This sets the keyid that will be used to encrypt the outgoing message. If unset, B will try to find a key matching the B option. =item subject Sets the subject of the outgoing message. This defaults to "Encrypted mail". =item from Sets the From header line of the outgoing message which will contains the encrypted one. B will provides a default one if this is not set. =item sign If this option is used, the outgoing message will be signed. In this case you should probably use to B and B options. =item secret-file File from which the secret to unlock the private used to sign the message can be read. =item local-user The keyid of the user that should sign the outgoing message. The default user will be used if not specified. =item homedir Sets an alternate B home directory. (This is where the keyrings are stored.) =back =head1 DECRYPTION To extract an email to be forwarded to the final user you pipe the encrypted email to B using the B switch. Once decrypted, the encapsulated email message will be sent to the original destinator of the message. =head2 OPTIONS =over =item homedir Sets an alternate B home directory. (This is where the keyrings are stored.) =item secret-file File from which the secret to unlock the private used to decrypt the message can be read. =back =head1 AUTHOR Francis J. Lacoste =head1 COPYRIGHT Copyright (c) 1999, 2000 iNsu Innovations Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. =head1 SEE ALSO gpg(1) gpgmailtunl(1) GnuPG(3) =cut GnuPG-0.19/META.yml0000644000175000017500000000064511742601276013225 0ustar yanickyanick--- abstract: unknown author: - unknown build_requires: ExtUtils::MakeMaker: 0 configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120630' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: GnuPG no_index: directory: - t - inc requires: {} version: 0.19 GnuPG-0.19/NEWS0000644000175000017500000000317211662575230012452 0ustar yanickyanick---------------------------------- Noteworthy changes in version 0.11 (2010-01-27) ---------------------------------- * Module can now run in Apache environment. * Fix Allows undef passphrases (for keys without them) ---------------------------------- Noteworthy changes in version 0.09 (2001-06-08) ---------------------------------- * Fix POSIX::_SC_OPEN_MAX problem under use strict. ---------------------------------- Noteworthy changes in version 0.08 (2001-05-21) ---------------------------------- * Updated for gnupg 1.0.5 * Tie implementation doesn't add an extra fork. Only one fork for the gpg process is done. * Added ClearSign and Sign tie interface. ---------------------------------- Noteworthy changes in version 0.07 (2000-08-15) ---------------------------------- * Output to a file handle reference was broken. ---------------------------------- Noteworthy changes in version 0.06 (2000-08-06) ---------------------------------- * Local-user wasn't working. Thanks to Chris Andrews for reporting and fixing this. * Compatible with gpg 1.02. * Ignore warning about RSA or IDEA algorithms. Noteworthy changes in version 0.05 (2000-06-21) ----------------------------------- * Support for paragraph mode in tied interface. * Removed file descriptor leaks. * Made CPR interface more robust. Noteworthy changes in version 0.04 (1999-12-06) ----------------------------------- * Small bugfixes related to running under mod_perl. Noteworthy changes in version 0.03 (1999-11-30) ----------------------------------- * New tied file handle interface for encryption and decryption. * Small bugfixes. GnuPG-0.19/META.json0000644000175000017500000000141711742601276013373 0ustar yanickyanick{ "abstract" : "unknown", "author" : [ "unknown" ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120630", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "GnuPG", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : {} } }, "release_status" : "stable", "version" : "0.19" } GnuPG-0.19/test/0000755000175000017500000000000011742601276012726 5ustar yanickyanickGnuPG-0.19/test/key2.pub0000644000175000017500000000273511742576560014326 0ustar yanickyanick-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v0.9.8 (GNU/Linux) Comment: For info see http://www.gnupg.org mQGiBDeVz7YRBACMh6OEE5Mi9qJhKYDRHFAU+rJU+Rmf6+XS9+gHDyvfiyhnNu9Y vHZpq+cbbJZWzGReoi36fZTdT9OoNYvWspWFuvPGXG10H4f27YNe4XHcv6j5CGJs 5JT+D4e5mDMRD1SWuiXyqQ2i67Mg6WUWSb/0la2qHdnikWs6yLnfogfAPwCgmuA6 X+c+qcT2Vi2GzVONyNsWwlUD/26rjwThidcwEBDEbx+HABZaHdoyxEx/LsMgFixB yUEYEFNDg1eMiH3GMfShsC1JJ9uTb5mIHRZSCbG1LuSYPnsnKfOy4hwU3mzUyh/m nuvwtWmgpYuRFxT6kR2vh/cnyCaqnkE6FXVi76lTWsjydG9SQX3z/1yvST/hmbDk a3VHA/0duHaCSOK7QUYhmJOt006aVqmAXY4curscsKxkcN+uqrm8+oT7L+EE/l6y ZrClen/zD/VY7+qQSSrvqy/2fwRlP2ddpOWHyxGJDELR6ybrNxkvie4I8o00ASzU 5cUQ6y/0lZ7SQSYr93y/HhTWXnDARkpkhcoYAebphwt3o3ETkLRDaU5TTGludXgg RGlzdHJpYnV0aW9uIE1haW50YWluZXIgPERpc3RyaWJ1dGlvbi1NYWludGFpbmVy QGlOc3UuQ09NPohUBBMRAgAVBQI3lc+2AwsKAwMVAwIDFgIBAheAAAoJELLiGlwz fSxiMacAl20h4nEiXhHYULwOj1Yi+bRUpS4AnRiFUFGjmz01XfQolpLTZX02KDlR iEYEEBECAAYFAjeaJYgACgkQZeqbEaof/g3SNQCfU9HbVcleisIFY5d8CplT67nH 8sMAnjuzzg+FeUkyVKkSYJmna2zoO/hduQENBDeVz9EQBADXqypO8sr9SjotUFbn D5UZn5N6S9buGCOunGkHPN1EY77zVsNrlS8/7tCdXf0ruzR96ddnQPUiqEC3h+dX GF6S8SfnZ0CeMwKzPMiTA1z/05evTPs57L7QraxcGMYYS3zOGK6HOThrHrCL8NOf Ets2b+m6ikYJbfe/pgLYsN2VnwADBQP/eE7GzOp2MSGReaYk5WAlMMPHayPZ4dCI BvDrjct1CsJ3iY2t4HNc3bWimfaJBCLHmeO8ss8gsRC3vsVmcjVf/ZGUzjoCWCnO K/GRN1Y7w3cU9sof09axE/K80RrsPchsN/2lmxwkTrMA2Orc9e+kNrSgsjVZEfZX 28qBR8EUV2qIRgQYEQIABgUCN5XP0QAKCRCy4hpcM30sYkf3AJ9y95o395iqCurJ 0FbeyuUOwcwtBACdGYZIE8rG27CLbWiPmhp3FBlGkVw= =XPx2 -----END PGP PUBLIC KEY BLOCK----- GnuPG-0.19/test/key1.pub0000644000175000017500000000257011742576560014322 0ustar yanickyanick-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v0.9.8 (GNU/Linux) Comment: For info see http://www.gnupg.org mQGiBDeU1ukRBADh1VURgNw04SaxRsjdX6Metnf5thHn38Yky3L4k+hNfHQDPYQf M/AiQsPJBuuy5oVF+TG5mxhKVvTW6wTVxPRMlPmJTgzAxw+VNLuJi2n1fTA9PFMC 2QSo4KesV5/9N33lunXd1MtNbXSmsj5iZnYBnxLupnzZFivwPAvn1Bt2AwCgzNhz OTt9rpf4X8s3xm6HODZQAqcD/iFjxQCfLtcvZY2gSjPljzzZMFu+IYmwVoPRbx+S 5z71gvk4yS0FQv3eCRscO25Y1d+VlxEawB1bUeUbS8s9cJIHxNY99PFGUrHAY7UD CHNHuaNrp/qmVitUXPEQrbTDbCNnLLo3U3f4mJS09nJfey+pS3yS6yn0PeYeeNxH RRYnBAC8MkvrbNNxCZwhPx5rQpoIIEhwv0qi2fQNRhA/iY+Ier/axmi7NUToXcZw oXgtd1oyyl4uwd8JXDtDaN23ypTdwPfV2QZpiFTOavr6W5cvPIYCJuEqEu4KnASB n0SHUg0v3VTxF+BkUGUekj0I6H/jA2nkBsGkzjLP1wD9SRX0ALRARnJhbmNpcyBK LiBMYWNvc3RlIChWUCBEZXZlbG9wcGVtZW50KSA8ZnJhbmNpcy5sYWNvc3RlQGlO c3UuQ09NPohVBBMRAgAVBQI3lNbpAwsKAwMVAwIDFgIBAheAAAoJEGXqmxGqH/4N AFgAnRaTNOYhLCBTHaRy/FL6z3mBnuiBAKCIsQ33bwbq3CTvQL62S1eyGxLOGbkB DQQ3lNbxEAQAoFrCper2v68jhnNh/R9Yp9CEV+pR1MZj0uzB26rUwqTeUz8/mhnQ mfx/JNermbdyUHnb5t0W+l/UjtOUfpsWeJz5bzIdr/BFS5TY4XhG0DG9XEyoqITx LaU3lURRg6XnEmv5rR6xfxRibUpW3vI2b4mBFBD1y5llFIr+nM8ToAsAAwUD/3G8 LM14bHz9BJr5e9x5xDn6XPgj1jVsl0TultfQbu7smMp3hikVhYpJvBRfhDvdYFpC 9/ivdl48xpCenNdGl7mZFX7CVaYfA4TwQZHHR1vVwDdC528PAZYZriz9RdrCUp/h jYNwjSYu1IMJx6eVrjvkBhkGyReBWrpkDW2UDRC4iEYEGBECAAYFAjeU1vEACgkQ ZeqbEaof/g2f/wCgr936xzKD/c0lVEEgBh7AYG1RaUAAn0iCYZ/Z2cZj3olsfn3h 1LRPC6MO =L2St -----END PGP PUBLIC KEY BLOCK----- GnuPG-0.19/test/file.txt0000644000175000017500000000001711742576560014413 0ustar yanickyanickThis is a test GnuPG-0.19/debian/0000755000175000017500000000000011742601276013171 5ustar yanickyanickGnuPG-0.19/debian/copyright0000644000175000017500000000124111662575230015123 0ustar yanickyanickThis package was debianized by Peter Palfrader on Fri, 3 Nov 2000 14:33:54 +0100. It was downloaded from http://www.cpan.org/modules/by-module/GnuPG/ Upstream Author: Francis J. Lacoste Copyright: Copyright (c) 1999, 2000 iNsu Innovations Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. On Debian systems the entire text of version 2 of the GPL can be found in /usr/share/common-licenses/GPL-2. GnuPG-0.19/debian/changelog0000644000175000017500000001052111662575230015043 0ustar yanickyanicklibgnupg-perl (0.9-9) unstable; urgency=low * Make/sh prefers "! [ -d foo ]" over "![ -d foo ]". It didn't really matter because there was a "|| rmdir foo" after that and the directory existed, but it prints ugly warnings that I missed before. -- Peter Palfrader Sun, 18 Jun 2006 01:32:22 +0200 libgnupg-perl (0.9-8) unstable; urgency=low * Move debhelper from Build-Depends-Indep to Build-Depends. * Apply patch by Andrew Suffield to handle key retrival by GnuPG caused by 'keyserver-options auto-key-retrieve' (closes: #269627). Thanks. * Apply patch by Andrew Suffield to properly propagte that reason for verification errors when the key is not around (closes: #310792). Thanks once more. * Instead of defining INSTALLBIN, INSTALLSCRIPT, etc just say INSTALLDIRS=vendor in debian/rules, and set PREFIX for the install. * Also use make install and not make pure_install. * Remove code to remove .packlist files from the install target. * Remove lots of comments (and unused, commented out lines) from debian/rules. * Remove usr/sbin from debian/dirs (debhelper). We don't put anything there. * Remove empty usr/lib/perl5 and usr/lib after make install. * Update Standards-Version to 3.7.2 from 3.6.1 (without additional changes). -- Peter Palfrader Sat, 17 Jun 2006 20:43:37 +0200 libgnupg-perl (0.9-7) unstable; urgency=low * GnuPG::Perl looks to be quite unmaintained upstream, so I recomment people use other modules, like GnuPG::Interface maybe, however apply Adrian's patch for his POLICY_URL problem. GnuPG.pm would complain about protocol violations when a signature had more information (like a POLICY_URL) than it expected (Closes: #316065). * Change from debhelper compat level 2 to 4, and change build depends accordingly. -- Peter Palfrader Sun, 10 Jul 2005 11:53:08 +0200 libgnupg-perl (0.9-6) unstable; urgency=low * GnuPG 1.2.5 introduced a few more status lines when decrypting/verifying files. GnuPG.pm would not handle that properly. We now eat all the status lines in decrypt_postread() (closes: #298556). -- Peter Palfrader Tue, 8 Mar 2005 20:55:41 +0100 libgnupg-perl (0.9-5) unstable; urgency=low * Change section to perl to fix override disparity. -- Peter Palfrader Sun, 25 Apr 2004 16:46:09 +0200 libgnupg-perl (0.9-4) unstable; urgency=low * Install non binary perl into usr/share rather than usr/lib. * Slight changes to debian/copyright: replace "author(s)" with "author", refer to GPL-2 rather than GPL. * Update standards version to 3.6.1. * Fix build dependency on debhelper: it needs to be versioned (>=2). * Don't end short desciprtion with a dot. -- Peter Palfrader Sun, 25 Apr 2004 15:27:54 +0200 libgnupg-perl (0.9-3) unstable; urgency=low * New Standards-Version: 3.5.7 - Have no /usr/doc link anymore (actually building against the new debhelper does fix this - I'll not depend on it tho to make building it on older releases easier) - Change Build-Depends to Build-Depends-Indep -- Peter Palfrader Mon, 11 Nov 2002 13:37:14 +0100 libgnupg-perl (0.9-2) unstable; urgency=low * Moved from non-US to main (Section: interpreters). -- Peter Palfrader Mon, 17 Jun 2002 20:25:34 +0200 libgnupg-perl (0.9-1) unstable; urgency=low * New upstream version (closes: #99647); * Upped Standards-Version to 3.5.4. * Applied patch to make it work under strict subs: @@ -267 +267 @@ - my $max_fd = POSIX::sysconf( POSIX::_SC_OPEN_MAX ) || 256; + my $max_fd = POSIX::sysconf( &POSIX::_SC_OPEN_MAX ) || 256; Thanks to Radu Muschevici (closes: #117689). * Also remove empty stuff from usr/lib/perl. -- Peter Palfrader Wed, 7 Nov 2001 17:23:00 +0100 libgnupg-perl (0.7-2) unstable; urgency=low * Fixed example in GnuPG::Tie manpage (closes: #90703). * Upped Standards-Version to 3.5.2. * Removed dependency on perl5. perl-base is essential and sufficent. -- Peter Palfrader Sun, 25 Mar 2001 21:07:14 +0200 libgnupg-perl (0.7-1) unstable; urgency=low * Initial Release (closes: #76184). -- Peter Palfrader Thu, 4 Jan 2001 02:21:44 +0100 GnuPG-0.19/GnuPG.pm0000644000175000017500000010172311742600222013257 0ustar yanickyanick# # GnuPG.pm - Interface to the GNU Privacy Guard. # # This file is part of GnuPG.pm. # # Author: Francis J. Lacoste # # Copyright (C) 2000 iNsu Innovations Inc. # Copyright (C) 2001 Francis J. Lacoste # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # package GnuPG; use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS ); BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw(); %EXPORT_TAGS = ( algo => [ qw( RSA_RSA DSA_ELGAMAL DSA RSA ) ], trust => [ qw( TRUST_UNDEFINED TRUST_NEVER TRUST_MARGINAL TRUST_FULLY TRUST_ULTIMATE ) ], ); Exporter::export_ok_tags( qw( algo trust ) ); $VERSION = '0.19'; } use constant RSA_RSA => 1; use constant DSA_ELGAMAL => 2; use constant DSA => 3; use constant RSA => 4; use constant TRUST_UNDEFINED => -1; use constant TRUST_NEVER => 0; use constant TRUST_MARGINAL => 1; use constant TRUST_FULLY => 2; use constant TRUST_ULTIMATE => 3; use Carp; use POSIX qw(); use Symbol; use Fcntl; sub parse_trust { for (shift) { /ULTIMATE/ && do { return TRUST_ULTIMATE; }; /FULLY/ && do { return TRUST_FULLY; }; /MARGINAL/ && do { return TRUST_MARGINAL; }; /NEVER/ && do { return TRUST_NEVER; }; # Default return TRUST_UNDEFINED; } } sub options($;$) { my $self = shift; $self->{cmd_options} = shift if ( $_[0] ); $self->{cmd_options}; } sub command($;$) { my $self = shift; $self->{command} = shift if ( $_[0] ); $self->{command}; } sub args($;$) { my $self = shift; $self->{args} = shift if ( $_[0] ); $self->{args}; } sub cmdline($) { my $self = shift; my $args = [ $self->{gnupg_path} ]; # Default options push @$args, "--no-tty" unless $self->{trace}; push @$args, "--no-greeting", "--yes", "--status-fd", fileno $self->{status_fd}, "--command-fd", fileno $self->{command_fd}; # Check for homedir and options file push @$args, "--homedir", $self->{homedir} if $self->{homedir}; push @$args, "--options", $self->{options} if $self->{options}; # Command options push @$args, @{ $self->options }; # Command and arguments push @$args, "--" . $self->command; push @$args, @{ $self->args }; return $args; } sub end_gnupg($) { my $self = shift; print STDERR "GnuPG: closing status fd " . fileno ($self->{status_fd}) . "\n" if $self->{trace}; close $self->{status_fd} or croak "error while closing pipe: $!\n"; print STDERR "GnuPG: closing command fd " . fileno ($self->{command_fd}) . "\n" if $self->{trace}; close $self->{command_fd} or croak "error while closing pipe: $!\n"; waitpid $self->{gnupg_pid}, 0 or croak "error while waiting for gpg: $!\n"; for ( qw(protocol gnupg_pid command options args status_fd command_fd input output next_status ) ) { delete $self->{$_}; } } sub abort_gnupg($$) { my ($self,$msg) = @_; # Signal our child that it is the end if ($self->{gnupg_pid} && kill 0 => $self->{gnupg_pid} ) { kill INT => $self->{gnupg_pid}; } $self->end_gnupg; confess ( $msg ); } # Used to push back status information sub next_status($$$) { my ($self,$cmd,$arg) = @_; $self->{next_status} = [$cmd,$arg]; } sub read_from_status($) { my $self = shift; # Check if a status was pushed back if ( $self->{next_status} ) { my $status = $self->{next_status}; $self->{next_status} = undef; return @$status; } print STDERR "GnuPG: reading from status fd " . fileno ($self->{status_fd}) . "\n" if $self->{trace}; my $fd = $self->{status_fd}; local $/ = "\n"; # Just to be sure my $line = <$fd>; unless ($line) { print STDERR "GnuPG: got from status fd: EOF" if $self->{trace}; return (); } print STDERR "GnuPG: got from status fd: $line" if $self->{trace}; my ( $cmd,$arg ) = $line =~ /\[GNUPG:\] (\w+) ?(.+)?$/; $self->abort_gnupg( "error communicating with gnupg: bad status line: $line\n" ) unless $cmd; print STDERR "GnuPG: Parsed as " . $cmd . " - " . $arg . "\n" if $self->{trace}; return wantarray ? ( $cmd, $arg ) : $cmd; } sub run_gnupg($) { my $self = shift; my $fd = gensym; my $wfd = gensym; my $crfd = gensym; # command read and write file descriptors my $cwfd = gensym; pipe $fd, $wfd or croak ( "error creating status pipe: $!\n" ); my $old = select $wfd; $| = 1; # Unbuffer select $old; pipe $crfd, $cwfd or croak ( "error creating command pipe: $!\n" ); $old = select $cwfd; $| = 1; # Unbuffer select $old; # Keep pipe open after close fcntl( $fd, F_SETFD, 0 ) or croak "error removing close on exec flag: $!\n" ; fcntl( $wfd, F_SETFD, 0 ) or croak "error removing close on exec flag: $!\n" ; fcntl( $crfd, F_SETFD, 0 ) or croak "error removing close on exec flag: $!\n" ; fcntl( $cwfd, F_SETFD, 0 ) or croak "error removing close on exec flag: $!\n" ; my $pid = fork; croak( "error forking: $!" ) unless defined $pid; if ( $pid ) { # Parent close $wfd; $self->{status_fd} = $fd; $self->{gnupg_pid} = $pid; $self->{command_fd} = $cwfd; } else { # Child $self->{status_fd} = $wfd; $self->{command_fd} = $crfd; my $cmdline = $self->cmdline; unless ( $self->{trace} ) { open (STDERR, "> /dev/null" ) or die "can't redirect stderr to /dev/null: $!\n"; } # This is where we grab the data if ( ref $self->{input} && defined fileno $self->{input} ) { open ( STDIN, "<&" . fileno $self->{input} ) or die "error setting up data input: $!\n"; } elsif ( $self->{input} && -t STDIN) { open ( STDIN, $self->{input} ) or die "error setting up data input: $!\n"; } elsif ( $self->{input} ) { push(@{$cmdline}, $self->{input}); }# Defaults to stdin # This is where the output goes if ( ref $self->{output} && defined fileno $self->{output} ) { open ( STDOUT, ">&" . fileno $self->{output} ) or die "can't redirect stdout to proper output fd: $!\n"; } elsif ( $self->{output} && -t STDOUT ) { open ( STDOUT, ">".$self->{output} ) or die "can't open $self->{output} for output: $!\n"; } elsif ( $self->{output} ) { my $gpg = shift(@{$cmdline}); unshift(@{$cmdline}, '--output', $self->{output}); unshift(@{$cmdline}, $gpg); } # Defaults to stdout # Close all open file descriptors except STDIN, STDOUT, STDERR # and the status filedescriptor. # # This is needed for the tie interface which opens pipes which # some ends must be closed in the child. # # Besides this is just plain good hygiene my $max_fd = POSIX::sysconf( &POSIX::_SC_OPEN_MAX ) || 256; foreach my $f ( 3 .. $max_fd ) { next if $f == fileno $self->{status_fd}; next if $f == fileno $self->{command_fd}; POSIX::close( $f ); } print STDERR 'GnuPG: executing `' . join( ' ', @{$cmdline} ) . '`' if $self->{trace}; exec ( @$cmdline ) or CORE::die "can't exec gnupg: $!\n"; } } sub cpr_maybe_send($$$) { ($_[0])->cpr_send( @_[1, $#_], 1); } sub cpr_send($$$;$) { my ($self,$key,$value, $optional) = @_; my $fd = $self->{command_fd}; my ( $cmd, $arg ) = $self->read_from_status; unless ( defined $cmd && $cmd =~ /^GET_/) { $self->abort_gnupg( "protocol error: expected GET_XXX got $cmd\n" ) unless $optional; $self->next_status( $cmd, $arg ); return; } unless ( $arg eq $key ) { $self->abort_gnupg ( "protocol error: expected key $key got $arg\n" ) unless $optional; return; } print STDERR "GnuPG: writing to command fd " . fileno ($fd) . ": $value\n" if $self->{trace}; print $fd $value . "\n"; ( $cmd, $arg ) = $self->read_from_status; unless ( defined $cmd && $cmd =~ /^GOT_IT/) { $self->next_status( $cmd, $arg ); } } sub send_passphrase($$) { my ($self,$passwd) = @_; # GnuPG should now tell us that it needs a passphrase my $cmd = $self->read_from_status; # Skip UserID hint $cmd = $self->read_from_status if ( $cmd =~ /USERID_HINT/ ); if ($cmd =~ /GOOD_PASSPHRASE/) { # This means we didnt need a passphrase $self->next_status($cmd); # We push this back on for read_from_status return; } $self->abort_gnupg( "Protocol error: expected NEED_PASSPHRASE.* got $cmd\n") unless $cmd =~ /NEED_PASSPHRASE/; $self->cpr_send( "passphrase.enter", $passwd ); unless ( $passwd ) { my $cmd = $self->read_from_status; $self->abort_gnupg( "Protocol error: expected MISSING_PASSPHRASE got $cmd\n" ) unless $cmd eq "MISSING_PASSPHRASE"; } } sub new($%) { my $proto = shift; my $class = ref $proto || $proto; my %args = @_; my $self = {}; if ($args{homedir}) { croak ( "Invalid home directory: $args{homedir}\n") unless -d $args{homedir} && -x _; $self->{homedir} = $args{homedir}; } if ($args{options}) { croak ( "Invalid options file: $args{options}\n") unless -r $args{options}; $self->{options} = $args{options}; } if ( $args{gnupg_path} ) { croak ( "Invalid gpg path: $args{gnupg_path}\n") unless -x $args{gnupg_path}; $self->{gnupg_path} = $args{gnupg_path}; } else { my ($path) = grep { -x "$_/gpg" } split /:/, $ENV{PATH}; croak ( "Couldn't find gpg in PATH ($ENV{PATH})\n" ) unless $path; $self->{gnupg_path} = "$path/gpg"; } $self->{trace} = $args{trace} ? 1 : 0; bless $self, $class; } sub DESTROY { my $self = shift; # Signal our child that it is the end if ($self->{gnupg_pid} && kill 0 => $self->{gnupg_pid} ) { kill INT => $self->{gnupg_pid}; } } sub gen_key($%) { my ($self,%args) = @_; my $cmd; my $arg; my $algo = $args{algo}; $algo ||= RSA_RSA; my $size = $args{size}; $size ||= 1024; croak ( "Keysize is too small: $size" ) if $size < 768; croak ( "Keysize is too big: $size" ) if $size > 2048; my $expire = $args{valid}; $expire ||= 0; my $passphrase = $args{passphrase} || ""; my $name = $args{name}; croak "Missing key name\n" unless $name; croak "Invalid name: $name\n" unless $name =~ /^\s*[^0-9\<\(\[\]\)\>][^\<\(\[\]\)\>]+$/; my $email = $args{email}; if ( $email ) { croak "Invalid email address: $email" unless $email =~ /^\s* # Whitespace are okay [a-zA-Z0-9_-] # Doesn't start with a dot [a-zA-Z0-9_.-]* \@ # Contains at most one at [a-zA-Z0-9_.-]+ [a-zA-Z0-9_-] # Doesn't end in a dot /x && $email !~ /\.\./; } else { $email = ""; } my $comment = $args{comment}; if ( $comment ) { croak "Invalid characters in comment" if $comment =~ /[()]/; } else { $comment = ""; } $self->command( "gen-key" ); $self->options( [] ); $self->args( [] ); $self->run_gnupg; $self->cpr_send("keygen.algo", $algo ); # if ( $algo == ELGAMAL ) { # # Shitty interactive program, yes I'm sure. # # I'm a program, I can't change my mind now. # $self->cpr_send( "keygen.algo.elg_se", 1 ) # } $self->cpr_send( "keygen.size", $size ); $self->cpr_send( "keygen.valid", $expire ); $self->cpr_send( "keygen.name", $name ); $self->cpr_send( "keygen.email", $email ); $self->cpr_send( "keygen.comment", $comment ); $self->send_passphrase( $passphrase ); $self->end_gnupg; # Woof. We should now have a generated key ! } sub import_keys($%) { my ($self,%args) = @_; $self->command( "import" ); $self->options( [] ); my $count; if ( ref $args{keys} ) { $self->args( $args{keys} ); } else { # Only one file to import $self->{input} = $args{keys}; $self->args( [] ); } $self->run_gnupg; FILE: my $num_files = ref $args{keys} ? @{$args{keys}} : 1; my ($cmd,$arg); # We will see one IMPORTED for each key that is imported KEY: while ( 1 ) { ($cmd,$arg) = $self->read_from_status; last KEY unless $cmd =~ /IMPORTED/; $count++ } # We will see one IMPORT_RES for all files processed $self->abort_gnupg ( "protocol error expected IMPORT_OK got $cmd\n" ) unless $cmd =~ /IMPORT_OK/; $self->end_gnupg; # We return the number of imported keys return $count; } sub export_keys($%) { my ($self,%args) = @_; my $options = []; push @$options, "--armor" if $args{armor}; $self->{output} = $args{output}; my $keys = []; if ( $args{keys}) { push @$keys, ref $args{keys} ? @{$args{keys}} : $args{keys}; } if ( $args{secret} ) { $self->command( "export-secret-keys" ); } elsif ( $args{all} ){ $self->command( "export-all" ); } else { $self->command( "export" ); } $self->options( $options ); $self->args( $keys ); $self->run_gnupg; $self->end_gnupg; } sub encrypt($%) { my ($self,%args) = @_; my $options = []; croak ( "no recipient specified\n" ) unless $args{recipient} or $args{symmetric}; for my $recipient ( ref $args{recipient} eq 'ARRAY' ? @{ $args{recipient} } : $args{recipient} ) { $recipient =~ s/ /\ /g; # Escape spaces in the recipient. This fills some strange edge case push @$options, "--recipient" => $recipient; } push @$options, "--sign" if $args{sign}; croak ( "can't sign an symmetric encrypted message\n" ) if $args{sign} and $args{symmetric}; my $passphrase = $args{passphrase} || ""; push @$options, "--armor" if $args{armor}; push @$options, "--local-user", $args{"local-user"} if defined $args{"local-user"}; $self->{input} = $args{plaintext} || $args{input}; $self->{output} = $args{output}; if ( $args{symmetric} ) { $self->command( "symmetric" ); } else { $self->command( "encrypt" ); } $self->options( $options ); $self->args( [] ); $self->run_gnupg; # Unless we decided to sign or are using symmetric cipher, we are done if ( $args{sign} or $args{symmetric} ) { $self->send_passphrase( $passphrase ); if ( $args{sign} ) { my ($cmd,$line) = $self->read_from_status; $self->abort_gnupg( "invalid passphrase - $cmd\n" ) unless $cmd =~ /GOOD_PASSPHRASE/; } } # It is possible that this key has no assigned trust value. # Assume the caller knows what he is doing. $self->cpr_maybe_send( "untrusted_key.override", 'y' ); $self->end_gnupg unless $args{tie_mode}; } sub sign($%) { my ($self,%args) = @_; my $options = []; my $passphrase = $args{passphrase} || ""; push @$options, "--armor" if $args{armor}; push @$options, "--local-user", $args{"local-user"} if defined $args{"local-user"}; $self->{input} = $args{plaintext} || $args{input}; $self->{output} = $args{output}; if ( $args{clearsign} ) { $self->command( "clearsign" ); } elsif ( $args{"detach-sign"}) { $self->command( "detach-sign" ); } else { $self->command( "sign" ); } $self->options( $options ); $self->args( [] ); $self->run_gnupg; # We need to unlock the private key $self->send_passphrase( $passphrase ); my ($cmd,$line) = $self->read_from_status; $self->abort_gnupg( "invalid passphrase - $cmd\n" ) unless $cmd =~ /GOOD_PASSPHRASE/; $self->end_gnupg unless $args{tie_mode}; } sub clearsign($%) { my $self = shift; $self->sign( @_, clearsign => 1 ); } sub check_sig($;$$) { my ( $self, $cmd, $arg) = @_; # Our caller may already have grabbed the first line of # signature reporting. ($cmd,$arg) = $self->read_from_status unless ( $cmd ); # Ignore patent warnings. ( $cmd, $arg ) = $self->read_from_status() if ( $cmd =~ /RSA_OR_IDEA/ ); # Ignore automatic key imports ( $cmd, $arg ) = $self->read_from_status() if ( $cmd =~ /IMPORTED/ ); ( $cmd, $arg ) = $self->read_from_status() if ( $cmd =~ /IMPORT_OK/ ); ( $cmd, $arg ) = $self->read_from_status() if ( $cmd =~ /IMPORT_RES/ ); $self->abort_gnupg( "invalid signature from ", $arg =~ /[^ ](.+)/, "\n" ) if ( $cmd =~ /BADSIG/); if ( $cmd =~ /ERRSIG/) { my ($keyid, $key_algo, $digest_algo, $sig_class, $timestamp, $rc) = split ' ', $arg; if ($rc == 9) { ($cmd, $arg) = $self->read_from_status(); $self->abort_gnupg( "no public key $keyid" ); } $self->abort_gnupg( "error verifying signature from $keyid" ) } $self->abort_gnupg ( "protocol error: expected SIG_ID" ) unless $cmd =~ /SIG_ID/; my ( $sigid, $date, $time ) = split /\s+/, $arg; ( $cmd, $arg ) = $self->read_from_status; $self->abort_gnupg ( "protocol error: expected GOODSIG" ) unless $cmd =~ /GOODSIG/; my ( $keyid, $name ) = split /\s+/, $arg, 2; ( $cmd, $arg ) = $self->read_from_status; my $policy_url = undef; if ( $cmd =~ /POLICY_URL/ ) { $policy_url = $arg; ( $cmd, $arg ) = $self->read_from_status; } $self->abort_gnupg ( "protocol error: expected VALIDSIG" ) unless $cmd =~ /VALIDSIG/; my ( $fingerprint ) = split /\s+/, $arg, 2; ( $cmd, $arg ) = $self->read_from_status; $self->abort_gnupg ( "protocol error: expected TRUST*" ) unless $cmd =~ /TRUST/; my ($trust) = parse_trust( $cmd ); return { sigid => $sigid, date => $date, timestamp => $time, keyid => $keyid, user => $name, fingerprint => $fingerprint, trust => $trust, policy_url => $policy_url, }; } sub verify($%) { my ($self,%args) = @_; croak ( "missing signature argument\n" ) unless $args{signature}; my $files = []; if ( $args{file} ) { croak ( "detached signature must be in a file\n" ) unless -f $args{signature}; push @$files, $args{signature}, ref $args{file} ? @{$args{file}} : $args{file}; } else { $self->{input} = $args{signature}; } $self->command( "verify" ); $self->options( [] ); $self->args( $files ); $self->run_gnupg; my $sig = $self->check_sig; $self->end_gnupg; return $sig; } sub decrypt($%) { my $self = shift; my %args = @_; $self->{input} = $args{ciphertext} || $args{input}; $self->{output} = $args{output}; $self->command( "decrypt" ); $self->options( [] ); $self->args( [] ); $self->run_gnupg; return $self->decrypt_postwrite( @_ ) unless $args{tie_mode}; } sub decrypt_postwrite($%) { my ($self,%args) = @_; my $passphrase = $args{passphrase} || ""; my ( $cmd, $arg ); unless ( $args{symmetric} ) { ( $cmd, $arg ) = $self->read_from_status; $self->abort_gnupg ( "protocol error: expected ENC_TO got $cmd: \n" ) unless $cmd =~ /ENC_TO/; } $self->send_passphrase( $passphrase ); ($cmd,$arg) = $self->read_from_status; $self->abort_gnupg ( "invalid passphrase - $cmd\n" ) if $cmd =~ /BAD_PASSPHRASE/; my $sig = undef; if ( ! $args{symmetric} ) { $self->abort_gnupg ( "protocol error: expected GOOD_PASSPHRASE got $cmd: \n" ) unless $cmd =~ /GOOD_PASSPHRASE/; $sig = $self->decrypt_postread() unless $args{tie_mode}; } else { # gnupg 1.0.2 adds this status message ( $cmd, $arg ) = $self->read_from_status() if $cmd =~ /BEGIN_DECRYPTION/; # gnupg 1.4.12 adds this status message ( $cmd, $arg ) = $self->read_from_status() if $cmd =~ /DECRYPTION_INFO/; $self->abort_gnupg( "invalid passphrase - $cmd" ) unless $cmd =~ /PLAINTEXT/; } $self->end_gnupg() unless $args{tie_mode}; return $sig ? $sig : 1; } sub decrypt_postread($) { my $self = shift; my @cmds; # gnupg 1.0.2 adds this status message my ( $cmd, $arg ) = $self->read_from_status; push @cmds, $cmd; if ($cmd =~ /BEGIN_DECRYPTION/) { ( $cmd, $arg ) = $self->read_from_status(); push @cmds, $cmd; }; my $sig = undef; while (defined $cmd && !($cmd =~ /DECRYPTION_OKAY/)) { if ( $cmd =~ /SIG_ID/ ) { $sig = $self->check_sig( $cmd, $arg ); } ( $cmd, $arg ) = $self->read_from_status(); push @cmds, $cmd if defined $cmd; }; my $cmds = join ', ', @cmds; $self->abort_gnupg( "protocol error: expected DECRYPTION_OKAY but never got it (all I saw was: $cmds): \n" ) unless $cmd =~ /DECRYPTION_OKAY/; return $sig ? $sig : 1; } 1; __END__ =pod =head1 NAME GnuPG - Perl module interface to the GNU Privacy Guard (v1.x.x series) =head1 SYNOPSIS use GnuPG qw( :algo ); my $gpg = new GnuPG(); $gpg->encrypt( plaintext => "file.txt", output => "file.gpg", armor => 1, sign => 1, passphrase => $secret ); $gpg->decrypt( ciphertext => "file.gpg", output => "file.txt" ); $gpg->clearsign( plaintext => "file.txt", output => "file.txt.asc", passphrase => $secret, armor => 1, ); $gpg->verify( signature => "file.txt.asc", file => "file.txt" ); $gpg->gen_key( name => "Joe Blow", comment => "My GnuPG key", passphrase => $secret, ); =head1 DESCRIPTION GnuPG is a perl interface to the GNU Privacy Guard. It uses the shared memory coprocess interface that gpg provides for its wrappers. It tries its best to map the interactive interface of the gpg to a more programmatic model. =head1 API OVERVIEW The API is accessed through methods on a GnuPG object which is a wrapper around the B program. All methods takes their argument using named parameters, and errors are returned by throwing an exception (using croak). If you wan't to catch errors you will have to use eval. When handed in a file handle for input or output parameters on many of the functions, the API attempts to tie that handle to STDIN and STDOUT. In certain persistent environments (particularly a web environment), this will not work. This problem can be avoided by passing in file names to all relevant parameters rather than a Perl file handle. There is also a tied file handle interface which you may find more convenient for encryption and decryption. See GnuPG::Tie(3) for details. =head1 CONSTRUCTOR =head2 new ( [params] ) You create a new GnuPG wrapper object by invoking its new method. (How original !). The module will try to finds the B program in your path and will croak if it can't find it. Here are the parameters that it accepts : =over =item gnupg_path Path to the B program. =item options Path to the options file for B. If not specified, it will use the default one (usually F<~/.gnupg/options>). =item homedir Path to the B home directory. This is the directory that contains the default F file, the public and private key rings as well as the trust database. =item trace If this variable is set to true, B debugging output will be sent to stderr. =back Example: my $gpg = new GnuPG(); =head1 METHODS =head2 gen_key( [params] ) This methods is used to create a new gpg key pair. The methods croaks if there is an error. It is a good idea to press random keys on the keyboard while running this methods because it consumes a lot of entropy from the computer. Here are the parameters it accepts : =over =item algo This is the algorithm use to create the key. Can be I, I, I or I. It defaults to I. To import those constant in your name space, use the I<:algo> tag. =item size The size of the public key. Defaults to 1024. Cannot be less than 768 bits, and keys longer than 2048 are also discouraged. (You *DO* know that your monitor may be leaking sensitive information ;-). =item valid How long the key is valid. Defaults to 0 or never expire. =item name This is the only mandatory argument. This is the name that will used to construct the user id. =item email Optional email portion of the user id. =item comment Optional comment portion of the user id. =item passphrase The passphrase that will be used to encrypt the private key. Optional but strongly recommended. =back Example: $gpg->gen_key( algo => DSA_ELGAMAL, size => 1024, name => "My name" ); =head2 import_keys( [params] ) Import keys into the GnuPG private or public keyring. The method croaks if it encounters an error. It returns the number of keys imported. Parameters : =over =item keys Only parameter and mandatory. It can either be a filename or a reference to an array containing a list of files that will be imported. =back Example: $gpg->import_keys( keys => [ qw( key.pub key.sec ) ] ); =head2 export_keys( [params] ) Exports keys from the GnuPG keyrings. The method croaks if it encounters an error. Parameters : =over =item keys Optional argument that restricts the keys that will be exported. Can either be a user id or a reference to an array of userid that specifies the keys to be exported. If left unspecified, all keys will be exported. =item secret If this argument is to true, the secret keys rather than the public ones will be exported. =item all If this argument is set to true, all keys (even those that aren't OpenPGP compliant) will be exported. =item output This argument specifies where the keys will be exported. Can be either a file name or a reference to a file handle. If not specified, the keys will be exported to stdout. =item armor Set this parameter to true, if you want the exported keys to be ASCII armored. =back Example: $gpg->export_keys( armor => 1, output => "keyring.pub" ); =head2 encrypt( [params] ) This method is used to encrypt a message, either using assymetric or symmetric cryptography. The methods croaks if an error is encountered. Parameters: =over =item plaintext This argument specifies what to encrypt. It can be either a filename or a reference to a file handle. If left unspecified, STDIN will be encrypted. =item output This optional argument specifies where the ciphertext will be output. It can be either a file name or a reference to a file handle. If left unspecified, the ciphertext will be sent to STDOUT. =item armor If this parameter is set to true, the ciphertext will be ASCII armored. =item symmetric If this parameter is set to true, symmetric cryptography will be used to encrypt the message. You will need to provide a I parameter. =item recipient If not using symmetric cryptography, you will have to provide this parameter. It should contains the userid of the intended recipient of the message. It will be used to look up the key to use to encrypt the message. The parameter can also take an array ref, if you want to encrypt the message for a group of recipients. =item sign If this parameter is set to true, the message will also be signed. You will probably have to use the I parameter to unlock the private key used to sign message. This option is incompatible with the I one. =item local-user This parameter is used to specified the private key that will be used to sign the message. If left unspecified, the default user will be used. This option only makes sense when using the I option. =item passphrase This parameter contains either the secret passphrase for the symmetric algorithm or the passphrase that should be used to decrypt the private key. =back Example: $gpg->encrypt( plaintext => file.txt, output => "file.gpg", sign => 1, passphrase => $secret ); =head2 sign( [params] ) This method is used create a signature for a file or stream of data. This method croaks on errors. Parameters : =over =item plaintext This argument specifies what to sign. It can be either a filename or a reference to a file handle. If left unspecified, the data read on STDIN will be signed. =item output This optional argument specifies where the signature will be output. It can be either a file name or a reference to a file handle. If left unspecified, the signature will be sent to STDOUT. =item armor If this parameter is set to true, the signature will be ASCII armored. =item passphrase This parameter contains the secret that should be used to decrypt the private key. =item local-user This parameter is used to specified the private key that will be used to make the signature . If left unspecified, the default user will be used. =item detach-sign If set to true, a digest of the data will be signed rather than the whole file. =back Example: $gpg->sign( plaintext => "file.txt", output => "file.txt.asc", armor => 1, ); =head2 clearsign( [params] ) This methods clearsign a message. The output will contains the original message with a signature appended. It takes the same parameters as the B method. =head2 verify( [params] ) This method verifies a signature against the signed message. The methods croaks if the signature is invalid or an error is encountered. If the signature is valid, it returns an hash with the signature parameters. Here are the method's parameters : =over =item signature If the message and the signature are in the same file (i.e. a clearsigned message), this parameter can be either a file name or a reference to a file handle. If the signature doesn't follows the message, than it must be the name of the file that contains the signature. =item file This is a file name or a reference to an array of file names that contains the signed data. =back When the signature is valid, here are the elements of the hash that is returned by the method : =over =item sigid The signature id. This can be used to protect against replay attack. =item date The data at which the signature has been made. =item timestamp The epoch timestamp of the signature. =item keyid The key id used to make the signature. =item user The userid of the signer. =item fingerprint The fingerprint of the signature. =item trust The trust value of the public key of the signer. Those are values that can be imported in your namespace with the :trust tag. They are (TRUST_UNDEFINED, TRUST_NEVER, TRUST_MARGINAL, TRUST_FULLY, TRUST_ULTIMATE). =back Example : my $sig = $gpg->verify( signature => "file.txt.asc", file => "file.txt" ); =head2 decrypt( [params] ) This method decrypts an encrypted message. It croaks, if there is an error while decrypting the message. If the message was signed, this method also verifies the signature. If decryption is sucessful, the method either returns the valid signature parameters if present, or true. Method parameters : =over =item ciphertext This optional parameter contains either the name of the file containing the ciphertext or a reference to a file handle containing the ciphertext. If not present, STDIN will be decrypted. =item output This optional parameter determines where the plaintext will be stored. It can be either a file name or a reference to a file handle. If left unspecified, the plaintext will be sent to STDOUT. =item symmetric This should be set to true, if the message is encrypted using symmetric cryptography. =item passphrase The passphrase that should be used to decrypt the message (in the case of a message encrypted using a symmetric cipher) or the secret that will unlock the private key that should be used to decrypt the message. =back Example: $gpg->decrypt( ciphertext => "file.gpg", output => "file.txt" passphrase => $secret ); =head1 BUGS AND LIMITATIONS This module doesn't work (yet) with the v2 branch of GnuPG. =head1 AUTHOR Francis J. Lacoste =head1 COPYRIGHT Copyright (c) 1999,2000 iNsu Innovations. Inc. Copyright (c) 2001 Francis J. Lacoste This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. =head1 SEE ALSO L Alternative module: L gpg(1) =cut GnuPG-0.19/GnuPG/0000755000175000017500000000000011742601276012727 5ustar yanickyanickGnuPG-0.19/GnuPG/Tie/0000755000175000017500000000000011742601276013450 5ustar yanickyanickGnuPG-0.19/GnuPG/Tie/Sign.pm0000644000175000017500000000225011662575230014706 0ustar yanickyanick# # GnuPG/Tie/Sign.pm - Tied file handle interface to the sign # function of GnuPG. # # This file is part of GnuPG.pm. # # Author: Francis J. Lacoste # # Copyright (C) 2000 iNsu Innovations Inc. # Copyright (C) 2001 Francis J. Lacoste # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # package GnuPG::Tie::Sign; use GnuPG; use GnuPG::Tie; use vars qw( @ISA ); BEGIN { @ISA = qw( GnuPG::Tie ); }; sub run_gnupg { $self->{gnupg}->sign( @_ ); }; 1; GnuPG-0.19/GnuPG/Tie/Decrypt.pm0000644000175000017500000000310711662575230015422 0ustar yanickyanick# # GnuPG/Tie/Decrypt.pm - Tied file handle interface to the decryption # functionality of GnuPG. # # This file is part of GnuPG.pm. # # Author: Francis J. Lacoste # # Copyright (C) 1999, 2000 iNsu Innovations Inc. # Copyright (C) 2001 Francis J. Lacoste # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # package GnuPG::Tie::Decrypt; use GnuPG; use GnuPG::Tie; use vars qw( @ISA ); BEGIN { @ISA = qw( GnuPG::Tie ); }; sub run_gnupg { my $self = shift; $self->{last_sig} = undef; $self->{args} = [ @_ ]; $self->{gnupg}->decrypt( @_ ); }; sub postread_hook { my $self = shift; $self->{gnupg}->decrypt_postread( @{$self->{args}} ); } sub postwrite_hook { my $self = shift; $self->{last_sig} = $self->{gnupg}->decrypt_postwrite( @{$self->{args}} ); } sub signature { my $self = shift; return $self->{last_sig}; } 1; GnuPG-0.19/GnuPG/Tie/ClearSign.pm0000644000175000017500000000231611662575230015660 0ustar yanickyanick# # GnuPG/Tie/Sign.pm - Tied file handle interface to the clearsign # function of GnuPG. # # This file is part of GnuPG.pm. # # Author: Francis J. Lacoste # # Copyright (C) 2000 iNsu Innovations Inc. # Copyright (C) 2001 Francis J. Lacoste # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # package GnuPG::Tie::ClearSign; use GnuPG; use GnuPG::Tie; use vars qw( @ISA ); BEGIN { @ISA = qw( GnuPG::Tie ); }; sub run_gnupg { my $self = shift; $self->{gnupg}->clearsign( @_ ); }; 1; GnuPG-0.19/GnuPG/Tie/Encrypt.pm0000644000175000017500000000233011662575230015431 0ustar yanickyanick# # GnuPG/Tie/Encrypt.pm - Tied file handle interface to the encryption # function of GnuPG. # # This file is part of GnuPG.pm. # # Author: Francis J. Lacoste # # Copyright (C) 1999, 2000 iNsu Innovations Inc. # Copyright (C) 2001 Francis J. Lacoste # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # package GnuPG::Tie::Encrypt; use GnuPG; use GnuPG::Tie; use vars qw( @ISA ); BEGIN { @ISA = qw( GnuPG::Tie ); }; sub run_gnupg { my $self = shift; $self->{gnupg}->encrypt( @_ ); }; 1; GnuPG-0.19/GnuPG/Tie.pm0000644000175000017500000002204011663032577014010 0ustar yanickyanick# # GnuPG.pm - Abstract tied interface to the GnuPG. # # This file is part of GnuPG.pm. # # Author: Francis J. Lacoste # # Copyright (C) 1999, 2000 iNsu Innovations Inc. # Copyright (C) 2001 Francis J. Lacoste # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # package GnuPG::Tie; use GnuPG; use Symbol; use Carp; use Fcntl; use strict; sub TIEHANDLE { my $class = shift; $class = ref $class || $class; my ($gpg_in, $gpg_out) = ( gensym, gensym ); my ($tie_in,$tie_out) = ( gensym, gensym ); pipe $gpg_in, $tie_out or croak "error while creating pipe: $!"; pipe $tie_in, $gpg_out or croak "error while creating pipe: $!"; # Unbuffer writer pipes for my $fd ( ($gpg_out, $tie_out) ) { my $old = select $fd; $| = 1; select $old; } # Keep pipes open after exec # Removed close on exec from all file descriptor for my $fd ( ( $gpg_in, $gpg_out, $tie_in, $tie_out ) ) { fcntl( $fd, F_SETFD, 0 ) or croak "error removing close on exec flag: $!\n" ; } # Operate in non blocking mode for my $fd ( $tie_in, $tie_out ) { my $flags = fcntl $fd, F_GETFL, 0 or croak "error getting flags on pipe: $!\n"; fcntl $fd, F_SETFL, $flags | O_NONBLOCK or croak "error setting non-blocking IO on pipe: $!\n"; } my $self = bless { reader => $tie_in, writer => $tie_out, done_writing => 0, buffer => "", len => 0, offset => 0, line_buffer => "", eof => 0, gnupg => new GnuPG( @_ ), }, $class; # Let subclass call the appropriate method and set # up the GnuPG object. $self->run_gnupg( @_, input => $gpg_in, output => $gpg_out, tie_mode => 1, ); close $gpg_in; close $gpg_out; return $self; } sub WRITE { my ( $self, $buf, $len, $offset ) = @_; croak "attempt to read on a closed file handle\n" unless defined $self->{writer}; croak ( "can't write after having read" ) if $self->{done_writing}; my ( $r_in, $w_in ) = ( '', '' ); vec( $r_in, fileno $self->{reader}, 1) = 1; vec( $w_in, fileno $self->{writer}, 1) = 1; my $left = $len; while ( $left ) { my ($r_out, $w_out) = ($r_in, $w_in); my $nfound = select $r_out, $w_out, undef, undef; croak "error in select: $!\n" unless defined $nfound; # Check if we can write if ( vec $w_out, fileno $self->{writer}, 1 ) { my $n = syswrite $self->{writer}, $buf, $len, $offset; croak "error on write: $!\n" unless defined $n; $left -= $n; $offset += $n; } # Check if we can read if ( vec $r_out, fileno $self->{reader}, 1 ) { my $n = sysread $self->{reader}, $self->{buffer}, 1024, $self->{len}; croak "error on read: $!\n" unless defined $n; $self->{len} += $n; } } return $len; } sub done_writing() { my $self = shift; # Once we start reading, no other writing can be place # on the pipe. So we close the writer file descriptor unless ( $self->{done_writing} ) { $self->{done_writing} = 1; close $self->{writer} or croak "error closing writer pipe: $\n"; $self->postwrite_hook(); } } sub READ { my $self = shift; my $bufref = \$_[0]; my ( undef, $len, $offset ) = @_; croak "attempt to read on a closed file handle\n" unless defined $self->{reader}; if ( $self->{eof}) { $self->{eof} = 0; return 0; } # Start reading the input $self->done_writing unless ( $self->{done_writing} ); # Check if we have something in our buffer if ( $self->{len} - $self->{offset} ) { my $left = $self->{len} - $self->{offset}; my $n = $left > $len ? $len : $left; substr( $$bufref, $offset, $len) = substr $self->{buffer}, $self->{offset}, $n; $self->{offset} += $n; # Return only if we have read the requested length. return $n if $n == $len; $offset += $n; $len -= $n; } # Wait for the reader fd to come ready my ( $r_in ) = ''; vec( $r_in, fileno $self->{reader}, 1 ) = 1; my $nfound = select $r_in, undef, undef, undef; croak "error in select: $!\n" unless defined $nfound; my $n = sysread $self->{reader}, $$bufref, $len, $offset; croak "error in read: $!\n" unless defined $n; $n; } sub PRINT { my $self = shift; my $sep = defined $, ? $, : ""; my $buf = join $sep, @_; $self->WRITE( $buf, length $buf, 0 ); } sub PRINTF { my $self = shift; my $buf = sprintf @_; $self->WRITE( $buf, length $buf, 0 ); } sub GETC { my $self = shift; my $c = undef; my $n = $self->READ( $c, 1, 0 ); return undef unless $n; $c; } sub READLINE { wantarray ? $_[0]->getlines() : $_[0]->getline(); } sub CLOSE { my $self = shift; $self->done_writing; close $self->{reader} or croak "error closing reader pipe: $!\n"; $self->postread_hook(); $self->{gnupg}->end_gnupg(); $self->{reader} = undef; $self->{writer} = undef; ! $?; } sub getlines { my $self = shift; my @lines = (); my $line; while ( defined( $line = $self->getline ) ) { push @lines, $line; } @lines; } sub getline { my $self = shift; if ( $self->{eof} ) { # Clear EOF $self->{eof} = 0; return undef; } # Handle slurp mode if ( not defined $/ ) { my $buf = $self->{line_buffer}; my $offset = length $buf; while ( my $n = $self->READ( $buf, 4096, $offset ) ) { $offset += $n } return $buf; } # Handle explicit RS if ( $/ ne "" ) { my $buf = $self->{line_buffer}; while ( not $self->{eof} ) { if ( length $buf != 0 ) { my $i; if ( ( $i = index $buf, $/ ) != -1 ) { # Found end of line $self->{line_buffer} = substr $buf, $i + length $/; return substr $buf, 0, $i + length $/; } } # Read more data in our buffer my $n = $self->READ( $buf, 4096, length $buf ); if ( $n == 0 ) { # Set EOF $self->{eof} = 1; return length $buf == 0 ? undef : $buf ; } } } else { my $buf = $self->{line_buffer}; while ( not $self->{eof} ) { if ( $buf =~ m/(\r\n\r\n+|\n\n+)/s ) { my ($para, $rest) = split /\r\n\r\n+|\n\n+/, $buf, 2; $self->{line_buffer} = $rest; return $para . $1; } # Read more data in our buffer my $n = $self->READ( $buf, 4096, length $buf ); if ( $n == 0 ) { # Set EOF $self->{eof} = 1; return length $buf == 0 ? undef : $buf ; } } } } # Hook called after reading is done sub postread_hook { } # Hook called when writing is done. sub postwrite_hook { } 1; __END__ =pod =head1 NAME GnuPG::Tie::Encrypt - Tied filehandle interface to encryption with the GNU Privacy Guard. GnuPG::Tie::Decrypt - Tied filehandle interface to decryption with the GNU Privacy Guard. =head1 SYNOPSIS use GnuPG::Tie::Encrypt; use GnuPG::Tie::Decrypt; tie *CIPHER, 'GnuPG::Tie::Encrypt', armor => 1, recipient => 'User'; print CIPHER <; close CIPHER; untie *CIPHER; tie *PLAINTEXT, 'GnuPG::Tie::Decrypt', passphrase => 'secret'; print PLAINTEXT $ciphertext; my $plaintext = ; # $plaintext should now contains 'This is a secret' close PLAINTEXT; untie *PLAINTEXT; =head1 DESCRIPTION GnuPG::Tie::Encrypt and GnuPG::Tie::Decrypt provides a tied file handle interface to encryption/decryption facilities of the GNU Privacy guard. With GnuPG::Tie::Encrypt everyting you write to the file handle will be encrypted. You can read the ciphertext from the same file handle. With GnuPG::Tie::Decrypt you may read the plaintext equivalent of a ciphertext. This is one can have been written to file handle. All options given to the tie constructor will be passed on to the underlying GnuPG object. You can use a mix of options to output directly to a file or to read directly from a file, only remember than once you start reading from the file handle you can't write to it anymore. =head1 AUTHOR Francis J. Lacoste <francis.lacoste@Contre.COM> =head1 COPYRIGHT Copyright (c) 1999, 2000 iNsu Innovations Inc. Copyright (c) 2001 Francis J. Lacoste This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. =head1 SEE ALSO gpg(1) GnuPG(3) =cut ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GnuPG-0.19/ChangeLog��������������������������������������������������������������������������������0000644�0001750�0001750�00000016662�11742600150�013522� 0����������������������������������������������������������������������������������������������������ustar �yanick��������������������������yanick�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������2012-04-15 version 0.19 * POD typo fix. (patch by Salvatore Bonaccorso) [RT72600] * Don't use deprecated shared memory mode (patch by Adam Benjamin) * Log format. (pointed out by Adam Benjamin) * command output parsing for newer gnupg (patch by Adam Benjamin) 2011-11-21 version 0.18 * encrypt() now accept many recipients. [RT71127] * new() doesn't die if 'homedir' isn't writeable. [RT568] (bug reported by Mark Stosberg) 2010-05-25 version 0.17 Mark Frost * Applied a patch written by Niko Tyni to fix a hanging issue discovered by Salvatore Bonaccorso in chroot environments. 2010-04-19 version 0.16 Mark Frost * Fixed a hanging issue that came up under certain scenarios. 2010-04-19 version 0.15 Mark Frost * Added some quotes whose absence was causing one of the original tests to fail. 2010-04-16 version 0.14 Mark Frost * Fixed an endless read-wait scenario introduced in 0.13 2010-04-16 version 0.13 Mark Frost * Catching up some outstanding changes I left out in releases 11 and 12 2010-02-03 version 0.12 Mark Frost * This release is merely some documentation fixes 2010-01-27 version 0.11 Mark Frost * The module should now properly handle the situation where a key is setup with a blank passphrase, as long as passphrase => undef is provided (or left out) * Fixed an issue where STDIN and STDOUT cannot be overridden in an Apache environment. 2009-05-07 version 0.10 Robbie Bow * Changes in 0.09_0{1-3} being released in to the wild proper. * Includes fixes that should resolve these RT tickets: * 6563 * 6562 * 4957 * 1364 (which are all variations on the same two themes) 2009-05-07 version 0.09_03 Robbie Bow * Dev release - Fix import_key to expect correct response; fix encrypt to expect correct response (both running against gnupg 1.4.6); use Test::More for tests 2009-05-06 version 0.09_02 Robbie Bow * Dev release - update $VERSION in GnuPG.pm to see cpantesters reports 2009-05-06 version 0.09_01 Robbie Bow * Dev release that cargo cults the numerous fixes Debian maintainers have added since the last release. See debian/chnagelog for more details 2001-05-23 Francis J. Lacoste <francis.lacoste@Contre.COM> * GnuPG.pm (run_gnupg): Use package name for the constant. 2001-05-21 Francis J. Lacoste <francis.lacoste@Contre.COM> * GnuPG.pm (sign): Check for invalid passphrase. (Thanks to Park Hays for reporting this). * GnuPG/Tie/Sign.pm (run_gnupg): Updates for new tie implementation. * GnuPG/Tie/Encrypt.pm (run_gnupg): Updates for new tie implementation. * GnuPG/Tie/Decrypt.pm (run_gnupg,postread_hook,postwrite_hook): Updates for new tie implementation. (signature) Returns the signature info of the decryption. * GnuPG/Tie/ClearSign.pm (run_gnupg): Updates for new tie implementation. * GnuPG/Tie.pm: Removed fork. Tie interface doesn't use another process anymore. * test.pl: Made tests to run and tracing controllable via environment variables. * GnuPG.pm (send_passphrase): Added check for USERID_HINT from gnupg 1.0.5 (run_gnupg): Close all file descriptors except stdin, stdout, stderr and status fd. (decrypt,decrypt_postread,decrypt_postwrite): Factored decrypt process for tie interface. (VERSION): Updated version number to 0.08 * GnuPG/Tie/Sign.pm: New Sign tie mode. * GnuPG/Tie/ClearSign.pm: New ClearSign tie mode. * GnuPG/Tie.pm (POD): Fix untie example in documentation. 2000-08-15 Francis J. Lacoste <francis.lacoste@iNsu.COM> * Tag: GNUPG_0_07 * GnuPG.spec: Updated for version 0.07. * NEWS: Updated for version 0.07. * README: Updated for version 0.07. * GnuPG.pm (VERSION): Updated version number to 0.07. (run_gnupg): Close the fh ref not its file descriptor. * test.pl: Added tests for encryption and decryption to a file reference / pipe. 2000-08-07 Francis J. Lacoste <francis.lacoste@iNsu.COM> * Tag: GNUPG_0_06 * GnuPG.spec: Updated spec file to use new macros. * GnuPG.pm (encrypt): Local user option wasn't working. (Thanks to Chris Andrews for the fix) (sign): Local user option wasn't working. (version): Version number is now 0.06 2000-07-31 Francis J. Lacoste <francis.lacoste@iNsu.COM> * test.pl: Fixes description for decrypt_sign_test. * GnuPG.pm: Updated copyrigh notice. (check_sig): Ignore patent warnings. Thanks goes to Nuutti Kotivuori <nuutti.kotivuori@sonera.com> for spotting that bug. (decrypt): Fixes for gnupg 1.02 protocol changes. (import_keys): Fixes for gnupg 1.02 protocol changes. * README: Updated copyrigh notice. * gpgmailtunl: Updated copyrigh notice. * GnuPG/Tie.pm: Updated copyrigh notice. * GnuPG/Tie/Decrypt.pm: Updated copyrigh notice. * GnuPG/Tie/Encrypt.pm: Updated copyrigh notice. 2000-06-21 Francis J. Lacoste <francis.lacoste@iNsu.COM> * Tag: GNUPG_0_05 * GnuPG/Tie.pm (TIEHANDLE): Removed file descriptor leaks. (READLINE) Handle array context properly. (getlines) Support paragraph mode. (CLOSE) Return true when process completes successfully. * test.pl: Added test for GnuPG::Tie paragraph mode. * GnuPG.pm: (version) Updated to version 0.05 (run_gnupg) Removed file descriptor leaks. Use CORE::die in case of errors. (read_from_status) Make sure that we are using newlin as INPUT_RECORD_SEPARATOR. 1999-12-06 Francis J. Lacoste <francis.lacoste@iNsu.COM> * Tag: GNUPG_0_04 * NEWS: Added a news file. * GnuPG/Tie.pm(new): Make sure that pipes aren't closed after an exec and that they are unbuffered. Also use CORE::Exit(0) instead of exit(0) so that the things works under mod_perl. (version): Upgraded to version 0.04. * GnuPG.pm (new): Specifying gnupg_path wasn't working properly. When gpg isn't found in PATH print the content of PATH in the error message. (run_gnupg): /dev/null wasn't open for writing. Use CORE::exit(1) so that the function still works under mod_perl. 1999-11-30 Francis J. Lacoste <francis.lacoste@iNsu.COM> * GnuPG.pm (pod): Inserted a line before a =over line. Added reference to documentation on tied file handle operations. (send_cpr): Removed undefined warning when expecting an optional command and receiving an EOF. (run_gnupg): Check for valid file descriptor when using file handle reference in input and output redirection. (version): Updated to version 0.03 * test.pl: Added tests for tied file handle operations. Changed output format of tests. * GnuPG/Tie/Decrypt.pm: Added encryption on a tied filehandle. * GnuPG/Tie/Encrypt.pm: Added decryption on a tied filehandle. * GnuPG/Tie.pm: Added abstract implementation for tied filehandle operations on GnuPG. 1999-09-22 Francis J. Lacoste <francis.lacoste@iNsu.COM> * GnuPG.pm: Unloop single line for to support perl 5.004. (Thanks to David E. Weekly) * gpgmailtunl: Insert blank line between =pod and first header. This broke pod2man. (Thanks to David E. Weekly) 1999-09-08 Francis J. Lacoste <francis.lacoste@iNsu.COM> * TAG: GNUPG_0_02 * GnuPG.pm: Removed colons from tag names. * GnuPG.pm(run_gnupg): Handled input and output from file handle correctly. * GnuPG.pm(abort_gnupg): Aborting now correctly throws the error message. * gpgmailtunl: Added as sample program. 1999-09-05 Francis J. Lacoste <francis.lacoste@iNsu.COM> * GnuPG.pm: Release 0.01. ������������������������������������������������������������������������������GnuPG-0.19/COPYING����������������������������������������������������������������������������������0000644�0001750�0001750�00000043127�11662575230�013012� 0����������������������������������������������������������������������������������������������������ustar �yanick��������������������������yanick����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) 19yy <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GnuPG-0.19/Makefile.PL������������������������������������������������������������������������������0000644�0001750�0001750�00000000411�11662575230�013716� 0����������������������������������������������������������������������������������������������������ustar �yanick��������������������������yanick�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'GnuPG', 'VERSION_FROM' => 'GnuPG.pm', # finds $VERSION 'EXE_FILES' => [ gpgmailtunl ], ); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GnuPG-0.19/test.pl����������������������������������������������������������������������������������0000644�0001750�0001750�00000017147�11662575230�013276� 0����������������������������������������������������������������������������������������������������ustar �yanick��������������������������yanick�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' #use Test; use strict; use Test::More; use constant USERID => "GnuPG Test"; use constant PASSWD => "test"; use constant UNTRUSTED => "Francis"; use Symbol; use GnuPG; use GnuPG::Tie::Encrypt; use GnuPG::Tie::Decrypt; BEGIN { $| = 1; } my @tests = qw( gen_key_test import_test import2_test import3_test export_test export2_test export_secret_test encrypt_test pipe_encrypt_test pipe_decrypt_test encrypt_sign_test encrypt_sym_test encrypt_notrust_test decrypt_test decrypt_sign_test decrypt_sym_test sign_test detachsign_test clearsign_test verify_sign_test verify_detachsign_test verify_clearsign_test tie_encrypt_test tie_decrypt_test tie_decrypt_para_mode_test multiple_recipients ); if ( defined $ENV{TESTS} ) { @tests = split /\s+/, $ENV{TESTS}; } plan tests => scalar @tests; my $gpg = new GnuPG( homedir => "test", trace => $ENV{TRACING} ); for ( @tests ) { eval { no strict 'refs'; # We are using symbolic references &$_(); }; (ok !$@, $_) || diag $@; } sub multiple_recipients { $gpg->encrypt( recipient => [ USERID, UNTRUSTED ], output => "test/file.txt.gpg", armor => 1, plaintext => "test/file.txt", ); open my $fh, '<', "test/file.txt.gpg"; die "'test/file.txt.gpg' is empty\n" unless -s 'test/file.txt.gpg'; } sub gen_key_test { diag "Generating a key - can take some time"; $gpg->gen_key( passphrase => PASSWD, name => USERID, ); } sub import_test { $gpg->import_keys( keys => "test/key1.pub" ); } sub import2_test { $gpg->import_keys( keys => "test/key1.pub" ); } sub import3_test { $gpg->import_keys( keys => [ qw( test/key1.pub test/key2.pub ) ] ); } sub export_test { $gpg->export_keys( keys => USERID, armor => 1, output => "test/key.pub", ); } sub export2_test { $gpg->export_keys( armor => 1, output => "test/keyring.pub", ); } sub export_secret_test { $gpg->export_keys( secret => 1, armor => 1, output => "test/key.sec", ); } sub encrypt_test { $gpg->encrypt( recipient => USERID, output => "test/file.txt.gpg", armor => 1, plaintext => "test/file.txt", ); } sub pipe_encrypt_test { open CAT, "| cat > test/pipe-file.txt.gpg" or die "can't fork: $!\n"; $gpg->encrypt( recipient => USERID, output => \*CAT, armor => 1, plaintext => "test/file.txt", ); close CAT; } sub encrypt_sign_test { $gpg->encrypt( recipient => USERID, output => "test/file.txt.sgpg", armor => 1, sign => 1, plaintext => "test/file.txt", passphrase => PASSWD, ); } sub encrypt_sym_test { $gpg->encrypt( output => "test/file.txt.cipher", armor => 1, plaintext => "test/file.txt", symmetric => 1, passphrase => PASSWD, ); } sub encrypt_notrust_test { $gpg->encrypt( recipient => UNTRUSTED, output => "test/file.txt.dist.gpg", armor => 1, sign => 1, plaintext => "test/file.txt", passphrase => PASSWD, ); } sub sign_test { $gpg->sign( recipient => USERID, output => "test/file.txt.sig", armor => 1, plaintext => "test/file.txt", passphrase => PASSWD, ); } sub detachsign_test { $gpg->sign( recipient => USERID, output => "test/file.txt.asc", "detach-sign" => 1, armor => 1, plaintext => "test/file.txt", passphrase => PASSWD, ); } sub clearsign_test { $gpg->clearsign( output => "test/file.txt.clear", armor => 1, plaintext => "test/file.txt", passphrase => PASSWD, ); } sub decrypt_test { $gpg->decrypt( output => "test/file.txt.plain", ciphertext => "test/file.txt.gpg", passphrase => PASSWD, ); } sub pipe_decrypt_test { open CAT, "cat test/file.txt.gpg|" or die "can't fork: $!\n"; $gpg->decrypt( output => "test/file.txt.plain", ciphertext => \*CAT, passphrase => PASSWD, ); close CAT; } sub decrypt_sign_test { $gpg->decrypt( output => "test/file.txt.plain2", ciphertext => "test/file.txt.sgpg", passphrase => PASSWD, ); } sub decrypt_sym_test { $gpg->decrypt( output => "test/file.txt.plain3", ciphertext => "test/file.txt.cipher", symmetric => 1, passphrase => PASSWD, ); } sub verify_sign_test { $gpg->verify( signature => "test/file.txt.sig" ); } sub verify_detachsign_test { $gpg->verify( signature => "test/file.txt.asc", file => "test/file.txt", ); } sub verify_clearsign_test { $gpg->verify( signature => "test/file.txt.clear" ); } sub encrypt_from_fh_test { open ( FH, "test/file.txt" ) or die "error opening file: $!\n"; $gpg->encrypt( recipient => UNTRUSTED, output => "test/file-fh.txt.gpg", armor => 1, plaintext => \*FH, ); close ( FH ) or die "error closing file: $!\n"; } sub encrypt_to_fh_test { open ( FH, ">test/file-fho.txt.gpg" ) or die "error opening file: $!\n"; $gpg->encrypt( recipient => UNTRUSTED, output => \*FH, armor => 1, plaintext => "test/file.txt", ); close ( FH ) or die "error closing file: $!\n"; } sub tie_encrypt_test { open( PLAINTEXT, "test/file.txt" ) or die "error opening file: $!\n"; open( CIPHER_OUT, ">test/file-tie.txt.asc" ) or die "error writing encrypting file\n"; tie *CIPHER, 'GnuPG::Tie::Encrypt', homedir => "test", recipient => 'GnuPG', armor => 1, trace => $ENV{TRACING}; while (<PLAINTEXT>) { print CIPHER $_; } close PLAINTEXT; while (<CIPHER>) { print CIPHER_OUT $_; } close CIPHER; untie *CIPHER; close CIPHER_OUT; } sub tie_decrypt_test { open( PLAINTEXT, "test/file.txt" ) or die "error opening plaintext file: $!\n"; my $plaintext_orig = ""; $plaintext_orig .= $_ while ( <PLAINTEXT>); close PLAINTEXT; open( CIPHER, "test/file-tie.txt.asc" ) or die "error opening encrypted file\n"; tie *GNUPG, 'GnuPG::Tie::Decrypt', homedir => "test", passphrase => PASSWD, trace => $ENV{TRACING}; while ( <CIPHER> ) { print GNUPG $_; } my $plaintext = ""; while ( <GNUPG> ) { $plaintext .= $_; } close GNUPG; untie *GNUPG; close CIPHER; die "plaintext doesn't match\n" unless $plaintext_orig eq $plaintext; } sub tie_decrypt_para_mode_test { my $plaintext = <<EOF; This is a paragraph. This is another paragraph which continue on another line. This is the final paragraph. EOF tie *CIPHER, 'GnuPG::Tie::Encrypt', homedir => "test", recipient => 'GnuPG', armor => 1, trace => $ENV{TRACING}; print CIPHER $plaintext; local $/ = undef; my $cipher = <CIPHER>; close CIPHER; untie *CIPHER; local $/ = ""; tie *TEST, 'GnuPG::Tie::Decrypt', homedir => "test", passphrase => PASSWD; print TEST $cipher; my @para = <TEST>; close TEST; untie *TEST; my $count = @para; die "paragraph count should be 3: $count\n" unless $count == 3; die "plaintext doesn't match input\n" unless join( "", @para) eq $plaintext; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GnuPG-0.19/GnuPG.spec�������������������������������������������������������������������������������0000644�0001750�0001750�00000006413�11742601227�013603� 0����������������������������������������������������������������������������������������������������ustar �yanick��������������������������yanick�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Summary: Perl interface to the Gnu Privacy Guard Name: GnuPG Version: 0.19 Release: 1c Source: http://www.cpan.org/modules/by-module/GnuPG/%{name}-%{version}.tar.gz Copyright: GPL Group: Development/Languages Prefix: /usr URL: http://www.cpan.org/modules/by-module/GnuPG/%{name}-%{version}.readme BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArchitectures: noarch Requires: gnupg >= 1.0 %description GnuPG is a perl interface to the GNU Privacy Guard. It uses the shared memory coprocess interface that gpg provides for its wrappers. It tries its best to map the interactive interface of gpg to a more programmatic model. %prep %setup -q %fix_perl_path %build perl Makefile.PL make OPTIMIZE="$RPM_OPT_FLAGS" make test %install rm -fr $RPM_BUILD_ROOT %perl_make_install BuildDirList > %pkg_file_list BuildFileList >> %pkg_file_list %clean rm -fr $RPM_BUILD_ROOT %files -f %pkg_file_list %defattr(-,root,root) %doc README ChangeLog NEWS %changelog * Sun Apr 15 2012 Yanick Champoux <yanick@cpan.org> [0.19-1c] - POD typo fix. (patch by Salvatore Bonaccorso) [RT72600] - Don't use deprecated shared memory mode (patch by Adam Benjamin) - Log format. (pointed out by Adam Benjamin) - command output parsing for newer gnupg (patch by Adam Benjamin) * Mon Nov 21 2011 Yanick Champoux <yanick@cpan.org> [0.18-1c] - encrypt() now accept many recipients. [RT71127] - new() doesn't die if 'homedir' isn't writeable. [RT568] (bug reported by Mark Stosberg) * Tue May 25 2010 Mark B. Frost <mark.frost@icainformatics.com> [0.17-1c] - Updated to version 0.17. * Fri Apr 16 2010 Mark B. Frost <mark.frost@icainformatics.com> [0.16-1c] - Updated to version 0.16. * Fri Apr 16 2010 Mark B. Frost <mark.frost@icainformatics.com> [0.15-1c] - Updated to version 0.15. * Fri Apr 16 2010 Mark B. Frost <mark.frost@icainformatics.com> [0.14-1c] - Updated to version 0.14. * Fri Apr 16 2010 Mark B. Frost <mark.frost@icainformatics.com> [0.13-1c] - Updated to version 0.13. * Wed Feb 03 2010 Mark B. Frost <mark.frost@icainformatics.com> [0.12-1c] - Updated to version 0.12. * Wed Jan 27 2010 Mark B. Frost <mark.frost@icainformatics.com> [0.11-1c] - Updated to version 0.11. * Fri Jun 08 2001 Francis J. Lacoste <francis.lacoste@Contre.COM> [0.09-1c] - Updated to version 0.09. * Mon May 21 2001 Francis J. Lacoste <francis.lacoste@Contre.COM> [0.08-1c] - Updated to version 0.08. * Tue Aug 15 2000 Francis J. Lacoste <francis.lacoste@iNsu.COM> [0.07-1i] - Updated to version 0.07. * Mon Aug 07 2000 Francis J. Lacoste <francis.lacoste@iNsu.COM> [0.06-1i] - Updated for version 0.06. * Fri Jul 14 2000 Francis J. Lacoste <francis.lacoste@iNsu.COM> [0.05-2i] - Updated spec file to use new macros. * Wed Jun 21 2000 Francis J. Lacoste <francis.lacoste@iNsu.COM> [0.05-1i] - Updated to version 0.05. * Mon Dec 06 1999 Francis J. Lacoste <francis.lacoste@iNsu.COM> [0.04-1i] - Updated to version 0.04. * Tue Nov 30 1999 Francis J. Lacoste <francis.lacoste@iNsu.COM> [0.03-1i] - Updated to version 0.03. * Wed Sep 08 1999 Francis J. Lacoste <francis.lacoste@iNsu.COM> [0.02-1i] - Added gpgmailtunl and its man pages. - Updated to version 0.02. * Sun Sep 05 1999 Francis J. Lacoste <francis.lacoste@iNsu.COM> [0.01-1i] - Packaged for iNs/linux �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GnuPG-0.19/README�����������������������������������������������������������������������������������0000644�0001750�0001750�00000003200�11662575230�012623� 0����������������������������������������������������������������������������������������������������ustar �yanick��������������������������yanick�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GnuPG ===== Version: 0.9 Requirements ------------ perl gpg 1.0.0 or later. (Version 1.05 recommanded) SysV compatible shared memory. Description ----------- GnuPG is a perl module that interface with the Gnu Privacy Guard using the coprocess hooks provided by gpg. The communication mechanism uses is shared memory and a status file descriptor. There are others perl interface to PGP and GnuPG but none of them used the coprocess interface provided by gpg. The module tries it best to map the rather interactive interface of gpg to a more programmatic API. Also the modules now offers a tied file handle interface to encryption and decryption making a lot more easy to use. Installing ---------- The usual: perl Makefile.PL make make test make install Documentation ------------- Documentation is included in POD format. Limitations ----------- This module doesn't yet provides an interface to the key manipulation facilities of gpg. It doesn't also provides the memory protection offered by gpg when manipulating user passphrase. There are also several options (like cipher selections) that aren't available from the perl API. Bugs ---- Send bug reports and suggestions to <bugs@Contre.COM> Authors ------- Francis J. Lacoste <francis.lacoste@Contre.COM> Copyright --------- Copyright (c) 1999, 2000 iNsu Innovations Inc. Copyright (c) 2001 Francis J. Lacoste All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������