unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH 08/16] gmime-cleanup: drop all unused GMimeCryptoContext arguments
Date: Thu,  2 May 2019 01:16:45 -0400	[thread overview]
Message-ID: <20190502051653.8502-9-dkg@fifthhorseman.net> (raw)
In-Reply-To: <20190502051653.8502-1-dkg@fifthhorseman.net>

signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
 lib/index.cc       |  3 +--
 mime-node.c        | 13 +++++--------
 notmuch-client.h   |  2 +-
 notmuch-insert.c   |  2 +-
 notmuch-new.c      |  2 +-
 notmuch-reindex.c  |  2 +-
 notmuch.c          |  2 +-
 util/crypto.c      |  1 -
 util/crypto.h      |  1 -
 util/gmime-extra.h |  2 --
 10 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/lib/index.cc b/lib/index.cc
index 76830921..f21761d0 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -528,12 +528,11 @@ _index_encrypted_mime_part (notmuch_message_t *message,
 
     notmuch = notmuch_message_get_database (message);
 
-    GMimeCryptoContext* crypto_ctx = NULL;
     bool attempted = false;
     GMimeDecryptResult *decrypt_result = NULL;
     bool get_sk = (notmuch_indexopts_get_decrypt_policy (indexopts) == NOTMUCH_DECRYPT_TRUE);
     clear = _notmuch_crypto_decrypt (&attempted, notmuch_indexopts_get_decrypt_policy (indexopts),
-				     message, crypto_ctx, encrypted_data, get_sk ? &decrypt_result : NULL, &err);
+				     message, encrypted_data, get_sk ? &decrypt_result : NULL, &err);
     if (!attempted)
 	return;
     if (err || !clear) {
diff --git a/mime-node.c b/mime-node.c
index 9b4c4c79..ffd116ef 100644
--- a/mime-node.c
+++ b/mime-node.c
@@ -170,8 +170,7 @@ set_signature_list_destructor (mime_node_t *node)
 
 /* Verify a signed mime node (GMime 2.6) */
 static void
-node_verify (mime_node_t *node, GMimeObject *part,
-	     g_mime_3_unused(GMimeCryptoContext *cryptoctx))
+node_verify (mime_node_t *node, GMimeObject *part)
 {
     GError *err = NULL;
 
@@ -191,8 +190,7 @@ node_verify (mime_node_t *node, GMimeObject *part,
 
 /* Decrypt and optionally verify an encrypted mime node (GMime 2.6) */
 static void
-node_decrypt_and_verify (mime_node_t *node, GMimeObject *part,
-			 g_mime_3_unused(GMimeCryptoContext *cryptoctx))
+node_decrypt_and_verify (mime_node_t *node, GMimeObject *part)
 {
     GError *err = NULL;
     GMimeDecryptResult *decrypt_result = NULL;
@@ -209,7 +207,7 @@ node_decrypt_and_verify (mime_node_t *node, GMimeObject *part,
 	node->decrypted_child = _notmuch_crypto_decrypt (&node->decrypt_attempted,
 							 node->ctx->crypto->decrypt,
 							 message,
-							 cryptoctx, encrypteddata, &decrypt_result, &err);
+							 encrypteddata, &decrypt_result, &err);
     }
     if (! node->decrypted_child) {
 	fprintf (stderr, "Failed to decrypt part: %s\n",
@@ -249,7 +247,6 @@ static mime_node_t *
 _mime_node_create (mime_node_t *parent, GMimeObject *part)
 {
     mime_node_t *node = talloc_zero (parent, mime_node_t);
-    GMimeCryptoContext *cryptoctx = NULL;
 
     /* Set basic node properties */
     node->part = part;
@@ -290,7 +287,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)
 		     "message (must be exactly 2)\n",
 		     node->nchildren);
 	} else {
-	    node_decrypt_and_verify (node, part, cryptoctx);
+	    node_decrypt_and_verify (node, part);
 	}
     } else if (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->crypto->verify) {
 	if (node->nchildren != 2) {
@@ -299,7 +296,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)
 		     "(must be exactly 2)\n",
 		     node->nchildren);
 	} else {
-	    node_verify (node, part, cryptoctx);
+	    node_verify (node, part);
 	}
     }
 
