mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
* sign.c (sign_file): Do not push textmode filter onto an unopened IOBUF
(segfault). Noted by Marcus Brinkmann. Push and reinitialize textmode filter for each file in a multiple file list.
This commit is contained in:
parent
eee851ad83
commit
651b713d12
@ -1,3 +1,10 @@
|
|||||||
|
2003-02-12 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* sign.c (sign_file): Do not push textmode filter onto an unopened
|
||||||
|
IOBUF (segfault). Noted by Marcus Brinkmann. Push and
|
||||||
|
reinitialize textmode filter for each file in a multiple file
|
||||||
|
list.
|
||||||
|
|
||||||
2003-02-11 David Shaw <dshaw@jabberwocky.com>
|
2003-02-11 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* g10.c (print_mds): Check that SHA384 and 512 are available
|
* g10.c (print_mds): Check that SHA384 and 512 are available
|
||||||
|
12
g10/sign.c
12
g10/sign.c
@ -619,7 +619,6 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
|
|||||||
memset( &afx, 0, sizeof afx);
|
memset( &afx, 0, sizeof afx);
|
||||||
memset( &zfx, 0, sizeof zfx);
|
memset( &zfx, 0, sizeof zfx);
|
||||||
memset( &mfx, 0, sizeof mfx);
|
memset( &mfx, 0, sizeof mfx);
|
||||||
memset( &tfx, 0, sizeof tfx);
|
|
||||||
memset( &efx, 0, sizeof efx);
|
memset( &efx, 0, sizeof efx);
|
||||||
init_packet( &pkt );
|
init_packet( &pkt );
|
||||||
|
|
||||||
@ -673,8 +672,12 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
|
|||||||
goto leave;
|
goto leave;
|
||||||
|
|
||||||
/* prepare to calculate the MD over the input */
|
/* prepare to calculate the MD over the input */
|
||||||
if( opt.textmode && !outfile )
|
if( opt.textmode && !outfile && !multifile )
|
||||||
|
{
|
||||||
|
memset( &tfx, 0, sizeof tfx);
|
||||||
iobuf_push_filter( inp, text_filter, &tfx );
|
iobuf_push_filter( inp, text_filter, &tfx );
|
||||||
|
}
|
||||||
|
|
||||||
mfx.md = md_open(0, 0);
|
mfx.md = md_open(0, 0);
|
||||||
|
|
||||||
/* If we're encrypting and signing, it is reasonable to pick the
|
/* If we're encrypting and signing, it is reasonable to pick the
|
||||||
@ -793,6 +796,11 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
|
|||||||
}
|
}
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
fprintf(stderr, " `%s'", sl->d );
|
fprintf(stderr, " `%s'", sl->d );
|
||||||
|
if(opt.textmode)
|
||||||
|
{
|
||||||
|
memset( &tfx, 0, sizeof tfx);
|
||||||
|
iobuf_push_filter( inp, text_filter, &tfx );
|
||||||
|
}
|
||||||
iobuf_push_filter( inp, md_filter, &mfx );
|
iobuf_push_filter( inp, md_filter, &mfx );
|
||||||
while( iobuf_get(inp) != -1 )
|
while( iobuf_get(inp) != -1 )
|
||||||
;
|
;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user