unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
	notmuch@freelists.org, notmuch@notmuchmail.org
Subject: Re: [PATCH 2/3] devel/schemata: describe version 4
Date: Wed, 31 May 2017 11:30:01 -0300	[thread overview]
Message-ID: <87k24x6qvq.fsf@tesseract.cs.unb.ca> (raw)
In-Reply-To: <87wp8xi1yc.fsf@fifthhorseman.net>

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

> If we've got a bitfield, we should expose it as a bitfield.  but if we
> know that there is additionally a status component that has one of
> exactly three values, we should expose it as its own element.
>
> So i'd prefer:
>
>   status: "good"|"bad"|"error",
>   flags: sig_flags,
>   # if status is "good":

GMime 3.0 is just a thin wrapper around gpgme here, so we may as well consult
the latter docs. If I understand them [1] correctly, there are two
distinct "good" states, one called "VALID" and the other called
"GREEN". Alas, I had to look at the gpgme source to really understand
the intent here.

GREEN means the following

,----
|   if (sig->validity == GPGME_VALIDITY_FULL
|       || sig->validity == GPGME_VALIDITY_ULTIMATE)
|     {
|       if (gpg_err_code (sig->status) == GPG_ERR_NO_ERROR
| 	  || gpg_err_code (sig->status) == GPG_ERR_SIG_EXPIRED
| 	  || gpg_err_code (sig->status) == GPG_ERR_KEY_EXPIRED)
| 	sum |= GPGME_SIGSUM_GREEN;
|     }
`----

while VALID means in addition that the SIG_EXPIRED and KEY_EXPIRED
errors don't occur.

The subtlety here is that "error" and "green" are overlapping states
from gpgme's point of view.  One way of bridging this gap is have status
only reflect the "usability" [2] of the signature

status: "good" | "warning" | "bad" | "unknown" 

where the interested client can check the flags for details in the
latter 3 cases.

[1]: https://www.gnupg.org/documentation/manuals/gpgme/Verify.html
[2]: naming is hard

  reply	other threads:[~2017-05-31 14:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 11:45 update structured output formats for human readable signature status David Bremner
2017-05-31 11:45 ` [PATCH 1/3] emacs: convert to use format-version 3 David Bremner
2017-05-31 11:45 ` [PATCH 2/3] devel/schemata: describe version 4 David Bremner
2017-05-31 13:35   ` Daniel Kahn Gillmor
2017-05-31 14:30     ` David Bremner [this message]
2017-05-31 11:45 ` [PATCH 3/3] cli: impliment structured output " David Bremner
  -- strict thread matches above, loose matches on Subject: below --
2017-06-02  2:22 v2 human readable signature status David Bremner
2017-06-02  2:22 ` [PATCH 2/3] devel/schemata: describe version 4 David Bremner
2017-06-02  9:42   ` 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=87k24x6qvq.fsf@tesseract.cs.unb.ca \
    --to=david@tethera.net \
    --cc=dkg@fifthhorseman.net \
    --cc=notmuch@freelists.org \
    --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).