extra error values
authorVolker Birk <vb@pep.foundation>
Fri, 19 Jan 2018 15:49:57 +0100
changeset 24210c03210e9071
parent 2419 f96ddad10a7b
child 2422 5efcfbac57cd
extra error values
src/pEpEngine.h
src/pgp_gpg.c
     1.1 --- a/src/pEpEngine.h	Fri Jan 19 14:18:19 2018 +0100
     1.2 +++ b/src/pEpEngine.h	Fri Jan 19 15:49:57 2018 +0100
     1.3 @@ -37,6 +37,8 @@
     1.4      PEP_INIT_GPGME_INIT_FAILED                      = 0x0111,
     1.5      PEP_INIT_NO_GPG_HOME                            = 0x0112,
     1.6      PEP_INIT_NETPGP_INIT_FAILED                     = 0x0113,
     1.7 +    PEP_CANNOT_DETERMINE_GPG_VERSION                = 0x0114,
     1.8 +    PEP_UNSUPPORTED_GPG_VERSION                     = 0x0115,
     1.9  
    1.10      PEP_INIT_SQLITE3_WITHOUT_MUTEX                  = 0x0120,
    1.11      PEP_INIT_CANNOT_OPEN_DB                         = 0x0121,
     2.1 --- a/src/pgp_gpg.c	Fri Jan 19 14:18:19 2018 +0100
     2.2 +++ b/src/pgp_gpg.c	Fri Jan 19 15:49:57 2018 +0100
     2.3 @@ -181,6 +181,15 @@
     2.4      bool bResult;
     2.5  
     2.6      if (in_first) {
     2.7 +        gpgme_engine_info_t info;
     2.8 +        int err = gpg.gpgme_get_engine_info(&info);
     2.9 +        assert(err == GPG_ERR_NO_ERROR);
    2.10 +        if (err != GPG_ERR_NO_ERROR)
    2.11 +            return PEP_OUT_OF_MEMORY;
    2.12 +
    2.13 +        if !(info.version)
    2.14 +            return PEP_CANNOT_DETERMINE_GPG_VERSION;
    2.15 +
    2.16          stringlist_t *conf_keys   = new_stringlist("keyserver");
    2.17          stringlist_t *conf_values = new_stringlist("hkp://keys.gnupg.net");
    2.18