mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* pkclist.c (do_we_trust_pre): Changed the wording of a warning.
* encode.c (encode_simple,encode_crypt): Use new style CTB for compressssed packets when using MDC. We need to do this so that concatenated messages are properly decrypted. Old style compression assumes that it is the last packet; given that we can't determine the length in advance, the uncompressor does not know where to start. Actually we should use the new CTB always but this would break PGP 2 compatibility. * parse-packet.c (parse): Special treatment for new style CTB compressed packets. * build-packet.c (do_mdc): Removed. Was not used. (do_encrypted_mdc): Count the version number and the MDC packet.
This commit is contained in:
parent
0073d6865d
commit
5dfd5a6dac
7 changed files with 82 additions and 59 deletions
10
g10/encode.c
10
g10/encode.c
|
@ -319,6 +319,8 @@ encode_simple( const char *filename, int mode, int compat )
|
|||
/* register the compress filter */
|
||||
if( do_compress )
|
||||
{
|
||||
if (cfx.dek && cfx.dek->use_mdc)
|
||||
zfx.new_ctb = 1;
|
||||
zfx.algo=opt.def_compress_algo;
|
||||
if(zfx.algo==-1)
|
||||
zfx.algo=DEFAULT_COMPRESS_ALGO;
|
||||
|
@ -554,6 +556,8 @@ encode_crypt( const char *filename, STRLIST remusr )
|
|||
/* algo 0 means no compression */
|
||||
if( compr_algo )
|
||||
{
|
||||
if (cfx.dek && cfx.dek->use_mdc)
|
||||
zfx.new_ctb = 1;
|
||||
zfx.algo = compr_algo;
|
||||
iobuf_push_filter( out, compress_filter, &zfx );
|
||||
}
|
||||
|
@ -565,13 +569,15 @@ encode_crypt( const char *filename, STRLIST remusr )
|
|||
log_error("build_packet failed: %s\n", g10_errstr(rc) );
|
||||
}
|
||||
else {
|
||||
/* user requested not to create a literal packet, so we copy the plain data */
|
||||
/* user requested not to create a literal packet, so we copy
|
||||
the plain data */
|
||||
byte copy_buffer[4096];
|
||||
int bytes_copied;
|
||||
while ((bytes_copied = iobuf_read(inp, copy_buffer, 4096)) != -1)
|
||||
if (iobuf_write(out, copy_buffer, bytes_copied) == -1) {
|
||||
rc = G10ERR_WRITE_FILE;
|
||||
log_error("copying input to output failed: %s\n", g10_errstr(rc) );
|
||||
log_error("copying input to output failed: %s\n",
|
||||
g10_errstr(rc) );
|
||||
break;
|
||||
}
|
||||
memset(copy_buffer, 0, 4096); /* burn buffer */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue