]> git.notmuchmail.org Git - notmuch/commit - util/crypto.c
util/crypto: _n_m_crypto_potential_payload returns whether part is the payload
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 29 Aug 2019 15:38:50 +0000 (11:38 -0400)
committerDavid Bremner <david@tethera.net>
Sun, 1 Sep 2019 11:38:11 +0000 (08:38 -0300)
commitab0ae8b1c086ca3878f16ce40cc421eeb206c79e
tree2ed00ac849133135c2d2ff262ba9a104cfad788c
parent8b25643d08b9388ae9c38837a3dfd3dbc6b085cf
util/crypto: _n_m_crypto_potential_payload returns whether part is the payload

Our _notmuch_message_crypto_potential_payload implementation could
only return a failure if bad arguments were passed to it.  It is an
internal function, so if that happens it's an entirely internal bug
for notmuch.

It will be more useful for this function to return whether or not the
part is in fact a cryptographic payload, so we dispense with the
status return.

If some future change suggests adding a status return back, there are
only a handful of call sites, and no pressure to retain a stable API,
so it could be changed easily. But for now, go with the simpler
function.

We will use this return value in future patches, to make different
decisions based on whether a part is the cryptographic payload or not.
But for now, we just leave the places where it gets invoked marked
with (void) to show that the result is ignored.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
lib/index.cc
mime-node.c
util/crypto.c
util/crypto.h