GPGME: What does ‘0’ (zero) ‘signature.summary’ value mean?

Werner Koch wk at gnupg.org
Sun Apr 14 11:39:20 CEST 2024


On Fri, 12 Apr 2024 17:30, Ben Finney said:

> What is the meaning of a GPGME `signature` result with `summary` value 0
> (zero)?

There might be a bug in the code.  We have not touched it in the last 20
years, though.

Firs the flags are computed.

  /* Calculate the red/green flag.  */
  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;
    }
  else if (sig->validity == GPGME_VALIDITY_NEVER)
    {
      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_RED;
    }
  else if (gpg_err_code (sig->status) == GPG_ERR_BAD_SIGNATURE)
    sum |= GPGME_SIGSUM_RED;

Further on the SUM is not modified if we see no error or bad signature.
Thus there are cases - depending on the signature validity and the error
code when SUM might still be zero. A new error code emitted by gpg could
result in this behaviour.

Do you have an example?


Salam-Shalom,

   Werner


-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 247 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20240414/3a081891/attachment.sig>


More information about the Gnupg-devel mailing list