-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.82: self test failure #23
Comments
Yes, it seems the part using @niklasholm would you like to look into it? |
I cannot get |
|
- Add `--openpgp --personal-digest-preferences RIPEMD160` to gpg command line since it seems RIPEMD-160 is the strongest digest supported by `Crypt::OpenPGP` for now.
Maybe, if PR #24 adds two flags to the gpg configuring it to use RIPEMD-160 if possible, otherwise revert to the OpenPGP standard. Please test if this resolves the issue. |
Also you could try something like #!perl
use Crypt::OpenPGP;
my $pgp = Crypt::OpenPGP->new(
Compat => "GnuPG",
AutoKeyRetrieve => 1,
KeyServer => "pool.sks-keyservers.net"
);
my $res = $pgp->verify(SigFile => "./SIGNATURE");
if (defined $res) {
if ($res) { print "Success\n"; } else { print "Failure\n"; }
} else {
print $pgp->errstr . "\n";
} on the SIGNATURE file alone just to confirm if the error occurs without our code. EDIT: Arguments added to |
I added a ';': #!/usr/pkg/bin/perl
use Crypt::OpenPGP;
my $pgp = Crypt::OpenPGP->new;
my $res = $pgp->verify(SigFile => "./SIGNATURE");
if (defined $res) {
if ($res) { print "Success\n"; } else { print "Failure\n"; }
} else {
print $pgp->errstr . "\n";
} running this gives me
|
The public keys should be imported during module configuration. Did you try that first? |
I've re-uploaded my public keys to However, It doesn't seem like RIPEMD160 helps... Running the snippet above still gives:
I've checked in the SIGNATURE file into source control to facilitate testing. |
I hadn't run configure for this test, but I just tried again after a build & test, and it didn't work either, same error. I don't see a message about keys being imported:
In the pkgsrc framework, $HOME is overridden, but there are no files in the temporary home even after a test run:
As a side note, i don't think that installing a perl module should change the keys in the public key ring of the user building it. |
I can reproduce this on a Ubuntu 18.04 virtual machine using
test-openpgp.pl:#!/usr/bin/perl
use Crypt::OpenPGP;
my $pgp = Crypt::OpenPGP->new(
Compat => "GnuPG",
PubRing => "./pubring.gpg",
);
my $res = $pgp->verify(SigFile => "./SIGNATURE");
if (defined $res) {
if ($res) { print "Success\n"; } else { print "Failure\n"; }
} else {
print $pgp->errstr;
} SIGNATURE:
In other words this is a bug in
|
So maybe it's Crypt::OpenPGP breaking compatibility with GnuPG 2? The difference may well be that the previous |
Okey so I've also done the same test on an earlier Ubuntu release with GnuPG v1.4. There the signature verifies successfully but only if using SHA1 as the signature digest. It seems |
To summarize: Currently |
Bug filed: RT#126994 For our part, I guess the only solution, for the time being, is to use SHA1 when signing and check that gpg's version is less than 1.9. |
GnuPG 2.1.16 introduced an additional signature subpacket by default, and I've confirmed that downgrading to 2.1.15 or lower gets rid of the "Message hash does not match signature checkbytes" part of the issue. Verification still fails for anything other than MD5 and SHA1 though. |
When running the self tests for 0.82 from CPAN with perl-5.28 on NetBSD and
TEST_SIGNATURE=1
in the environment, I see the following errors:The text was updated successfully, but these errors were encountered: