2003-05-26 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Mon, 26 May 2003 21:50:45 +0000 (21:50 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Mon, 26 May 2003 21:50:45 +0000 (21:50 +0000)
* configure.ac (NEED_GPG_VERSION): Bump up to 1.2.2.

gpgme/
2003-05-26  Marcus Brinkmann  <marcus@g10code.de>

* 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.

trunk/ChangeLog
trunk/NEWS
trunk/configure.ac
trunk/gpgme/ChangeLog
trunk/gpgme/decrypt-verify.c
trunk/gpgme/decrypt.c
trunk/gpgme/encrypt-sign.c
trunk/gpgme/encrypt.c
trunk/gpgme/rungpg.c
trunk/gpgme/sign.c
trunk/gpgme/verify.c

index 5647abb3545179fa51ddcb8dcb16907a55232542..b08dd5539d0fc898441b87a46c259d5a81227660 100644 (file)
@@ -1,3 +1,7 @@
+2003-05-26  Marcus Brinkmann  <marcus@g10code.de>
+
+       * configure.ac (NEED_GPG_VERSION): Bump up to 1.2.2.
+
 2003-05-18  Marcus Brinkmann  <marcus@g10code.de>
 
        In all files, replace the Gpgme* type names with the new gpgme_*
index 14e23fc684326d5907636ac5471a6f69041cc499..a6523add86cc12aa869ccb4f84764215a83a2554 100644 (file)
@@ -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.
index 119ec88cc53d58e76627f1f432dd872e71bd9eb2..863f3d10d4f78b413d32fd9f2d6381650c92ed78 100644 (file)
@@ -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)
index bd2d4a5ad21eddef3a2cb8436d0b27d27df77e89..e0c8079856381b91eef45b6a8593bc604ba84722 100644 (file)
@@ -1,5 +1,31 @@
 2003-05-26  Marcus Brinkmann  <marcus@g10code.de>
 
+       * 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.
 
index 33306e8bbbe312f825af0287d71ac5db1f4fcf71..a9745059bee756b88bbdac17472f8175a680aa52 100644 (file)
@@ -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;
index 7e27ac2b20af7b7156c3185fe7d60ee809d52d75..a1d83101f9f7fc5eb3d5c6b4073d81b380fe4aa5 100644 (file)
@@ -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);
 }
index ace712a1d6017273b89808b23e3a6e2d3869aabd..5d41fe96fbc7c46095ef5f3a0c17cdf3a5ea01f3 100644 (file)
@@ -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);
 }
 
index a5be70bf29d564bc7f8698a1b4ce1b8c20342fd9..b98f55a5a72d9e0a6040549ddad4e2015498d2ea 100644 (file)
@@ -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_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_passphrase_status_handler (priv, code, 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,
index 698d0ca01edc630daf6df9fd48de379188e1cb6c..c89e39edbf37c4922da2c04bfa6d40d382d0f8c2 100644 (file)
@@ -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)
index 2f7da6da3b580869ec8f72c92c3e1590271644b8..2478be8f0dea6d23031086accfddfa9a918a9a4d 100644 (file)
@@ -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,
index 460a051fe30cb3e8424c2184d20bbc1a8ecd3d01..e8c8a7842687d0cacb302ae07cdaf96c6d17d16f 100644 (file)
@@ -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;