mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
Fix a signal cleanup problem.
Fix zero length MPI reading.
This commit is contained in:
parent
e095815c4d
commit
21ad035cc9
@ -1,3 +1,13 @@
|
|||||||
|
2009-05-26 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* parse-packet.c (mpi_read): Workaround for zero-length MPI bug in
|
||||||
|
libgcrypt<1.5.0.
|
||||||
|
|
||||||
|
2009-05-22 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* signal.c (got_fatal_signal): Call new function
|
||||||
|
tty_cleanup_after_signal.
|
||||||
|
|
||||||
2009-05-20 Werner Koch <wk@g10code.com>
|
2009-05-20 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* gpg.c (main): Fix --fingerprint/--with-fingerprint command
|
* gpg.c (main): Fix --fingerprint/--with-fingerprint command
|
||||||
|
@ -139,9 +139,19 @@ mpi_read (iobuf_t inp, unsigned int *ret_nread, int secure)
|
|||||||
p[i+2] = iobuf_get(inp) & 0xff;
|
p[i+2] = iobuf_get(inp) & 0xff;
|
||||||
nread++;
|
nread++;
|
||||||
}
|
}
|
||||||
if ( gcry_mpi_scan( &a, GCRYMPI_FMT_PGP, buf, nread, &nread ) )
|
|
||||||
a = NULL;
|
if (nread >= 2 && !(buf[0] << 8 | buf[1]))
|
||||||
|
{
|
||||||
|
/* Libgcrypt < 1.5.0 accidently rejects zero-length (i.e. zero)
|
||||||
|
MPIs. We fix this here. */
|
||||||
|
a = gcry_mpi_new (0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( gcry_mpi_scan( &a, GCRYMPI_FMT_PGP, buf, nread, &nread ) )
|
||||||
|
a = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
gcry_free(buf);
|
gcry_free(buf);
|
||||||
if ( nread > *ret_nread )
|
if ( nread > *ret_nread )
|
||||||
|
@ -81,6 +81,7 @@ got_fatal_signal( int sig )
|
|||||||
gcry_control (GCRYCTL_TERM_SECMEM );
|
gcry_control (GCRYCTL_TERM_SECMEM );
|
||||||
|
|
||||||
tty_cleanup_rl_after_signal ();
|
tty_cleanup_rl_after_signal ();
|
||||||
|
tty_cleanup_after_signal ();
|
||||||
|
|
||||||
/* Better don't translate these messages. */
|
/* Better don't translate these messages. */
|
||||||
write(2, "\n", 1 );
|
write(2, "\n", 1 );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user