Browse Source

ENGINE-495: Stopped key_mistrust (which had changed only in this branch) from trying to revoke non-own keys

generate_api
Krista Bennett 4 years ago
parent
commit
5098a33557
3 changed files with 16 additions and 6 deletions
  1. +12
    -2
      src/keymanagement.c
  2. +2
    -2
      test/include/LeastCommonDenomColorTests.h
  3. +2
    -2
      test/src/engine_tests/LeastCommonDenomColorTests.cc

+ 12
- 2
src/keymanagement.c View File

@ -1228,12 +1228,22 @@ DYNAMIC_API PEP_STATUS key_mistrusted(
if (!(session && ident && ident->fpr))
return PEP_ILLEGAL_VALUE;
// See if key is revoked already
bool has_private = false;
status = contains_priv_key(session, ident->fpr, &has_private);
if (status != PEP_STATUS_OK && status != PEP_KEY_NOT_FOUND)
return status;
// See if key is revoked already
if (has_private) {
bool revoked = false;
status = key_revoked(session, ident->fpr, &revoked);
if (!revoked)
revoke_key(session, ident->fpr, NULL);
}
// double-check to be sure key is even in the DB
if (ident->fpr)


+ 2
- 2
test/include/LeastCommonDenomColorTests.h View File

@ -5,11 +5,11 @@
#define LEAST_COMMON_DENOM_COLOR_H
#include <string>
#include "EngineTestSessionSuite.h"
#include "EngineTestIndividualSuite.h"
using namespace std;
class LeastCommonDenomColorTests : public EngineTestSessionSuite {
class LeastCommonDenomColorTests : public EngineTestIndividualSuite {
public:
LeastCommonDenomColorTests(string test_suite, string test_home_dir);
private:


+ 2
- 2
test/src/engine_tests/LeastCommonDenomColorTests.cc View File

@ -14,13 +14,13 @@
#include "test_util.h"
#include <cpptest.h>
#include "EngineTestSessionSuite.h"
#include "EngineTestIndividualSuite.h"
#include "LeastCommonDenomColorTests.h"
using namespace std;
LeastCommonDenomColorTests::LeastCommonDenomColorTests(string suitename, string test_home_dir) :
EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
EngineTestIndividualSuite::EngineTestIndividualSuite(suitename, test_home_dir) {
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("LeastCommonDenomColorTests::check_least_common_denom_color"),
static_cast<Func>(&LeastCommonDenomColorTests::check_least_common_denom_color)));
}


Loading…
Cancel
Save