better after init
authorVolker Birk <vb@pep.foundation>
Fri, 19 Jan 2018 16:05:07 +0100
changeset 24245fb4f5f2a5c2
parent 2423 788254d67314
child 2426 435c19d76cad
child 2427 2a3bdb936c1a
better after init
src/pgp_gpg.c
     1.1 --- a/src/pgp_gpg.c	Fri Jan 19 15:53:22 2018 +0100
     1.2 +++ b/src/pgp_gpg.c	Fri Jan 19 16:05:07 2018 +0100
     1.3 @@ -181,15 +181,6 @@
     1.4      bool bResult;
     1.5  
     1.6      if (in_first) {
     1.7 -        gpgme_engine_info_t info;
     1.8 -        int err = gpg.gpgme_get_engine_info(&info);
     1.9 -        assert(err == GPG_ERR_NO_ERROR);
    1.10 -        if (err != GPG_ERR_NO_ERROR)
    1.11 -            return PEP_OUT_OF_MEMORY;
    1.12 -
    1.13 -        if (!info->version)
    1.14 -            return PEP_CANNOT_DETERMINE_GPG_VERSION;
    1.15 -
    1.16          stringlist_t *conf_keys   = new_stringlist("keyserver");
    1.17          stringlist_t *conf_values = new_stringlist("hkp://keys.gnupg.net");
    1.18  
    1.19 @@ -482,6 +473,15 @@
    1.20  
    1.21      gpg.gpgme_set_armor(session->ctx, 1);
    1.22  
    1.23 +    gpgme_engine_info_t info;
    1.24 +    int err = gpg.gpgme_get_engine_info(&info);
    1.25 +    assert(err == GPG_ERR_NO_ERROR);
    1.26 +    if (err != GPG_ERR_NO_ERROR)
    1.27 +        return PEP_OUT_OF_MEMORY;
    1.28 +
    1.29 +    if (!info->version)
    1.30 +        return PEP_CANNOT_DETERMINE_GPG_VERSION;
    1.31 +
    1.32      return PEP_STATUS_OK;
    1.33  
    1.34  pep_error: