IOSAD-103 merge in sync IOSAD-103
authorDirk Zimmermann <dz@pep.security>
Wed, 05 Dec 2018 08:32:25 +0100
branchIOSAD-103
changeset 31728178a8ad33b2
parent 3168 0cf9b5e8afeb
parent 3171 13355e5d4756
child 3177 990b7d72351c
IOSAD-103 merge in sync
     1.1 --- a/src/keymanagement.c	Sat Dec 01 15:21:50 2018 +0100
     1.2 +++ b/src/keymanagement.c	Wed Dec 05 08:32:25 2018 +0100
     1.3 @@ -1228,12 +1228,22 @@
     1.4  
     1.5      if (!(session && ident && ident->fpr))
     1.6          return PEP_ILLEGAL_VALUE;
     1.7 -            
     1.8 -        // See if key is revoked already
     1.9 +
    1.10 +    bool has_private = false;
    1.11 +    
    1.12 +    status = contains_priv_key(session, ident->fpr, &has_private);        
    1.13 +
    1.14 +    if (status != PEP_STATUS_OK && status != PEP_KEY_NOT_FOUND)
    1.15 +        return status;
    1.16 +        
    1.17 +    // See if key is revoked already
    1.18 +    if (has_private) {
    1.19          bool revoked = false;
    1.20          status = key_revoked(session, ident->fpr, &revoked);
    1.21 +
    1.22          if (!revoked)
    1.23              revoke_key(session, ident->fpr, NULL);
    1.24 +    }            
    1.25              
    1.26      // double-check to be sure key is even in the DB
    1.27      if (ident->fpr)
     2.1 --- a/test/Makefile	Sat Dec 01 15:21:50 2018 +0100
     2.2 +++ b/test/Makefile	Wed Dec 05 08:32:25 2018 +0100
     2.3 @@ -17,13 +17,14 @@
     2.4  OBJS := $(addsuffix .o,$(basename $(SRCS)))
     2.5  DEPS := $(OBJS:.o=.d)
     2.6  
     2.7 -INC_DIRS := ./include /usr/local/include 
     2.8 +INC_DIRS := ./include /usr/local/include ../src ../sync ../asn.1
     2.9  INC_FLAGS := $(addprefix -I,$(INC_DIRS)) $(GPGME_INC) $(CPPUNIT_INC)
    2.10  
    2.11  LDFLAGS += -L/usr/local/lib
    2.12  
    2.13  CFLAGS += -Wno-deprecated
    2.14  CXXFLAGS += -Wno-deprecated
    2.15 +CFLAGS:=$(filter-out -Wall,$(CFLAGS))
    2.16  
    2.17  LDFLAGS+= $(ETPAN_LIB) $(CPPUNIT_LIB) -L../asn.1 -L../src
    2.18  LDLIBS+= -letpan -lpEpEngine -lstdc++ -lasn1
    2.19 @@ -34,6 +35,7 @@
    2.20  
    2.21  ifeq ($(OPENPGP),NETPGP)
    2.22  	LDLIBS+= -lnetpgp
    2.23 +	CFLAGS+= -DUSE_NETPGP
    2.24  ifeq ($(BUILD_FOR),Linux)
    2.25  	LDLIBS+= -ltre
    2.26  endif
    2.27 @@ -88,8 +90,11 @@
    2.28  
    2.29  all: suitemaker $(TARGET) test_home_ scripts
    2.30  	
    2.31 +%.o: %.cc
    2.32 +	$(CXX) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    2.33 +
    2.34  $(TARGET): $(OBJS)
    2.35 -	$(CXX) $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $@
    2.36 +	$(CXX) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $@
    2.37  
    2.38  .PHONY: suitemaker
    2.39  suitemaker:
     3.1 --- a/test/include/LeastCommonDenomColorTests.h	Sat Dec 01 15:21:50 2018 +0100
     3.2 +++ b/test/include/LeastCommonDenomColorTests.h	Wed Dec 05 08:32:25 2018 +0100
     3.3 @@ -5,11 +5,11 @@
     3.4  #define LEAST_COMMON_DENOM_COLOR_H
     3.5  
     3.6  #include <string>
     3.7 -#include "EngineTestSessionSuite.h"
     3.8 +#include "EngineTestIndividualSuite.h"
     3.9  
    3.10  using namespace std;
    3.11  
    3.12 -class LeastCommonDenomColorTests : public EngineTestSessionSuite {
    3.13 +class LeastCommonDenomColorTests : public EngineTestIndividualSuite {
    3.14      public:
    3.15          LeastCommonDenomColorTests(string test_suite, string test_home_dir);
    3.16      private:
     4.1 --- a/test/src/EngineTestSuite.cc	Sat Dec 01 15:21:50 2018 +0100
     4.2 +++ b/test/src/EngineTestSuite.cc	Wed Dec 05 08:32:25 2018 +0100
     4.3 @@ -10,8 +10,8 @@
     4.4  #include <sys/types.h>
     4.5  #include <sys/stat.h>
     4.6  
     4.7 -#import <string>
     4.8 -#import <vector>
     4.9 +#include <string>
    4.10 +#include <vector>
    4.11  #include <utility>
    4.12  
    4.13  #include "platform_unix.h"
     5.1 --- a/test/src/engine_tests/LeastCommonDenomColorTests.cc	Sat Dec 01 15:21:50 2018 +0100
     5.2 +++ b/test/src/engine_tests/LeastCommonDenomColorTests.cc	Wed Dec 05 08:32:25 2018 +0100
     5.3 @@ -14,13 +14,13 @@
     5.4  #include "test_util.h"
     5.5  
     5.6  #include <cpptest.h>
     5.7 -#include "EngineTestSessionSuite.h"
     5.8 +#include "EngineTestIndividualSuite.h"
     5.9  #include "LeastCommonDenomColorTests.h"
    5.10  
    5.11  using namespace std;
    5.12  
    5.13  LeastCommonDenomColorTests::LeastCommonDenomColorTests(string suitename, string test_home_dir) :
    5.14 -    EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
    5.15 +    EngineTestIndividualSuite::EngineTestIndividualSuite(suitename, test_home_dir) {
    5.16      add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("LeastCommonDenomColorTests::check_least_common_denom_color"),
    5.17                                                                        static_cast<Func>(&LeastCommonDenomColorTests::check_least_common_denom_color)));
    5.18  }
     6.1 --- a/test/src/pEpTestOutput.cc	Sat Dec 01 15:21:50 2018 +0100
     6.2 +++ b/test/src/pEpTestOutput.cc	Wed Dec 05 08:32:25 2018 +0100
     6.3 @@ -16,7 +16,7 @@
     6.4          cout << setw(width);
     6.5          if (num_tests) {
     6.6              double percentage = ((num_tests - failures) / (double)num_tests) * 100;
     6.7 -            cout << std::fixed << setprecision(1) << percentage << "\%"; 
     6.8 +            cout << std::fixed << setprecision(1) << percentage << "%"; 
     6.9          }
    6.10          else 
    6.11              cout << "N/A";
    6.12 @@ -112,4 +112,4 @@
    6.13  	void pEpTestOutput::assertment(const Source& s) {
    6.14  		_test_errors.push_back(s);
    6.15  	}
    6.16 -}
    6.17 \ No newline at end of file
    6.18 +}