diff options
author | Werner Koch <[email protected]> | 1999-01-09 15:06:59 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1999-01-09 15:06:59 +0000 |
commit | 002b1a8632d2c2795deb4682ba6db8be120db9b4 (patch) | |
tree | 33a0e8c96550f24d9aa1747b05a9f471f975e7a7 /g10/encr-data.c | |
parent | See ChangeLog: Thu Jan 7 18:00:58 CET 1999 Werner Koch (diff) | |
download | gnupg-002b1a8632d2c2795deb4682ba6db8be120db9b4.tar.gz gnupg-002b1a8632d2c2795deb4682ba6db8be120db9b4.zip |
See ChangeLog: Sat Jan 9 16:02:23 CET 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r-- | g10/encr-data.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/g10/encr-data.c b/g10/encr-data.c index d44d6c245..c5967c23b 100644 --- a/g10/encr-data.c +++ b/g10/encr-data.c @@ -1,5 +1,5 @@ /* encr-data.c - process an encrypted data packet - * Copyright (C) 1998 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -79,10 +79,12 @@ decrypt_data( PKT_encrypted *ed, DEK *dek ) cipher_setiv( dfx.cipher_hd, NULL ); if( ed->len ) { - /*iobuf_set_limit( ed->buf, ed->len );*/ - - for(i=0; i < (blocksize+2) && ed->len; i++, ed->len-- ) - temp[i] = iobuf_get(ed->buf); + for(i=0; i < (blocksize+2) && ed->len; i++, ed->len-- ) { + if( (c=iobuf_get(ed->buf)) == -1 ) + break; + else + temp[i] = c; + } } else { for(i=0; i < (blocksize+2); i++ ) @@ -100,13 +102,6 @@ decrypt_data( PKT_encrypted *ed, DEK *dek ) } iobuf_push_filter( ed->buf, decode_filter, &dfx ); proc_packets(ed->buf); - #if 0 - iobuf_pop_filter( ed->buf, decode_filter, &dfx ); - if( ed->len ) - iobuf_set_limit( ed->buf, 0 ); /* disable the readlimit */ - else - iobuf_clear_eof( ed->buf ); - #endif ed->buf = NULL; cipher_close(dfx.cipher_hd); return 0; |