ENGINE-487: ENGINE-508: fix in - old tests run, now need to test the real functionality ENGINE-487
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 21 Jan 2019 14:43:24 +0100
branchENGINE-487
changeset 32296d555032f84c
parent 3228 0d6ffda184f7
child 3230 cf7c04a22200
ENGINE-487: ENGINE-508: fix in - old tests run, now need to test the real functionality
src/pgp_gpg.c
src/pgp_gpg_internal.h
test/Makefile
test/src/EngineTestSuite.cc
     1.1 --- a/src/pgp_gpg.c	Sun Jan 20 17:27:48 2019 +0100
     1.2 +++ b/src/pgp_gpg.c	Mon Jan 21 14:43:24 2019 +0100
     1.3 @@ -360,6 +360,7 @@
     1.4          DLOAD(gpgme_signers_add);
     1.5          DLOAD(gpgme_set_passphrase_cb);
     1.6          DLOAD(gpgme_get_key);
     1.7 +        DLOAD(gpgme_strerror);
     1.8          
     1.9  #ifdef GPGME_VERSION_NUMBER
    1.10  #if (GPGME_VERSION_NUMBER >= 0x010700)
    1.11 @@ -2108,7 +2109,7 @@
    1.12                              break;
    1.13                          default:    
    1.14                              if (sk->can_encrypt)
    1.15 -                                worst_enc = _MAX(curr_enc, worst_enc);
    1.16 +                                worst_enc = _MIN(curr_enc, worst_enc);
    1.17                              break;
    1.18                      }                    
    1.19                  }    
     2.1 --- a/src/pgp_gpg_internal.h	Sun Jan 20 17:27:48 2019 +0100
     2.2 +++ b/src/pgp_gpg_internal.h	Mon Jan 21 14:43:24 2019 +0100
     2.3 @@ -81,6 +81,8 @@
     2.4          gpgme_edit_cb_t FNC, void *HANDLE, gpgme_data_t OUT);
     2.5  typedef gpgme_ssize_t (*gpgme_io_write_t)(int fd, const void *buffer,
     2.6          size_t count);
     2.7 +typedef const char*(*gpgme_strerror_t)(gpgme_error_t err);
     2.8 +
     2.9  
    2.10  #ifdef GPGME_VERSION_NUMBER 
    2.11  #if (GPGME_VERSION_NUMBER >= 0x010700)
    2.12 @@ -150,6 +152,8 @@
    2.13  	gpgme_key_release_t gpgme_key_release;
    2.14      gpgme_op_edit_t gpgme_op_edit;
    2.15      gpgme_io_write_t gpgme_io_write;
    2.16 +    
    2.17 +    gpgme_strerror_t gpgme_strerror;
    2.18  
    2.19      gpgme_set_passphrase_cb_t gpgme_set_passphrase_cb;
    2.20  };
     3.1 --- a/test/Makefile	Sun Jan 20 17:27:48 2019 +0100
     3.2 +++ b/test/Makefile	Mon Jan 21 14:43:24 2019 +0100
     3.3 @@ -20,7 +20,7 @@
     3.4  INC_DIRS := ./include /usr/local/include ../src ../sync ../asn.1
     3.5  INC_FLAGS := $(addprefix -I,$(INC_DIRS)) $(GPGME_INC) $(CPPUNIT_INC)
     3.6  
     3.7 -LDFLAGS += -L/usr/local/lib -L/opt/local/lib
     3.8 +LDFLAGS += -L/usr/local/lib
     3.9  
    3.10  CFLAGS += -Wno-deprecated
    3.11  CXXFLAGS += -Wno-deprecated
     4.1 --- a/test/src/EngineTestSuite.cc	Sun Jan 20 17:27:48 2019 +0100
     4.2 +++ b/test/src/EngineTestSuite.cc	Mon Jan 21 14:43:24 2019 +0100
     4.3 @@ -102,7 +102,7 @@
     4.4  #ifndef USE_NETPGP
     4.5      success = system("gpgconf --kill all");
     4.6      if (success != 0)
     4.7 -        throw std::runtime_error("SETUP: Error when executing 'gpgconf --kill all'.");
     4.8 +        throw std::runtime_error("SETUP: Error when executing 'gpgconf --kill all'.");    
     4.9  #endif
    4.10  
    4.11      if (stat(test_home.c_str(), &dirchk) == 0) {