Bug#816104: libcrypt-gcrypt-perl: FTBFS against libgcrypt 1.7.0 beta

Niko Tyni ntyni at debian.org
Wed Apr 20 19:45:09 UTC 2016


On Sat, Feb 27, 2016 at 03:04:21PM +0100, Andreas Metzler wrote:
> Package: libcrypt-gcrypt-perl
> Version: 1.26-3
> Severity: important

> the package FTBFS against libgcrypt 1.7.0 beta with the folowing error:
> 
> Test Summary Report
> -------------------
> t/01-cipher.t       (Wstat: 11 Tests: 19 Failed: 0)
>   Non-zero wait status: 11
>   Parse errors: Bad plan.  You planned 20 tests but ran 19.

Thanks for the warning and sorry for the earlier lack of action on this.

The failure can be triggered with this:

 % perl -MCrypt::GCrypt -e '$c=Crypt::GCrypt->new(type=>"cipher",algorithm=>"aes");$c->start("encrypting"); $c->encrypt("a").$c->finish'

which gets a SIGSEGV in libgcrypt. Backtrace below.

Adding a $c->setkey('whatever') before calling encrypt() makes it go
away. The test isn't trying to do anything meaningful at that point,
it's just checking that it gets a warning when not calling $c->finish()
or something like that. Later tests of actual encrypting pass.

Is this something to be fixed on the libgcrypt side?

I guess I can come up with a C test case if needed, but maybe you
can cook up one easier? The perl side setkey() just seems to wrap
gcry_cipher_setkey().


  Core was generated by `debugperl -Iblib/lib -Iblib/arch -MCrypt::GCrypt -e $c=Crypt::GCrypt->new(type='.
  Program terminated with signal SIGSEGV, Segmentation fault.
  #0  0x0000000000000000 in ?? ()
  (gdb) bt
  #0  0x0000000000000000 in ?? ()
  #1  0x00007f5a5bce89c5 in _gcry_aes_cbc_enc (context=0x280a8e0, iv=0x280a6d0 "", outbuf_arg=<optimized out>, 
      inbuf_arg=<optimized out>, nblocks=1, cbc_mac=0) at ../../cipher/rijndael.c:811
  #2  0x00007f5a5bcc6565 in _gcry_cipher_cbc_encrypt (c=0x280a660, 
      outbuf=outbuf at entry=0x27cf850 "a", '\017' <repeats 15 times>, outbuflen=outbuflen at entry=16, 
      inbuf=inbuf at entry=0x2840650 "a", '\017' <repeats 15 times>, inbuflen=<optimized out>)
      at ../../cipher/cipher-cbc.c:65
  #3  0x00007f5a5bcc5400 in cipher_encrypt (inbuflen=<optimized out>, 
      inbuf=0x2840650 "a", '\017' <repeats 15 times>, outbuflen=16, 
      outbuf=0x27cf850 "a", '\017' <repeats 15 times>, c=<optimized out>) at ../../cipher/cipher.c:826
  #4  _gcry_cipher_encrypt (h=<optimized out>, out=out at entry=0x27cf850, outsize=outsize at entry=16, 
      in=in at entry=0x2840650, inlen=<optimized out>, inlen at entry=16) at ../../cipher/cipher.c:913
  #5  0x00007f5a5bcba91e in gcry_cipher_encrypt (h=<optimized out>, out=0x27cf850, outsize=16, in=0x2840650, 
      inlen=16) at ../../src/visibility.c:828
  #6  0x00007f5a5bfc1a53 in XS_Crypt__GCrypt_finish (my_perl=0x2785010, cv=0x27d47f0) at GCrypt.xs:439
  #7  0x000000000050f456 in Perl_pp_entersub (my_perl=0x2785010) at pp_hot.c:3270
  #8  0x00000000004da689 in Perl_runops_debug (my_perl=0x2785010) at dump.c:2234
  #9  0x0000000000450e92 in S_run_body (oldscope=1, my_perl=0x2785010) at perl.c:2453
  #10 perl_run (my_perl=0x2785010) at perl.c:2376
  #11 0x000000000041d09b in main (argc=6, argv=0x7ffc0f9ebfe8, env=0x7ffc0f9ec020) at perlmain.c:116

-- 
Niko Tyni   ntyni at debian.org



More information about the pkg-perl-maintainers mailing list