Bad gpg error status checks.
authorKrista Bennett <krista@pep-project.org>
Tue, 06 Mar 2018 15:01:29 +0100
changeset 2553f66efd53d8b1
parent 2552 09d77d1177ce
child 2554 d7bbec46bd84
child 2555 5de859016cd5
child 2557 a83a5643b065
Bad gpg error status checks.
src/pgp_gpg.c
     1.1 --- a/src/pgp_gpg.c	Mon Mar 05 18:02:34 2018 +0100
     1.2 +++ b/src/pgp_gpg.c	Tue Mar 06 15:01:29 2018 +0100
     1.3 @@ -2422,8 +2422,8 @@
     1.4      data_cbs.write = _nullwriter;
     1.5      gpg.gpgme_data_new_from_cbs(&output, &data_cbs, &handle);
     1.6  
     1.7 -    gpgme_error = gpg.gpgme_op_edit(session->ctx, key, replace_only_uid_fsm, &handle,
     1.8 -            output);
     1.9 +    gpgme_error = _GPGERR(gpg.gpgme_op_edit(session->ctx, key, replace_only_uid_fsm, &handle,
    1.10 +            output));
    1.11      assert(gpgme_error == GPG_ERR_NO_ERROR);
    1.12      if(gpgme_error != GPG_ERR_NO_ERROR) {
    1.13          status = PEP_CANNOT_EDIT_KEY;
    1.14 @@ -2586,8 +2586,8 @@
    1.15      data_cbs.write = _nullwriter;
    1.16      gpg.gpgme_data_new_from_cbs(&output, &data_cbs, &handle);
    1.17  
    1.18 -    gpgme_error = gpg.gpgme_op_edit(session->ctx, key, renew_fsm, &handle,
    1.19 -            output);
    1.20 +    gpgme_error = _GPGERR(gpg.gpgme_op_edit(session->ctx, key, renew_fsm, &handle,
    1.21 +            output));
    1.22      assert(gpgme_error == GPG_ERR_NO_ERROR);
    1.23      if(gpgme_error != GPG_ERR_NO_ERROR) {
    1.24          status = PEP_CANNOT_EDIT_KEY;
    1.25 @@ -2776,8 +2776,8 @@
    1.26      data_cbs.write = _nullwriter;
    1.27      gpg.gpgme_data_new_from_cbs(&output, &data_cbs, &handle);
    1.28  
    1.29 -    gpgme_error = gpg.gpgme_op_edit(session->ctx, key, revoke_fsm, &handle,
    1.30 -            output);
    1.31 +    gpgme_error = _GPGERR(gpg.gpgme_op_edit(session->ctx, key, revoke_fsm, &handle,
    1.32 +            output));
    1.33      assert(gpgme_error == GPG_ERR_NO_ERROR);
    1.34      if(gpgme_error != GPG_ERR_NO_ERROR) {
    1.35          status = PEP_CANNOT_EDIT_KEY;
    1.36 @@ -2921,7 +2921,7 @@
    1.37      *path = NULL;
    1.38  
    1.39      gpgme_engine_info_t info;
    1.40 -    int err = gpg.gpgme_get_engine_info(&info);
    1.41 +    gpgme_error_t err = _GPGERR(gpg.gpgme_get_engine_info(&info));
    1.42      assert(err == GPG_ERR_NO_ERROR);
    1.43      if (err != GPG_ERR_NO_ERROR)
    1.44          return PEP_OUT_OF_MEMORY;
    1.45 @@ -2937,7 +2937,7 @@
    1.46      gpgme_key_t output_key;
    1.47      gpgme_error_t gpgerr = gpg.gpgme_get_key(session->ctx, fpr, &output_key, true);
    1.48      *has_private = false;
    1.49 -    switch (gpgerr) {
    1.50 +    switch (_GPGERR(gpgerr)) {
    1.51          case GPG_ERR_EOF:
    1.52          case GPG_ERR_INV_VALUE:
    1.53              status = PEP_KEY_NOT_FOUND;