Re: [PATCH 7/9] add a gpg_path value for notmuch_database_t

2015-12-11 Thread Daniel Kahn Gillmor
On Fri 2015-12-11 17:35:58 -0500, J. Lewis Muir wrote: > I guess I still don't get it. Why even have a _find_in_path function? > Why not just expect the gpg executable path to have already been > specified somehow (e.g. Notmuch configuration file, build-time constant, > or environment variable)?

Re: [PATCH 7/9] add a gpg_path value for notmuch_database_t

2015-12-11 Thread J. Lewis Muir
On 12/9/15 9:39 PM, Daniel Kahn Gillmor wrote: > +static notmuch_bool_t > +_find_in_path(const char* path) > +{ > +char *c = NULL, *save = NULL, *tok; > +size_t n; > +int dfd = -1; > +notmuch_bool_t ret = FALSE; > + > +n = confstr(_CS_PATH, NULL, 0); > +c = (char*)talloc_siz

Re: [PATCH 7/9] add a gpg_path value for notmuch_database_t

2015-12-11 Thread Daniel Kahn Gillmor
On Fri 2015-12-11 17:02:33 -0500, Tomi Ollila wrote: > The above code finds gpg/gpg2 (when called w/ these args) from > _CS_PATH (seems to be /bin:/usr/bin by default in linux (tried to > look how this set in *BSD -- initially it looks like /usr/local/bin > not included but... maybe we let them to

Re: [PATCH 6/9] search for a reasonable gpg implementation

2015-12-11 Thread Daniel Kahn Gillmor
On Fri 2015-12-11 17:18:52 -0500, J. Lewis Muir wrote: > On 12/11/15 3:56 PM, Tomi Ollila wrote: >>> +static const char* >>> +_notmuch_database_get_gpg_path (notmuch_database_t *notmuch) >>> +{ >>> +#define try_gpg_path(z) if (!access(z, X_OK)) return z >>> +try_gpg_path("/usr/bin/gpg2"); >>> +

Re: [PATCH 6/9] search for a reasonable gpg implementation

2015-12-11 Thread J. Lewis Muir
On 12/11/15 3:56 PM, Tomi Ollila wrote: >> +static const char* >> +_notmuch_database_get_gpg_path (notmuch_database_t *notmuch) >> +{ >> +#define try_gpg_path(z) if (!access(z, X_OK)) return z >> +try_gpg_path("/usr/bin/gpg2"); >> +try_gpg_path("/bin/gpg2"); >> +try_gpg_path("/usr/bin/g

Re: allow indexing cleartext of encrypted messages

2015-12-11 Thread Tomi Ollila
On Fri, Dec 11 2015, Daniel Kahn Gillmor wrote: > On Wed 2015-12-09 22:39:37 -0500, Daniel Kahn Gillmor wrote: >> * the libnotmuch API is extended with >>notmuch_database_add_message_try_decrypt(). This should probably >>ultimately be more general, because there are a few additional >>

Re: [PATCH 7/9] add a gpg_path value for notmuch_database_t

2015-12-11 Thread Tomi Ollila
On Thu, Dec 10 2015, Daniel Kahn Gillmor wrote: > Exposing this to the user of the library lets the user point to > arbitrary gpg executables when trying to decrypt. > --- > lib/database-private.h | 3 ++ > lib/database.cc| 93 > +++--- > lib

Re: [PATCH 6/9] search for a reasonable gpg implementation

2015-12-11 Thread Tomi Ollila
On Thu, Dec 10 2015, Daniel Kahn Gillmor wrote: > When the notmuch database needs to find gpg, have it search reasonable > paths first. > --- > lib/database.cc | 13 - > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/lib/database.cc b/lib/database.cc > index 62bc6d9

Re: [PATCH 2/9] Add a lazily-initialized crypto context to notmuch_database_t

2015-12-11 Thread Tomi Ollila
On Thu, Dec 10 2015, Daniel Kahn Gillmor wrote: > This is in large part a duplicate of parts of crypto.c, but that code > is in the client (outside the library), and we don't want to entangle > the libgmime API with the libnotmuch API. > > I welcome better proposals for how to share this code exp

Re: [PATCH 1/9] reorganize indexing of multipart/signed and multipart/encrypted

2015-12-11 Thread Tomi Ollila
On Thu, Dec 10 2015, Daniel Kahn Gillmor wrote: > This prepares the codebase for a cleaner changeset for dealing with > indexing some encrypted messages in the clear. > --- > lib/index.cc | 38 ++ > 1 file changed, 18 insertions(+), 20 deletions(-) > > diff --

Re: [PATCH v2] add notmuch.Database.get_status_string()

2015-12-11 Thread Justus Winter
Quoting Daniel Kahn Gillmor (2015-12-10 03:18:17) > Sorry about the first version, which didn't handle a NULL value > properly. Please only consider this v2 version. Applied, thanks. I changed it slightly to conform with our naming scheme. Justus signature.asc Description: signature _

Re: allow indexing cleartext of encrypted messages

2015-12-11 Thread Daniel Kahn Gillmor
On Wed 2015-12-09 22:39:37 -0500, Daniel Kahn Gillmor wrote: > * the libnotmuch API is extended with >notmuch_database_add_message_try_decrypt(). This should probably >ultimately be more general, because there are a few additional >knobs that i can imagine fiddling at indexing time.

Re: [PATCH 2/9] Add a lazily-initialized crypto context to notmuch_database_t

2015-12-11 Thread Daniel Kahn Gillmor
On Fri 2015-12-11 09:03:05 -0500, David Bremner wrote: > Daniel Kahn Gillmor writes: > >> This is in large part a duplicate of parts of crypto.c, but that code >> is in the client (outside the library), and we don't want to entangle >> the libgmime API with the libnotmuch API. >> >> I welcome bett

Re: [PATCH 2/9] Add a lazily-initialized crypto context to notmuch_database_t

2015-12-11 Thread David Bremner
Daniel Kahn Gillmor writes: > This is in large part a duplicate of parts of crypto.c, but that code > is in the client (outside the library), and we don't want to entangle > the libgmime API with the libnotmuch API. > > I welcome better proposals for how to share this code explicitly > between th

[Patch v2 8/8] debian: add gpgsm as build dependency

2015-12-11 Thread David Bremner
It's not needed for the actual build, but it is needed to run the SMIME tests; means it can be omitted if the tests are not going to be run. --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 3e71ee4..d08951c 100644 --- a/debian/control ++

[Patch v2 6/8] cli: crypto: S/MIME verification support

2015-12-11 Thread David Bremner
From: Jani Nikula notmuch-show --verify will now also process S/MIME multiparts if encountered. Requires gmime-2.6 and gpgsm. Based on work by Jameson Graef Rollins . --- crypto.c | 35 +++ notmuch-client.h | 7 +-- test/T355-smime.sh | 1 - 3 f

[Patch v2 1/8] crypto: refactor context creation to facilitate further work

2015-12-11 Thread David Bremner
From: Jani Nikula Let the context creation functions decide how to handle multiple calls and cache the crypto context. No functional changes. --- crypto.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/crypto.c b/crypto.c index a6eb27d..1187ad7 100644 --

[Patch v2 2/8] crypto: make crypto ctx initialization an array

2015-12-11 Thread David Bremner
From: Jani Nikula Make it trivial to add handlers for new protocols without duplicating code. No functional changes. --- crypto.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/crypto.c b/crypto.c index 1187ad7..da0289d 100644 --- a/crypto.c +++

[Patch v2 4/8] test: initial tests for S/MIME and notmuch-emacs

2015-12-11 Thread David Bremner
Test the ability of notmuch-mua-mail to send S/MIME signed (and encrypted) messages; this really relies on existing functionality in message-mode. The dependency on openssl to generate keys seems acceptable since that's the method I got to work for smime signing in emacs. The generated keys and m

[Patch v2 5/8] test: add broken S/MIME signature verification test for notmuch CLI

2015-12-11 Thread David Bremner
The test is pretty much cut and paste from the PGP/MIME version, with obvious updates taken from notmuch output. This also requires setting up gpgsm infrastucture. --- test/T355-smime.sh | 50 ++ test/test-lib.sh | 1 + 2 files changed, 51 insert

[Patch v2 3/8] cli: let the user know which protocol is unknown or unsupported

2015-12-11 Thread David Bremner
From: Jani Nikula The current error message is not helpful. --- crypto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto.c b/crypto.c index da0289d..feae949 100644 --- a/crypto.c +++ b/crypto.c @@ -81,7 +81,8 @@ notmuch_crypto_get_context (notmuch_crypto_t *crypto, c

[Patch v2 7/8] debian: Recommend gpgsm for S/MIME support

2015-12-11 Thread David Bremner
From: Jameson Graef Rollins --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 7e6a548..3e71ee4 100644 --- a/debian/control +++ b/debian/control @@ -31,7 +31,7 @@ Vcs-Browser: http://git.notmuchmail.org/git/notmuch Packag

SMIME signature creation/verification v2

2015-12-11 Thread David Bremner
This obsoletes id:1439746876-23654-1-git-send-email-da...@tethera.net The main change is to split the creation of the protocol array into two steps, the first in patch 2/8, so that (hopefully) it builds after every patch in the series. I also fixed a few small whitespace issue, and added t

Re: debian build-dependencies for testing should be marked

2015-12-11 Thread Daniel Kahn Gillmor
On Fri 2015-12-11 08:23:09 -0500, David Bremner wrote: > I was updating the smime series, and I decided to try it out. Build profiles > seem > to work in Debian Stable. For me this is old enough, so unless convinced > otherwise, I'll gradually start using for test suite only for > test suite only

Re: debian build-dependencies for testing should be marked

2015-12-11 Thread David Bremner
David Bremner writes: > > Daniel and I chatted a bit on IRC, but for the record, other than lack > of time, my current concern about this is how well supported > build-profiles are supported on Debian stable. I haven't researched > this, but feedback is welcome. > I was updating the smime series