in reply to Re^2: GPG signing Issue
in thread GPG signing Issue
I cannot replicate, using two similar (but not identical) setups. First is my windows machine, second is a virtual linux machine; both used perl v5.20.3, but have wildly different gpg versions. Both worked just fine (though I learned that virtual machines do not like building entropy; it took forever to generate my dummy key or to sign the message).
use strict; use warnings; use Test::More tests => 1; use Crypt::OpenPGP; use Crypt::Rijndael; use Config; my $message = "Hello world!\n"; my %args = (Compat => 'GnuPG'); if($^O eq 'MSWin32') { @args{qw/PubRing SecRing/} = ( '.../gnupg/pubring.gpg', '.../gnupg/secring.gpg', ) } my $pgp = Crypt::OpenPGP->new (%args); my $sig = $pgp->sign ( Data => $message, Clearsign => 1, KeyID => $ENV{GPG_SECRET_KEY}, Passphrase => $ENV{GPG_PP} ); ok ($sig) or diag ($pgp->errstr); diag $sig; diag sprintf "%-20s => v%s (%s)", 'perl', $], $Config{myuname}; diag sprintf "%-20s => v%s", 'Crypt::OpenPGP', $Crypt::OpenPGP::VERSIO +N; diag sprintf "%-20s => v%s", 'Crypt::Rijndael', $Crypt::Rijndael::VERS +ION; diag qx/gpg --version/;
__WINDOWS__ 1..1 ok 1 # -----BEGIN PGP SIGNED MESSAGE----- # Hash: SHA256 # # Hello world! # -----BEGIN PGP SIGNATURE----- # Version: Crypt::OpenPGP 1.12 # ... # -----END PGP SIGNATURE----- # perl => v5.020003 (Win32 strawberry-perl 5.20.3.3 #1 + Sun Mar 6 19:06:29 2016 x64) # Crypt::OpenPGP => v1.12 # Crypt::Rijndael => v1.13 # gpg (GnuPG) 2.2.11
__VIRTUAL__LINUX__ 1..1 ok 1 # -----BEGIN PGP SIGNED MESSAGE----- # Hash: SHA256 # # Hello world! # -----BEGIN PGP SIGNATURE----- # Version: Crypt::OpenPGP 1.12 # ... # -----END PGP SIGNATURE----- # perl => v5.020003 (linux pryrtdebian 3.2.0-4-486 #1 +debian 3.2.81-1 i686 gnulinux ) # Crypt::OpenPGP => v1.12 # Crypt::Rijndael => v1.13 # gpg (GnuPG) 1.4.12
... So no, I don't know what's going wrong with yours... I don't know whether it will help to know it does work on similar-but-not-identical situations. My best bet would be some bug in the interface with your specific version of gpg... Oh, are you using 32b or 64b perl? And is the gpg 32b or 64b? Maybe data is trying to cross a bitness boundary?
update: oh, right, I think it's just Windows that has mixed bitness. I confirmed my linux virtual box was 32bit. And on Windows, it was 64bit perl as shown, with 32bit gpg.exe, so at least in that direction, it was okay to be mixed; I also tried with a 32bit v5.26.1 on windows, with the same results.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: GPG signing Issue
by hippo (Archbishop) on Jan 29, 2019 at 19:06 UTC | |
by pryrt (Abbot) on Jan 31, 2019 at 18:34 UTC | |
by hippo (Archbishop) on Feb 01, 2019 at 11:12 UTC |