Strange gpgme_sigsum_t value in gpgme (bug?)

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Jun 14 19:39:45 CEST 2011


On 06/14/2011 12:32 PM, Matthias Klumpp wrote:
> Hi!
> I'm new to GPGMe, so this maybe is a foolish question, but I stumbled upon
> a very weird behavior of GPGMe, which cause my application to act very,
> very weird :P
> I want to verify a signature, so I call
>  result = gpgme_op_verify (ctx, sig, dt, NULL);
> and fetch the result as _gpgme_op_verify_result*.
> Then I get the sigsum (gpgme_sigsum_t) from the results:
>  result->signatures->summary
> I expect one of these values for the sigsum:
>     GPGME_SIGSUM_VALID       = 0x0001,  /* The signature is fully valid. 
> */
>     GPGME_SIGSUM_GREEN       = 0x0002,  /* The signature is good.  */
>     GPGME_SIGSUM_RED         = 0x0004,  /* The signature is bad.  */
>     GPGME_SIGSUM_KEY_REVOKED = 0x0010,  /* One key has been revoked.  */
>     GPGME_SIGSUM_KEY_EXPIRED = 0x0020,  /* One key has expired.  */
>     GPGME_SIGSUM_SIG_EXPIRED = 0x0040,  /* The signature has expired.  */
>     GPGME_SIGSUM_KEY_MISSING = 0x0080,  /* Can't verify: key missing.  */
>     GPGME_SIGSUM_CRL_MISSING = 0x0100,  /* CRL not available.  */
>     GPGME_SIGSUM_CRL_TOO_OLD = 0x0200,  /* Available CRL is too old.  */
>     GPGME_SIGSUM_BAD_POLICY  = 0x0400,  /* A policy was not met.  */
>     GPGME_SIGSUM_SYS_ERROR   = 0x0800   /* A system error occured.  */
> 
> But instead I get 0x0003 as sigsum, which is not in the enum. This causes
> my application to malfunction.
> Is this a bug, or am I just doing it wrong?

I believe the field is a bitfield, so the flags are additive.

  0x03 == 0x02 + 0x01

So that means GPGME_SIGSUM_VALID + GPGME_SIGSUM_GREEN

hth,

	--dkg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1030 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20110614/7e6e8c34/attachment.pgp>


More information about the Gnupg-devel mailing list