aboutsummaryrefslogtreecommitdiffstats
path: root/g10/import.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-10-31 05:39:02 +0000
committerDavid Shaw <[email protected]>2003-10-31 05:39:02 +0000
commit869c6bb7e455c91680bad8c2649bcfcdacfc4e7d (patch)
tree02e5d7eaacfbe5dfd6f5485b73c24f0332638877 /g10/import.c
parent* cipher.h: Add COMPRESS_ALGO_BZIP2. (diff)
downloadgnupg-869c6bb7e455c91680bad8c2649bcfcdacfc4e7d.tar.gz
gnupg-869c6bb7e455c91680bad8c2649bcfcdacfc4e7d.zip
* misc.c (compress_algo_to_string, string_to_compress_algo,
check_compress_algo): Add bzip2. * compress.c (compress_filter): Make static to help force the use of push_compress_filter. Remove default algorithm setting since that is done in push_compress_filter now. * main.h: Use named algorithm. * filter.h, compress.c (push_compress_filter, push_compress_filter2): New. Figure out which is the appropriate compression filter to use, and push it into place. * compress.c (handle_compressed), encode.c (encode_simple, encode_crypt), sign.c (sign_file, sign_symencrypt_file), import.c (read_block), export.c (do_export): Use push_compress_filter instead of pushing the compression filter ourselves. * compress-bz2.c: New. Bzlib versions of the compression filter routines. * Makefile.am: Include compress-bz2.c if bz2lib is available.
Diffstat (limited to 'g10/import.c')
-rw-r--r--g10/import.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/g10/import.c b/g10/import.c
index 80b4f6749..c5bcb595c 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -364,17 +364,17 @@ read_block( IOBUF a, PACKET **pending_pkt, KBNODE *ret_root )
/* make a linked list of all packets */
switch( pkt->pkttype ) {
case PKT_COMPRESSED:
- if( pkt->pkt.compressed->algorithm < 1
- || pkt->pkt.compressed->algorithm > 2 ) {
+ if(check_compress_algo(pkt->pkt.compressed->algorithm))
+ {
rc = G10ERR_COMPR_ALGO;
goto ready;
- }
- {
+ }
+ else
+ {
compress_filter_context_t *cfx = m_alloc_clear( sizeof *cfx );
- cfx->algo = pkt->pkt.compressed->algorithm;
pkt->pkt.compressed->buf = NULL;
- iobuf_push_filter2( a, compress_filter, cfx, 1 );
- }
+ push_compress_filter2(a,cfx,pkt->pkt.compressed->algorithm,1);
+ }
free_packet( pkt );
init_packet(pkt);
break;