core: Make the gpgconf option parsing of string types more robust

* src/engine-gpgconf.c (gpgconf_parse_option): Skip the string
indicator if it is not the empty string.
--

Some versions of GnuPG (~2.2.28 to 2.2.33) returned a compliance
indicator which should be an int but actually used string as type.
Simply skipping the indicator without checking that this is the
indicator does not allow to work around this type mismatch by the
gpgme users.
This commit is contained in:
Werner Koch 2021-11-25 11:48:11 +01:00
parent 43de18a292
commit b8b49c11e9
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -445,7 +445,9 @@ gpgconf_parse_option (gpgme_conf_opt_t opt,
case GPGME_CONF_PUB_KEY: case GPGME_CONF_PUB_KEY:
case GPGME_CONF_SEC_KEY: case GPGME_CONF_SEC_KEY:
case GPGME_CONF_ALIAS_LIST: case GPGME_CONF_ALIAS_LIST:
/* Skip quote character. */ /* Skip quote character. It is required by specs but
* technically not always needed. */
if (*line == '\"' && line[1])
line++; line++;
err = _gpgme_decode_percent_string (line, &arg->value.string, err = _gpgme_decode_percent_string (line, &arg->value.string,