[PATCH 10/20] cli/show: add tests for viewing protected headers

David Bremner david at tethera.net
Sun Jun 24 18:31:44 PDT 2018


Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:

> +
> +# TODO:
> +#  * check S/MIME as well as PGP/MIME

Decrypting S/MIME would be good first step. Or is the feature there
(with gmime 3.0?) but tests missing? because T355-smime says there is no
S/MIME decryption.

> +#  * process headers protected by signature

> +
> +test_description='Message decryption with protected headers'
> +. $(dirname "$0")/test-lib.sh || exit 1
> +
> +##################################################
> +
> +add_gnupg_home
> +# Change this if we ship a new test key
> +FINGERPRINT="5AEAB11F5E33DCE875DDB75B6D92612D94E46381"

I wonder if it would be reasonable for add_gnupg_home to define FINGERPRINT

> +
> +add_email_corpus protected-headers
> +
> +test_begin_subtest "verify protected header is not visible without decryption"
> +output=$(notmuch show --format=json id:protected-header at crypto.notmuchmail.org)
> +test_json_nodes <<<"$output" \
> +                'no_crypto:[0][0][0]!"crypto"' \
> +                'subject:[0][0][0]["headers"]["Subject"]="encrypted message"'

maybe a pointer to where to find the docs for the json test syntax.



More information about the notmuch mailing list