diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine-gpg.c | 19 | ||||
| -rw-r--r-- | src/gpgme.h.in | 3 | ||||
| -rw-r--r-- | src/key.c | 2 | ||||
| -rw-r--r-- | src/keylist.c | 20 | 
4 files changed, 37 insertions, 7 deletions
diff --git a/src/engine-gpg.c b/src/engine-gpg.c index 16571a5a..942711f9 100644 --- a/src/engine-gpg.c +++ b/src/engine-gpg.c @@ -2283,12 +2283,19 @@ gpg_keylist_build_options (engine_gpg_t gpg, int secret_only,    gpg_error_t err;    err = add_arg (gpg, "--with-colons"); -  if (!err) -    err = add_arg (gpg, "--fixed-list-mode"); -  if (!err) -    err = add_arg (gpg, "--with-fingerprint"); -  if (!err) -    err = add_arg (gpg, "--with-fingerprint"); + +  /* Since gpg 2.1.15 fingerprints are always printed, thus there is +   * no more need to explictly reqeust them.  */ +  if (!have_gpg_version (gpg, "2.1.15")) +    { +      if (!err) +        err = add_arg (gpg, "--fixed-list-mode"); +      if (!err) +        err = add_arg (gpg, "--with-fingerprint"); +      if (!err) +        err = add_arg (gpg, "--with-fingerprint"); +    } +    if (!err && (mode & GPGME_KEYLIST_MODE_WITH_SECRET))      err = add_arg (gpg, "--with-secret");    if (!err diff --git a/src/gpgme.h.in b/src/gpgme.h.in index 49d56c37..c05686d8 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -691,6 +691,9 @@ struct _gpgme_subkey    /* The name of the curve for ECC algorithms or NULL.  */    char *curve; + +  /* The keygrip of the subkey in hex digit form or NULL if not availabale.  */ +  char *keygrip;  };  typedef struct _gpgme_subkey *gpgme_subkey_t; @@ -333,6 +333,8 @@ gpgme_key_unref (gpgme_key_t key)  	free (subkey->fpr);        if (subkey->curve)  	free (subkey->curve); +      if (subkey->keygrip) +	free (subkey->keygrip);        if (subkey->card_number)  	free (subkey->card_number);        free (subkey); diff --git a/src/keylist.c b/src/keylist.c index fcf574fc..5a346ea4 100644 --- a/src/keylist.c +++ b/src/keylist.c @@ -426,7 +426,7 @@ keylist_colon_handler (void *priv, char *line)    gpgme_ctx_t ctx = (gpgme_ctx_t) priv;    enum      { -      RT_NONE, RT_SIG, RT_UID, RT_SUB, RT_PUB, RT_FPR, +      RT_NONE, RT_SIG, RT_UID, RT_SUB, RT_PUB, RT_FPR, RT_GRP,        RT_SSB, RT_SEC, RT_CRT, RT_CRS, RT_REV, RT_SPK      }    rectype = RT_NONE; @@ -479,6 +479,8 @@ keylist_colon_handler (void *priv, char *line)      rectype = RT_CRS;    else if (!strcmp (field[0], "fpr") && key)      rectype = RT_FPR; +  else if (!strcmp (field[0], "grp") && key) +    rectype = RT_GRP;    else if (!strcmp (field[0], "uid") && key)      rectype = RT_UID;    else if (!strcmp (field[0], "sub") && key) @@ -717,6 +719,22 @@ keylist_colon_handler (void *priv, char *line)  	}        break; +    case RT_GRP: +      /* Field 10 has the keygrip.  */ +      if (fields >= 10 && field[9] && *field[9]) +	{ +          /* Need to apply it to the last subkey because all subkeys +             have a keygrip. */ +          subkey = key->_last_subkey; +          if (!subkey->keygrip) +            { +              subkey->keygrip = strdup (field[9]); +              if (!subkey->keygrip) +                return gpg_error_from_syserror (); +            } +	} +      break; +      case RT_SIG:      case RT_REV:        if (!opd->tmp_uid)  | 
