diff --git a/ChangeLog b/ChangeLog index 5647abb3..b08dd553 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-05-26 Marcus Brinkmann + + * configure.ac (NEED_GPG_VERSION): Bump up to 1.2.2. + 2003-05-18 Marcus Brinkmann In all files, replace the Gpgme* type names with the new gpgme_* diff --git a/NEWS b/NEWS index 14e23fc6..a6523add 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,12 @@ Noteworthy changes in version 0.4.1 (unreleased) * GPGME_ATTR_IS_SECRET is not anymore representable as a string. + * GnuPG 1.2.2 is required. The progress callback is now also invoked + for encrypt, sign, encrypt-sign, decrypt, verify, and + decrypt-verify operations. For verify operations on detached + signatures, the progress callback is invoked for both the detached + signature and the plaintext message, though. + * gpgme_op_verify and gpgme_op_decrypt_verify don't return a status summary anymore. Use gpgme_get_sig_status to retrieve the individual stati. diff --git a/configure.ac b/configure.ac index 119ec88c..863f3d10 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_INIT(gpgme, 0.4.1, [bug-gpgme@gnupg.org]) LIBGPGME_LT_CURRENT=10 LIBGPGME_LT_AGE=0 LIBGPGME_LT_REVISION=0 -NEED_GPG_VERSION=1.2.0 +NEED_GPG_VERSION=1.2.2 NEED_GPGSM_VERSION=0.9.0 ############################################## AC_PREREQ(2.52) diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index bd2d4a5a..e0c80798 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,31 @@ 2003-05-26 Marcus Brinkmann + * rungpg.c (gpg_new): Add --enable-progress-filter to gpg + invocation. + * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to + decrypt_verify_start. + (gpgme_op_decrypt_verify_start): Call decrypt_verify_start. + (gpgme_op_decrypt_verify): Likewise. + * verify.c (verify_status_handler): New function that also calls + progress status handler. + (_gpgme_op_verify_start): Set status handler to verify_status_handler. + Rename to (verify_start). + (gpgme_op_verify_start): Call verify_start. + (gpgme_op_verify): Likewise. + * encrypt.c (encrypt_status_handler): New function. + (_gpgme_encrypt_sym_status_handler): Call progress status handler. + Make static. Rename to encrypt_sym_status_handler. + (encrypt_start): Set status handler to encrypt_sym_status_handler + or encrypt_status_handler. + * sign.c (sign_status_handler): New function. + (sign_start): Set status handler to sign_status_handler. + * decrypt.c (decrypt_status_handler): New function that also calls + progress status handler. + (decrypt_start): Set status handler to decrypt_status_handler. + * encrypt-sign.c (encrypt_sign_status_handler): Likewise. + * decrypt-verify.c (decrypt_verify_status_handler): Call + _gpgme_progress_status_handler. + * conversion.c (_gpgme_decode_c_string): Add missing break statement. diff --git a/gpgme/decrypt-verify.c b/gpgme/decrypt-verify.c index 33306e8b..a9745059 100644 --- a/gpgme/decrypt-verify.c +++ b/gpgme/decrypt-verify.c @@ -30,14 +30,15 @@ static gpgme_error_t decrypt_verify_status_handler (void *priv, gpgme_status_code_t code, char *args) { - return _gpgme_decrypt_status_handler (priv, code, args) + return _gpgme_progress_status_handler (priv, code, args) + || _gpgme_decrypt_status_handler (priv, code, args) || _gpgme_verify_status_handler (priv, code, args); } static gpgme_error_t -_gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, int synchronous, - gpgme_data_t cipher, gpgme_data_t plain) +decrypt_verify_start (gpgme_ctx_t ctx, int synchronous, + gpgme_data_t cipher, gpgme_data_t plain) { gpgme_error_t err; @@ -79,7 +80,7 @@ gpgme_error_t gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain) { - return _gpgme_op_decrypt_verify_start (ctx, 0, cipher, plain); + return decrypt_verify_start (ctx, 0, cipher, plain); } @@ -89,7 +90,7 @@ gpgme_error_t gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain) { - gpgme_error_t err = _gpgme_op_decrypt_verify_start (ctx, 1, cipher, plain); + gpgme_error_t err = decrypt_verify_start (ctx, 1, cipher, plain); if (!err) err = _gpgme_wait_one (ctx); return err; diff --git a/gpgme/decrypt.c b/gpgme/decrypt.c index 7e27ac2b..a1d83101 100644 --- a/gpgme/decrypt.c +++ b/gpgme/decrypt.c @@ -137,6 +137,14 @@ _gpgme_decrypt_status_handler (void *priv, gpgme_status_code_t code, } +static gpgme_error_t +decrypt_status_handler (void *priv, gpgme_status_code_t code, char *args) +{ + return _gpgme_progress_status_handler (priv, code, args) + || _gpgme_decrypt_status_handler (priv, code, args); +} + + gpgme_error_t _gpgme_op_decrypt_init_result (gpgme_ctx_t ctx) { @@ -177,8 +185,7 @@ decrypt_start (gpgme_ctx_t ctx, int synchronous, return err; } - _gpgme_engine_set_status_handler (ctx->engine, - _gpgme_decrypt_status_handler, ctx); + _gpgme_engine_set_status_handler (ctx->engine, decrypt_status_handler, ctx); return _gpgme_engine_op_decrypt (ctx->engine, cipher, plain); } diff --git a/gpgme/encrypt-sign.c b/gpgme/encrypt-sign.c index ace712a1..5d41fe96 100644 --- a/gpgme/encrypt-sign.c +++ b/gpgme/encrypt-sign.c @@ -30,7 +30,8 @@ static gpgme_error_t encrypt_sign_status_handler (void *priv, gpgme_status_code_t code, char *args) { - return _gpgme_encrypt_status_handler (priv, code, args) + return _gpgme_progress_status_handler (priv, code, args) + || _gpgme_encrypt_status_handler (priv, code, args) || _gpgme_sign_status_handler (priv, code, args); } diff --git a/gpgme/encrypt.c b/gpgme/encrypt.c index a5be70bf..b98f55a5 100644 --- a/gpgme/encrypt.c +++ b/gpgme/encrypt.c @@ -109,11 +109,19 @@ _gpgme_encrypt_status_handler (void *priv, gpgme_status_code_t code, } -gpgme_error_t -_gpgme_encrypt_sym_status_handler (void *priv, gpgme_status_code_t code, - char *args) +static gpgme_error_t +encrypt_sym_status_handler (void *priv, gpgme_status_code_t code, char *args) { - return _gpgme_passphrase_status_handler (priv, code, args); + return _gpgme_progress_status_handler (priv, code, args) + || _gpgme_passphrase_status_handler (priv, code, args); +} + + +static gpgme_error_t +encrypt_status_handler (void *priv, gpgme_status_code_t code, char *args) +{ + return _gpgme_progress_status_handler (priv, code, args) + || _gpgme_encrypt_status_handler (priv, code, args); } @@ -168,8 +176,8 @@ encrypt_start (gpgme_ctx_t ctx, int synchronous, gpgme_recipients_t recp, _gpgme_engine_set_status_handler (ctx->engine, symmetric - ? _gpgme_encrypt_sym_status_handler - : _gpgme_encrypt_status_handler, + ? encrypt_sym_status_handler + : encrypt_status_handler, ctx); return _gpgme_engine_op_encrypt (ctx->engine, recp, plain, cipher, diff --git a/gpgme/rungpg.c b/gpgme/rungpg.c index 698d0ca0..c89e39ed 100644 --- a/gpgme/rungpg.c +++ b/gpgme/rungpg.c @@ -384,6 +384,7 @@ gpg_new (void **engine) add_arg (gpg, "--no-tty"); add_arg (gpg, "--charset"); add_arg (gpg, "utf8"); + add_arg (gpg, "--enable-progress-filter"); leave: if (rc) diff --git a/gpgme/sign.c b/gpgme/sign.c index 2f7da6da..2478be8f 100644 --- a/gpgme/sign.c +++ b/gpgme/sign.c @@ -227,6 +227,14 @@ _gpgme_sign_status_handler (void *priv, gpgme_status_code_t code, char *args) } +static gpgme_error_t +sign_status_handler (void *priv, gpgme_status_code_t code, char *args) +{ + return _gpgme_progress_status_handler (priv, code, args) + || _gpgme_sign_status_handler (priv, code, args); +} + + gpgme_error_t _gpgme_op_sign_init_result (gpgme_ctx_t ctx) { @@ -274,7 +282,7 @@ sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t plain, return err; } - _gpgme_engine_set_status_handler (ctx->engine, _gpgme_sign_status_handler, + _gpgme_engine_set_status_handler (ctx->engine, sign_status_handler, ctx); return _gpgme_engine_op_sign (ctx->engine, plain, sig, mode, ctx->use_armor, diff --git a/gpgme/verify.c b/gpgme/verify.c index 460a051f..e8c8a784 100644 --- a/gpgme/verify.c +++ b/gpgme/verify.c @@ -510,6 +510,14 @@ _gpgme_verify_status_handler (void *priv, gpgme_status_code_t code, char *args) } +static gpgme_error_t +verify_status_handler (void *priv, gpgme_status_code_t code, char *args) +{ + return _gpgme_progress_status_handler (priv, code, args) + || _gpgme_verify_status_handler (priv, code, args); +} + + gpgme_error_t _gpgme_op_verify_init_result (gpgme_ctx_t ctx) { @@ -521,8 +529,8 @@ _gpgme_op_verify_init_result (gpgme_ctx_t ctx) static gpgme_error_t -_gpgme_op_verify_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t sig, - gpgme_data_t signed_text, gpgme_data_t plaintext) +verify_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t sig, + gpgme_data_t signed_text, gpgme_data_t plaintext) { gpgme_error_t err; @@ -534,8 +542,7 @@ _gpgme_op_verify_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t sig, if (err) return err; - _gpgme_engine_set_status_handler (ctx->engine, _gpgme_verify_status_handler, - ctx); + _gpgme_engine_set_status_handler (ctx->engine, verify_status_handler, ctx); if (!sig) return GPGME_No_Data; @@ -552,7 +559,7 @@ gpgme_error_t gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, gpgme_data_t plaintext) { - return _gpgme_op_verify_start (ctx, 0, sig, signed_text, plaintext); + return verify_start (ctx, 0, sig, signed_text, plaintext); } @@ -564,7 +571,7 @@ gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, { gpgme_error_t err; - err = _gpgme_op_verify_start (ctx, 1, sig, signed_text, plaintext); + err = verify_start (ctx, 1, sig, signed_text, plaintext); if (!err) err = _gpgme_wait_one (ctx); return err;