[pkg-gnupg-maint] Bug#824901: Bug#824901: gnupg: gpg segfaults

Werner Koch wk at gnupg.org
Sat May 21 08:17:17 UTC 2016


On Sat, 21 May 2016 04:56, christoph at christoph-egger.org said:

>   GPG seems to reproducibly segfault on the command below (at least on
> my box). I had a segfault on gpg --import earlier as well but couln't

I can't replicate that here.  The culprit seems to be either
  gcry_md_get_algo_dlen (hash_algo)
or
  gcry_mpi_get_nbits (pk->pkey[0]), asn, asnlen);

however, we don't have debug symbols for Libgcrypt.  I'd suggest to try
this patch for debugging:

diff --git a/g10/seskey.c b/g10/seskey.c
index c41a145..d0e6b6f 100644
--- a/g10/seskey.c
+++ b/g10/seskey.c
@@ -347,6 +347,9 @@ encode_md_value (PKT_public_key *pk, gcry_md_hd_t md, int hash_algo)
         return NULL;
       if ( gcry_md_algo_info (hash_algo, GCRYCTL_GET_ASNOID, asn, &asnlen) )
         BUG();
+      log_debug ("%s: hash_algo=%d pk=%p\n", __func__, hash_algo, pk);
+      log_debug ("%s: pk->pkey[0]=%p\n", __func__, pk->pkey[0]);
+      gcry_log_debugmpi ("pkey[0]", pk->pkey[0]);
       frame = do_encode_md (md, hash_algo, gcry_md_get_algo_dlen (hash_algo),
                             gcry_mpi_get_nbits (pk->pkey[0]), asn, asnlen);
       xfree (asn);
	Modified   g10/tofu.c




Salam-Shalom,

   Werner



More information about the pkg-gnupg-maint mailing list