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

Werner Koch via Gnupg-devel <[email protected]>
Newsgroups gmane.comp.encryption.gpg.devel
Message-ID <[email protected]>
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

_______________________________________________
Gnupg-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
openpgp-digital-signature.asc (application/pgp-signature, 247 B)
-----BEGIN PGP SIGNATURE-----

iIMEARYIACsWIQSHd0YfKgdOvEgNNZQZzByeCFsQegUCZhukSA0cd2tAZ251cGcu
b3JnAAoJEBnMHJ4IWxB63d8A/2jG71150brxpe0Vfhu3BAJLrloA2UVd7DgujcQu
7SMpAP9wAtgCXDN1fQNWS3Sv+R7SIGmDGf/8E3vZhRdZ1LWkDQ==
=eyKw
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.