[gmime] GPG_CTX_MODE_SIGN_ENCRYPT also requires a passphrase



commit 983baf71b84130870e18253d21ca2617acde2dcb
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Sun Jun 30 14:08:46 2013 -0400

    GPG_CTX_MODE_SIGN_ENCRYPT also requires a passphrase

 ChangeLog                 |    7 ++++++-
 gmime/gmime-gpg-context.c |   14 ++++++++++++--
 gmime/gmime.c             |   15 +++++++++++----
 3 files changed, 29 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c633917..68b18bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,14 @@
-2013-05-05  Jeffrey Stedfast  <fejj gnome org>
+2013-06-30  Jeffrey Stedfast  <fejj gnome org>
 
        * README: Bumped version
 
        * configure.ac: Bumped version to 2.6.16
 
+2013-06-30  Jeffrey Stedfast  <fejj gnome org>
+
+       * gmime/gmime-gpg-context.c (gpg_ctx_set_mode):
+       GPG_CTX_MODE_SIGN_ENCRYPT also requires a passphrase.
+
 2013-05-05  Jeffrey Stedfast  <fejj gnome org>
 
        * gmime/gmime-filter-best.c (filter_filter): Reset the linelen
diff --git a/gmime/gmime-gpg-context.c b/gmime/gmime-gpg-context.c
index 4c99513..ec057bf 100644
--- a/gmime/gmime-gpg-context.c
+++ b/gmime/gmime-gpg-context.c
@@ -412,7 +412,17 @@ static void
 gpg_ctx_set_mode (struct _GpgCtx *gpg, enum _GpgCtxMode mode)
 {
        gpg->mode = mode;
-       gpg->need_passwd = ((gpg->mode == GPG_CTX_MODE_SIGN) || (gpg->mode == GPG_CTX_MODE_DECRYPT));
+       
+       switch (gpg->mode) {
+       case GPG_CTX_MODE_SIGN_ENCRYPT:
+       case GPG_CTX_MODE_DECRYPT:
+       case GPG_CTX_MODE_SIGN:
+               gpg->need_passwd = TRUE;
+               break;
+       default:
+               gpg->need_passwd = FALSE;
+               break;
+       }
 }
 
 static void
@@ -1561,7 +1571,7 @@ gpg_ctx_op_step (struct _GpgCtx *gpg, GError **err)
                char buffer[4096];
                ssize_t nread;
                
-               d(printf ("reading from gpg's status-fd...\n"));
+               d(printf ("reading gpg's status-fd...\n"));
                
                do {
                        nread = read (gpg->status_fd, buffer, sizeof (buffer));
diff --git a/gmime/gmime.c b/gmime/gmime.c
index 563b2e1..cace297 100644
--- a/gmime/gmime.c
+++ b/gmime/gmime.c
@@ -229,10 +229,17 @@ g_mime_shutdown (void)
        g_mime_iconv_shutdown ();
        
 #ifdef G_THREADS_ENABLED
-       g_mutex_clear (&G_LOCK_NAME (iconv_cache));
-       g_mutex_clear (&G_LOCK_NAME (iconv_utils));
-       g_mutex_clear (&G_LOCK_NAME (charset));
-       g_mutex_clear (&G_LOCK_NAME (msgid));
+       if (glib_check_version (2, 37, 4) == NULL) {
+               /* The implementation of g_mutex_clear() prior
+                * to glib 2.37.4 did not properly reset the
+                * internal mutex pointer to NULL, so re-initializing
+                * GMime would not properly re-initialize the mutexes.
+                **/
+               g_mutex_clear (&G_LOCK_NAME (iconv_cache));
+               g_mutex_clear (&G_LOCK_NAME (iconv_utils));
+               g_mutex_clear (&G_LOCK_NAME (charset));
+               g_mutex_clear (&G_LOCK_NAME (msgid));
+       }
 #endif
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]