diff --git a/notmuch-client.h b/notmuch-client.h
index fba28242..d762d3cc 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -506,6 +506,6 @@ struct _notmuch_client_indexing_cli_choices {
 extern struct _notmuch_client_indexing_cli_choices indexing_cli_choices;
 extern const notmuch_opt_desc_t  notmuch_shared_indexing_options [];
 notmuch_status_t
-notmuch_process_shared_indexing_options (notmuch_database_t *notmuch, notmuch_config_t *config);
+notmuch_process_shared_indexing_options (notmuch_database_t *notmuch);
 
 #endif
diff --git a/notmuch-insert.c b/notmuch-insert.c
index d229c9dc..327470d4 100644
--- a/notmuch-insert.c
+++ b/notmuch-insert.c
@@ -550,7 +550,7 @@ notmuch_insert_command (notmuch_config_t *config, int argc, char *argv[])
 
     notmuch_exit_if_unmatched_db_uuid (notmuch);
 
-    status = notmuch_process_shared_indexing_options (notmuch, config);
+    status = notmuch_process_shared_indexing_options (notmuch);
     if (status != NOTMUCH_STATUS_SUCCESS) {
 	fprintf (stderr, "Error: Failed to process index options. (%s)\n",
 		 notmuch_status_to_string (status));
diff --git a/notmuch-new.c b/notmuch-new.c
index 6a54a1a1..184e9aa2 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -1198,7 +1198,7 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
     if (notmuch == NULL)
 	return EXIT_FAILURE;
 
-    status = notmuch_process_shared_indexing_options (notmuch, config);
+    status = notmuch_process_shared_indexing_options (notmuch);
     if (status != NOTMUCH_STATUS_SUCCESS) {
 	fprintf (stderr, "Error: Failed to process index options. (%s)\n",
 		 notmuch_status_to_string (status));
diff --git a/notmuch-reindex.c b/notmuch-reindex.c
index fefa7c63..3139a8c6 100644
--- a/notmuch-reindex.c
+++ b/notmuch-reindex.c
@@ -117,7 +117,7 @@ notmuch_reindex_command (notmuch_config_t *config, int argc, char *argv[])
 
     notmuch_exit_if_unmatched_db_uuid (notmuch);
 
-    status = notmuch_process_shared_indexing_options (notmuch, config);
+    status = notmuch_process_shared_indexing_options (notmuch);
     if (status != NOTMUCH_STATUS_SUCCESS) {
 	fprintf (stderr, "Error: Failed to process index options. (%s)\n",
 		 notmuch_status_to_string (status));
diff --git a/notmuch.c b/notmuch.c
index c11e4cb1..de85041b 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -112,7 +112,7 @@ const notmuch_opt_desc_t  notmuch_shared_indexing_options [] = {
 
 
 notmuch_status_t
-notmuch_process_shared_indexing_options (notmuch_database_t *notmuch, g_mime_3_unused(notmuch_config_t *config))
+notmuch_process_shared_indexing_options (notmuch_database_t *notmuch)
 {
     if (indexing_cli_choices.opts == NULL)
 	indexing_cli_choices.opts = notmuch_database_get_default_indexopts (notmuch);
diff --git a/util/crypto.c b/util/crypto.c
index 8104263d..ba67d4f4 100644
--- a/util/crypto.c
+++ b/util/crypto.c
@@ -32,7 +32,6 @@ GMimeObject *
 _notmuch_crypto_decrypt (bool *attempted,
 			 notmuch_decryption_policy_t decrypt,
 			 notmuch_message_t *message,
-			 g_mime_3_unused(GMimeCryptoContext* crypto_ctx),
 			 GMimeMultipartEncrypted *part,
 			 GMimeDecryptResult **decrypt_result,
 			 GError **err)
diff --git a/util/crypto.h b/util/crypto.h
index dbb333eb..af3998e8 100644
--- a/util/crypto.h
+++ b/util/crypto.h
@@ -18,7 +18,6 @@ GMimeObject *
 _notmuch_crypto_decrypt (bool *attempted,
 			 notmuch_decryption_policy_t decrypt,
 			 notmuch_message_t *message,
-			 GMimeCryptoContext* crypto_ctx,
 			 GMimeMultipartEncrypted *part,
 			 GMimeDecryptResult **decrypt_result,
 			 GError **err);
diff --git a/util/gmime-extra.h b/util/gmime-extra.h
index c17fa8fb..60ae8765 100644
--- a/util/gmime-extra.h
+++ b/util/gmime-extra.h
@@ -34,8 +34,6 @@ typedef GMimeAddressType GMimeRecipientType;
 
 typedef GMimeSignatureStatus GMimeSignatureError;
 
-#define g_mime_3_unused(arg) unused(arg)
-
 /**
  * Get last 16 hex digits of fingerprint ("keyid")
  */
-- 
2.20.1

  parent reply	other threads:[~2019-05-02  5:17 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01 10:46 [PATCH] build: drop support for gmime-2.6 David Bremner
2019-05-01 19:58 ` Tomi Ollila
2019-05-01 20:37   ` David Bremner
2019-05-01 20:14 ` Daniel Kahn Gillmor
2019-05-01 20:35   ` David Bremner
2019-05-01 20:41     ` Rollins, Jameson
2019-05-02  1:07       ` David Bremner
2019-05-02  2:21         ` Rollins, Jameson
2019-05-02  5:16 ` Dropping GMime 2.6 compatibility layer Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 01/16] gmime-cleanup: drop unused gmime 2.6 content_type from _index_encrypted_mime_part Daniel Kahn Gillmor
2019-05-02  9:40     ` David Bremner
2019-05-02  5:16   ` [PATCH 02/16] gmime-cleanup: remove GMime 2.6 variant codeblocks Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 03/16] gmime-cleanup: remove obsolete gpg_path configuration option and crypto contexts Daniel Kahn Gillmor
2019-05-02  9:50     ` David Bremner
2019-05-02 13:01       ` Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 04/16] gmime-cleanup: always support session keys Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 05/16] gmime-cleanup: tests should only care about gmime 3 Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 06/16] gmime-cleanup: simplify T355-smime.sh Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 07/16] gmime-cleanup: drop g_mime_2_6_unref Daniel Kahn Gillmor
2019-05-02  5:16   ` Daniel Kahn Gillmor [this message]
2019-05-02 10:03     ` [PATCH 08/16] gmime-cleanup: drop all unused GMimeCryptoContext arguments David Bremner
2019-05-02  5:16   ` [PATCH 09/16] gmime-cleanup: drop unused gmime #defines and simplify g_mime_init () Daniel Kahn Gillmor
2019-05-02  9:24     ` David Bremner
2019-05-02  5:16   ` [PATCH 10/16] gmime-cleanup: use GMime 3.0 data types Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 11/16] gmime-cleanup: use GMime 3.0 function names Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 12/16] gmime-cleanup: pass NULL arguments explicitly where GMime 3.0 expects it Daniel Kahn Gillmor
2019-05-02 10:06     ` David Bremner
2019-05-02  5:16   ` [PATCH 13/16] gmime-cleanup: pass NULL as default GMimeParserOptions Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 14/16] gmime-cleanup: no longer need to use GMime major version during build Daniel Kahn Gillmor
2019-05-02 10:10     ` David Bremner
2019-05-02 13:09       ` Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 15/16] gmime-cleanup: use GMIME_MINVER instead of GMIME3_MINVER Daniel Kahn Gillmor
2019-05-02  5:16   ` [PATCH 16/16] gmime-cleanup: strip remaining references to GMime 2.6 Daniel Kahn Gillmor
2019-05-02 13:19   ` [PATCH v2 01/15] build: drop support for gmime-2.6 Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 02/15] gmime-cleanup: drop unused gmime 2.6 content_type from _index_encrypted_mime_part Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 03/15] gmime-cleanup: remove GMime 2.6 variant codeblocks Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 04/15] gmime-cleanup: remove obsolete gpg_path configuration option and crypto contexts Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 05/15] gmime-cleanup: always support session keys Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 06/15] gmime-cleanup: tests should only care about gmime 3 Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 07/15] gmime-cleanup: simplify T355-smime.sh Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 08/15] gmime-cleanup: drop g_mime_2_6_unref Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 09/15] gmime-cleanup: drop all arguments unused in GMime 3 Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 10/15] gmime-cleanup: drop unused gmime #defines and simplify g_mime_init () Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 11/15] gmime-cleanup: use GMime 3.0 data types Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 12/15] gmime-cleanup: use GMime 3.0 function names Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 13/15] gmime-cleanup: pass NULL arguments explicitly where GMime 3.0 expects it Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 14/15] gmime-cleanup: pass NULL as default GMimeParserOptions Daniel Kahn Gillmor
2019-05-02 13:19     ` [PATCH v2 15/15] gmime-cleanup: no longer need to use GMime major version during build Daniel Kahn Gillmor
2019-05-03 10:43     ` [PATCH v2 01/15] build: drop support for gmime-2.6 David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190502051653.8502-9-dkg@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).