head 1.6; access; symbols pkgsrc-2013Q2:1.6.0.4 pkgsrc-2013Q2-base:1.6 pkgsrc-2012Q4:1.6.0.2 pkgsrc-2012Q4-base:1.6 pkgsrc-2012Q1:1.5.0.20 pkgsrc-2012Q1-base:1.5 pkgsrc-2011Q4:1.5.0.18 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q3:1.5.0.16 pkgsrc-2011Q3-base:1.5 pkgsrc-2011Q2:1.5.0.14 pkgsrc-2011Q2-base:1.5 pkgsrc-2011Q1:1.5.0.12 pkgsrc-2011Q1-base:1.5 pkgsrc-2010Q4:1.5.0.10 pkgsrc-2010Q4-base:1.5 pkgsrc-2010Q3:1.5.0.8 pkgsrc-2010Q3-base:1.5 pkgsrc-2010Q2:1.5.0.6 pkgsrc-2010Q2-base:1.5 pkgsrc-2010Q1:1.5.0.4 pkgsrc-2010Q1-base:1.5 pkgsrc-2009Q4:1.5.0.2 pkgsrc-2009Q4-base:1.5 pkgsrc-2009Q3:1.4.0.16 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.4.0.14 pkgsrc-2009Q2-base:1.4 pkgsrc-2009Q1:1.4.0.12 pkgsrc-2009Q1-base:1.4 pkgsrc-2008Q4:1.4.0.10 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.8 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.6 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.4 pkgsrc-2008Q2-base:1.4 cwrapper:1.4.0.2 pkgsrc-2008Q1:1.3.0.8 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.6 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.4 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.2 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.2.0.2 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.1.0.2 pkgsrc-2006Q4-base:1.1; locks; strict; comment @# @; 1.6 date 2012.04.17.18.35.34; author drochner; state dead; branches; next 1.5; 1.5 date 2009.12.15.20.10.41; author drochner; state Exp; branches; next 1.4; 1.4 date 2008.04.28.14.54.27; author shannonjr; state Exp; branches; next 1.3; 1.3 date 2007.05.12.11.08.31; author shannonjr; state Exp; branches; next 1.2; 1.2 date 2007.02.05.11.43.01; author shannonjr; state Exp; branches; next 1.1; 1.1 date 2006.12.09.13.39.28; author shannonjr; state Exp; branches; next ; desc @@ 1.6 log @update to 2.0.19 changes: -cmd line UI improvements -Ukrainian translation @ text @$NetBSD: patch-ah,v 1.5 2009/12/15 20:10:41 drochner Exp $ --- g10/encr-data.c.orig 2009-06-05 13:58:27.000000000 +0000 +++ g10/encr-data.c @@@@ -37,35 +37,14 @@@@ static int mdc_decode_filter ( void *opa static int decode_filter ( void *opaque, int control, IOBUF a, byte *buf, size_t *ret_len); -typedef struct decode_filter_context_s +typedef struct { gcry_cipher_hd_t cipher_hd; gcry_md_hd_t mdc_hash; char defer[22]; int defer_filled; int eof_seen; - int refcount; -} *decode_filter_ctx_t; - - -/* Helper to release the decode context. */ -static void -release_dfx_context (decode_filter_ctx_t dfx) -{ - if (!dfx) - return; - - assert (dfx->refcount); - if ( !--dfx->refcount ) - { - gcry_cipher_close (dfx->cipher_hd); - dfx->cipher_hd = NULL; - gcry_md_close (dfx->mdc_hash); - dfx->mdc_hash = NULL; - xfree (dfx); - } -} - +} decode_filter_ctx_t; /**************** @@@@ -81,11 +60,7 @@@@ decrypt_data( void *procctx, PKT_encrypt unsigned blocksize; unsigned nprefix; - dfx = xtrycalloc (1, sizeof *dfx); - if (!dfx) - return gpg_error_from_syserror (); - dfx->refcount = 1; - + memset( &dfx, 0, sizeof dfx ); if ( opt.verbose && !dek->algo_info_printed ) { if (!openpgp_cipher_test_algo (dek->algo)) @@@@ -107,13 +82,13 @@@@ decrypt_data( void *procctx, PKT_encrypt if ( ed->mdc_method ) { - if (gcry_md_open (&dfx->mdc_hash, ed->mdc_method, 0 )) + if (gcry_md_open (&dfx.mdc_hash, ed->mdc_method, 0 )) BUG (); if ( DBG_HASHING ) - gcry_md_start_debug (dfx->mdc_hash, "checkmdc"); + gcry_md_start_debug (dfx.mdc_hash, "checkmdc"); } - rc = openpgp_cipher_open (&dfx->cipher_hd, dek->algo, + rc = openpgp_cipher_open (&dfx.cipher_hd, dek->algo, GCRY_CIPHER_MODE_CFB, (GCRY_CIPHER_SECURE | ((ed->mdc_method || dek->algo >= 100)? @@@@ -127,7 +102,7 @@@@ decrypt_data( void *procctx, PKT_encrypt /* log_hexdump( "thekey", dek->key, dek->keylen );*/ - rc = gcry_cipher_setkey (dfx->cipher_hd, dek->key, dek->keylen); + rc = gcry_cipher_setkey (dfx.cipher_hd, dek->key, dek->keylen); if ( gpg_err_code (rc) == GPG_ERR_WEAK_KEY ) { log_info(_("WARNING: message was encrypted with" @@@@ -146,7 +121,7 @@@@ decrypt_data( void *procctx, PKT_encrypt goto leave; } - gcry_cipher_setiv (dfx->cipher_hd, NULL, 0); + gcry_cipher_setiv (dfx.cipher_hd, NULL, 0); if ( ed->len ) { @@@@ -167,8 +142,8 @@@@ decrypt_data( void *procctx, PKT_encrypt temp[i] = c; } - gcry_cipher_decrypt (dfx->cipher_hd, temp, nprefix+2, NULL, 0); - gcry_cipher_sync (dfx->cipher_hd); + gcry_cipher_decrypt (dfx.cipher_hd, temp, nprefix+2, NULL, 0); + gcry_cipher_sync (dfx.cipher_hd); p = temp; /* log_hexdump( "prefix", temp, nprefix+2 ); */ if (dek->symmetric @@@@ -178,18 +153,17 @@@@ decrypt_data( void *procctx, PKT_encrypt goto leave; } - if ( dfx->mdc_hash ) - gcry_md_write (dfx->mdc_hash, temp, nprefix+2); - - dfx->refcount++; + if ( dfx.mdc_hash ) + gcry_md_write (dfx.mdc_hash, temp, nprefix+2); + if ( ed->mdc_method ) - iobuf_push_filter ( ed->buf, mdc_decode_filter, dfx ); + iobuf_push_filter( ed->buf, mdc_decode_filter, &dfx ); else - iobuf_push_filter ( ed->buf, decode_filter, dfx ); + iobuf_push_filter( ed->buf, decode_filter, &dfx ); proc_packets ( procctx, ed->buf ); ed->buf = NULL; - if ( ed->mdc_method && dfx->eof_seen == 2 ) + if ( ed->mdc_method && dfx.eof_seen == 2 ) rc = gpg_error (GPG_ERR_INV_PACKET); else if ( ed->mdc_method ) { @@@@ -208,28 +182,26 @@@@ decrypt_data( void *procctx, PKT_encrypt bytes are appended. */ int datalen = gcry_md_get_algo_dlen (ed->mdc_method); - assert (dfx->cipher_hd); - assert (dfx->mdc_hash); - gcry_cipher_decrypt (dfx->cipher_hd, dfx->defer, 22, NULL, 0); - gcry_md_write (dfx->mdc_hash, dfx->defer, 2); - gcry_md_final (dfx->mdc_hash); + gcry_cipher_decrypt (dfx.cipher_hd, dfx.defer, 22, NULL, 0); + gcry_md_write (dfx.mdc_hash, dfx.defer, 2); + gcry_md_final (dfx.mdc_hash); - if (dfx->defer[0] != '\xd3' || dfx->defer[1] != '\x14' ) + if (dfx.defer[0] != '\xd3' || dfx.defer[1] != '\x14' ) { log_error("mdc_packet with invalid encoding\n"); rc = gpg_error (GPG_ERR_INV_PACKET); } else if (datalen != 20 - || memcmp (gcry_md_read (dfx->mdc_hash, 0), - dfx->defer+2,datalen )) + || memcmp (gcry_md_read (dfx.mdc_hash, 0),dfx.defer+2,datalen)) rc = gpg_error (GPG_ERR_BAD_SIGNATURE); - /* log_printhex("MDC message:", dfx->defer, 22); */ - /* log_printhex("MDC calc:", gcry_md_read (dfx->mdc_hash,0), datalen); */ + /* log_printhex("MDC message:", dfx.defer, 22); */ + /* log_printhex("MDC calc:", gcry_md_read (dfx.mdc_hash,0), datalen); */ } leave: - release_dfx_context (dfx); + gcry_cipher_close (dfx.cipher_hd); + gcry_md_close (dfx.mdc_hash); return rc; } @@@@ -240,7 +212,7 @@@@ static int mdc_decode_filter (void *opaque, int control, IOBUF a, byte *buf, size_t *ret_len) { - decode_filter_ctx_t dfx = opaque; + decode_filter_ctx_t *dfx = opaque; size_t n, size = *ret_len; int rc = 0; int c; @@@@ -252,11 +224,11 @@@@ mdc_decode_filter (void *opaque, int con } else if( control == IOBUFCTRL_UNDERFLOW ) { - assert (a); - assert ( size > 44 ); + assert(a); + assert( size > 44 ); /* Get at least 22 bytes and put it somewhere ahead in the buffer. */ - for (n=22; n < 44 ; n++ ) + for(n=22; n < 44 ; n++ ) { if( (c = iobuf_get(a)) == -1 ) break; @@@@ -305,10 +277,8 @@@@ mdc_decode_filter (void *opaque, int con if ( n ) { - if ( dfx->cipher_hd ) - gcry_cipher_decrypt (dfx->cipher_hd, buf, n, NULL, 0); - if ( dfx->mdc_hash ) - gcry_md_write (dfx->mdc_hash, buf, n); + gcry_cipher_decrypt (dfx->cipher_hd, buf, n, NULL, 0); + gcry_md_write (dfx->mdc_hash, buf, n); } else { @@@@ -317,10 +287,6 @@@@ mdc_decode_filter (void *opaque, int con } *ret_len = n; } - else if ( control == IOBUFCTRL_FREE ) - { - release_dfx_context (dfx); - } else if ( control == IOBUFCTRL_DESC ) { *(char**)buf = "mdc_decode_filter"; @@@@ -332,7 +298,7 @@@@ mdc_decode_filter (void *opaque, int con static int decode_filter( void *opaque, int control, IOBUF a, byte *buf, size_t *ret_len) { - decode_filter_ctx_t fc = opaque; + decode_filter_ctx_t *fc = opaque; size_t n, size = *ret_len; int rc = 0; @@@@ -343,18 +309,11 @@@@ decode_filter( void *opaque, int control if ( n == -1 ) n = 0; if ( n ) - { - if (fc->cipher_hd) - gcry_cipher_decrypt (fc->cipher_hd, buf, n, NULL, 0); - } + gcry_cipher_decrypt (fc->cipher_hd, buf, n, NULL, 0); else rc = -1; /* EOF */ *ret_len = n; } - else if ( control == IOBUFCTRL_FREE ) - { - release_dfx_context (fc); - } else if ( control == IOBUFCTRL_DESC ) { *(char**)buf = "decode_filter"; @ 1.5 log @update to 2.0.13 changes: many fixes and improvements reviewed by John R. Shannon pkgsrc notes: -since S/MIME support is the biggest difference in functionality over gnupg1, enable it per default -- my tests (with the s/mime plugin of claws-mail) worked -left the build against a private libassuan with GNU-pth support alone for now, just updated libassuan to 1.0.5. We might build pkgsrc/libassuan against pkgsrc/pth at some point, but this needs to be checked for side effects. (As this pkg doesn't export a library which might propagate the pth dependency, the possibility of pthread-pth conflicts should be limited. Other uses of libassuan need to be checked.) @ text @d1 1 a1 1 $NetBSD$ @ 1.4 log @Update to 2.0.9. Changes: * Enhanced gpg-connect-agent with a small scripting language. * New option --list-config for gpgconf. * Fixed a crash in gpgconf. * The envvars XAUTHORITY and PINENTRY_USER_DATA are now passed to the pinentry. * Fixed the auto creation of the key stub for smartcards. * Fixed a rare bug in decryption using the OpenPGP card. * Creating DSA2 keys is now possible. * New option --extra-digest-algo for gpgsm to allow verification of broken signatures. * Allow encryption with legacy Elgamal sign+encrypt keys with option --rfc2440. @ text @d3 2 a4 2 --- ./g10/encr-data.c.orig 2007-12-12 02:43:38.000000000 -0700 +++ ./g10/encr-data.c d56 1 a56 9 @@@@ -100,20 +75,20 @@@@ decrypt_data( void *procctx, PKT_encrypt goto leave; blocksize = gcry_cipher_get_algo_blklen (dek->algo); if ( !blocksize || blocksize > 16 ) - log_fatal ("unsupported blocksize %u\n", blocksize ); + log_fatal("unsupported blocksize %u\n", blocksize ); nprefix = blocksize; if ( ed->len && ed->len < (nprefix+2) ) BUG(); d68 5 a72 5 - rc = gcry_cipher_open (&dfx->cipher_hd, dek->algo, + rc = gcry_cipher_open (&dfx.cipher_hd, dek->algo, GCRY_CIPHER_MODE_CFB, (GCRY_CIPHER_SECURE | ((ed->mdc_method || dek->algo >= 100)? @ 1.3 log @Update to Version 2.0.4. Changes are not described in release announcement. @ text @d3 1 a3 1 --- ./g10/encr-data.c.orig 2007-02-22 03:44:22.000000000 -0700 d5 1 a5 1 @@@@ -39,35 +39,14 @@@@ static int mdc_decode_filter ( void *opa d43 1 a43 1 @@@@ -83,11 +62,7 @@@@ decrypt_data( void *procctx, PKT_encrypt d55 2 a56 2 if (!gcry_cipher_test_algo (dek->algo)) @@@@ -101,20 +76,20 @@@@ decrypt_data( void *procctx, PKT_encrypt d81 1 a81 1 @@@@ -128,7 +103,7 @@@@ decrypt_data( void *procctx, PKT_encrypt d90 1 a90 1 @@@@ -147,7 +122,7 @@@@ decrypt_data( void *procctx, PKT_encrypt d99 1 a99 1 @@@@ -168,8 +143,8 @@@@ decrypt_data( void *procctx, PKT_encrypt d110 1 a110 1 @@@@ -179,18 +154,17 @@@@ decrypt_data( void *procctx, PKT_encrypt d135 1 a135 1 @@@@ -209,28 +183,26 @@@@ decrypt_data( void *procctx, PKT_encrypt d173 1 a173 1 @@@@ -241,7 +213,7 @@@@ static int d182 1 a182 1 @@@@ -253,11 +225,11 @@@@ mdc_decode_filter (void *opaque, int con d197 1 a197 1 @@@@ -306,10 +278,8 @@@@ mdc_decode_filter (void *opaque, int con d210 1 a210 1 @@@@ -318,10 +288,6 @@@@ mdc_decode_filter (void *opaque, int con d221 1 a221 1 @@@@ -333,7 +299,7 @@@@ mdc_decode_filter (void *opaque, int con d230 1 a230 1 @@@@ -344,18 +310,11 @@@@ decode_filter( void *opaque, int control @ 1.2 log @Update to Version 2.0.2. This is maintenance release to fix build problems found after the release of 2.0.1. There are also some minor enhancements. @ text @d3 1 a3 1 --- ./g10/encr-data.c.orig 2006-12-02 09:22:04.000000000 -0700 d55 2 a56 2 const char *s = gcry_cipher_algo_name (dek->algo); @@@@ -102,20 +77,20 @@@@ decrypt_data( void *procctx, PKT_encrypt d81 1 a81 1 @@@@ -129,7 +104,7 @@@@ decrypt_data( void *procctx, PKT_encrypt d90 1 a90 1 @@@@ -148,7 +123,7 @@@@ decrypt_data( void *procctx, PKT_encrypt d99 1 a99 1 @@@@ -169,8 +144,8 @@@@ decrypt_data( void *procctx, PKT_encrypt d110 1 a110 1 @@@@ -180,18 +155,17 @@@@ decrypt_data( void *procctx, PKT_encrypt d135 1 a135 1 @@@@ -210,28 +184,26 @@@@ decrypt_data( void *procctx, PKT_encrypt d173 1 a173 1 @@@@ -242,7 +214,7 @@@@ static int d182 1 a182 1 @@@@ -254,11 +226,11 @@@@ mdc_decode_filter (void *opaque, int con d197 1 a197 1 @@@@ -307,10 +279,8 @@@@ mdc_decode_filter (void *opaque, int con d210 1 a210 1 @@@@ -319,10 +289,6 @@@@ mdc_decode_filter (void *opaque, int con d221 1 a221 1 @@@@ -334,7 +300,7 @@@@ mdc_decode_filter (void *opaque, int con d230 1 a230 1 @@@@ -345,18 +311,11 @@@@ decode_filter( void *opaque, int control @ 1.1 log @Added patch fixing [CVE-2006-6235] remotely controllable function pointer. @ text @d3 1 a3 1 --- ./g10/encr-data.c.orig 2006-10-02 04:50:13.000000000 -0600 d5 1 a5 1 @@@@ -39,14 +39,35 @@@@ static int mdc_decode_filter ( void *opa d9 2 a10 2 -typedef struct +typedef struct decode_filter_context_s d17 23 a39 23 -} decode_filter_ctx_t; + int refcount; +} *decode_filter_ctx_t; + + +/* Helper to release the decode context. */ +static void +release_dfx_context (decode_filter_ctx_t dfx) +{ + if (!dfx) + return; + + assert (dfx->refcount); + if ( !--dfx->refcount ) + { + gcry_cipher_close (dfx->cipher_hd); + dfx->cipher_hd = NULL; + gcry_md_close (dfx->mdc_hash); + dfx->mdc_hash = NULL; + xfree (dfx); + } +} + d43 1 a43 1 @@@@ -62,7 +83,11 @@@@ decrypt_data( void *procctx, PKT_encrypt d47 6 a52 6 - memset( &dfx, 0, sizeof dfx ); + dfx = xtrycalloc (1, sizeof *dfx); + if (!dfx) + return gpg_error_from_syserror (); + dfx->refcount = 1; + d56 1 a56 1 @@@@ -77,20 +102,20 @@@@ decrypt_data( void *procctx, PKT_encrypt d60 2 a61 2 - log_fatal("unsupported blocksize %u\n", blocksize ); + log_fatal ("unsupported blocksize %u\n", blocksize ); d68 2 a69 2 - if (gcry_md_open (&dfx.mdc_hash, ed->mdc_method, 0 )) + if (gcry_md_open (&dfx->mdc_hash, ed->mdc_method, 0 )) d72 2 a73 2 - gcry_md_start_debug (dfx.mdc_hash, "checkmdc"); + gcry_md_start_debug (dfx->mdc_hash, "checkmdc"); d76 2 a77 2 - rc = gcry_cipher_open (&dfx.cipher_hd, dek->algo, + rc = gcry_cipher_open (&dfx->cipher_hd, dek->algo, d81 1 a81 1 @@@@ -104,7 +129,7 @@@@ decrypt_data( void *procctx, PKT_encrypt d85 2 a86 2 - rc = gcry_cipher_setkey (dfx.cipher_hd, dek->key, dek->keylen); + rc = gcry_cipher_setkey (dfx->cipher_hd, dek->key, dek->keylen); d90 1 a90 1 @@@@ -123,7 +148,7 @@@@ decrypt_data( void *procctx, PKT_encrypt d94 2 a95 2 - gcry_cipher_setiv (dfx.cipher_hd, NULL, 0); + gcry_cipher_setiv (dfx->cipher_hd, NULL, 0); d99 1 a99 1 @@@@ -144,8 +169,8 @@@@ decrypt_data( void *procctx, PKT_encrypt d103 4 a106 4 - gcry_cipher_decrypt (dfx.cipher_hd, temp, nprefix+2, NULL, 0); - gcry_cipher_sync (dfx.cipher_hd); + gcry_cipher_decrypt (dfx->cipher_hd, temp, nprefix+2, NULL, 0); + gcry_cipher_sync (dfx->cipher_hd); d110 1 a110 1 @@@@ -155,17 +180,18 @@@@ decrypt_data( void *procctx, PKT_encrypt d114 7 a120 7 - if ( dfx.mdc_hash ) - gcry_md_write (dfx.mdc_hash, temp, nprefix+2); - + if ( dfx->mdc_hash ) + gcry_md_write (dfx->mdc_hash, temp, nprefix+2); + + dfx->refcount++; d122 2 a123 2 - iobuf_push_filter( ed->buf, mdc_decode_filter, &dfx ); + iobuf_push_filter ( ed->buf, mdc_decode_filter, dfx ); d125 2 a126 2 - iobuf_push_filter( ed->buf, decode_filter, &dfx ); + iobuf_push_filter ( ed->buf, decode_filter, dfx ); d130 2 a131 2 - if ( ed->mdc_method && dfx.eof_seen == 2 ) + if ( ed->mdc_method && dfx->eof_seen == 2 ) d135 1 a135 1 @@@@ -184,26 +210,28 @@@@ decrypt_data( void *procctx, PKT_encrypt d139 8 a146 8 - gcry_cipher_decrypt (dfx.cipher_hd, dfx.defer, 22, NULL, 0); - gcry_md_write (dfx.mdc_hash, dfx.defer, 2); - gcry_md_final (dfx.mdc_hash); + assert (dfx->cipher_hd); + assert (dfx->mdc_hash); + gcry_cipher_decrypt (dfx->cipher_hd, dfx->defer, 22, NULL, 0); + gcry_md_write (dfx->mdc_hash, dfx->defer, 2); + gcry_md_final (dfx->mdc_hash); d148 2 a149 2 - if (dfx.defer[0] != '\xd3' || dfx.defer[1] != '\x14' ) + if (dfx->defer[0] != '\xd3' || dfx->defer[1] != '\x14' ) d155 3 a157 3 - || memcmp (gcry_md_read (dfx.mdc_hash, 0),dfx.defer+2,datalen)) + || memcmp (gcry_md_read (dfx->mdc_hash, 0), + dfx->defer+2,datalen )) d159 4 a162 4 - /* log_printhex("MDC message:", dfx.defer, 22); */ - /* log_printhex("MDC calc:", gcry_md_read (dfx.mdc_hash,0), datalen); */ + /* log_printhex("MDC message:", dfx->defer, 22); */ + /* log_printhex("MDC calc:", gcry_md_read (dfx->mdc_hash,0), datalen); */ d167 3 a169 3 - gcry_cipher_close (dfx.cipher_hd); - gcry_md_close (dfx.mdc_hash); + release_dfx_context (dfx); d173 1 a173 1 @@@@ -214,7 +242,7 @@@@ static int d177 2 a178 2 - decode_filter_ctx_t *dfx = opaque; + decode_filter_ctx_t dfx = opaque; d182 1 a182 1 @@@@ -226,11 +254,11 @@@@ mdc_decode_filter (void *opaque, int con d186 4 a189 4 - assert(a); - assert( size > 44 ); + assert (a); + assert ( size > 44 ); d192 2 a193 2 - for(n=22; n < 44 ; n++ ) + for (n=22; n < 44 ; n++ ) d197 1 a197 1 @@@@ -279,8 +307,10 @@@@ mdc_decode_filter (void *opaque, int con d201 6 a206 6 - gcry_cipher_decrypt (dfx->cipher_hd, buf, n, NULL, 0); - gcry_md_write (dfx->mdc_hash, buf, n); + if ( dfx->cipher_hd ) + gcry_cipher_decrypt (dfx->cipher_hd, buf, n, NULL, 0); + if ( dfx->mdc_hash ) + gcry_md_write (dfx->mdc_hash, buf, n); d210 1 a210 1 @@@@ -289,6 +319,10 @@@@ mdc_decode_filter (void *opaque, int con d214 4 a217 4 + else if ( control == IOBUFCTRL_FREE ) + { + release_dfx_context (dfx); + } d221 1 a221 1 @@@@ -300,7 +334,7 @@@@ mdc_decode_filter (void *opaque, int con d225 2 a226 2 - decode_filter_ctx_t *fc = opaque; + decode_filter_ctx_t fc = opaque; d230 1 a230 1 @@@@ -311,11 +345,18 @@@@ decode_filter( void *opaque, int control d234 5 a238 5 - gcry_cipher_decrypt (fc->cipher_hd, buf, n, NULL, 0); + { + if (fc->cipher_hd) + gcry_cipher_decrypt (fc->cipher_hd, buf, n, NULL, 0); + } d243 4 a246 4 + else if ( control == IOBUFCTRL_FREE ) + { + release_dfx_context (fc); + } @