Browse Source

Pseudo-grafted updated test code from ENGINE-434, since it seems it may be a while til those discussions take place.

doc_update_sequoia
Krista Bennett 4 years ago
parent
commit
93a9bf8934
50 changed files with 2508 additions and 101 deletions
  1. +4
    -0
      src/pEp_internal.h
  2. +10
    -3
      src/pgp_gpg.c
  3. +60
    -1
      src/platform_unix.c
  4. +8
    -1
      src/platform_unix.h
  5. +9
    -2
      test/Makefile
  6. +2
    -0
      test/convenience_scripts/README
  7. +2
    -2
      test/convenience_scripts/keygen_for_test.py
  8. +27
    -0
      test/genscripts.py
  9. +2
    -0
      test/include/EncryptMissingPrivateKeyTests.h
  10. +7
    -1
      test/include/EngineTestSuite.h
  11. +54
    -0
      test/include/IntegrityTests.h
  12. +2
    -0
      test/include/RevokeRegenAttachTests.h
  13. +11
    -0
      test/include/test_util.h
  14. +2
    -2
      test/src/EngineTestIndividualSuite.cc
  15. +1
    -0
      test/src/EngineTestSessionSuite.cc
  16. +100
    -25
      test/src/EngineTestSuite.cc
  17. +10
    -40
      test/src/TestDriver.cc
  18. +2
    -1
      test/src/engine_tests/AppleMailTests.cc
  19. +2
    -1
      test/src/engine_tests/CaseAndDotAddressTests.cc
  20. +2
    -1
      test/src/engine_tests/CrashdumpTests.cc
  21. +8
    -0
      test/src/engine_tests/EncryptMissingPrivateKeyTests.cc
  22. +279
    -0
      test/src/engine_tests/IntegrityTests.do.not.run.before.ENGINE-434
  23. +0
    -12
      test/src/engine_tests/MimeTests.cc
  24. +12
    -1
      test/src/engine_tests/PepSubjectReceivedTests.cc
  25. +12
    -1
      test/src/engine_tests/RevokeRegenAttachTests.cc
  26. +2
    -1
      test/src/engine_tests/SequenceTests.cc
  27. +2
    -1
      test/src/engine_tests/StringlistTests.cc
  28. +2
    -1
      test/src/engine_tests/StringpairListTests.cc
  29. +2
    -1
      test/src/engine_tests/TrustManipulationTests.cc
  30. +2
    -1
      test/src/engine_tests/TrustwordsTests.cc
  31. +2
    -1
      test/src/engine_tests/UserIDAliasTests.cc
  32. +47
    -1
      test/src/util/test_util.cc
  33. +64
    -0
      test/test_keys/priv/integrity_test_recip_0-0xF390A40D_priv.asc
  34. +64
    -0
      test/test_keys/priv/integrity_test_signer_0-0xFF26631A_priv.asc
  35. +64
    -0
      test/test_keys/priv/integrity_test_trash_signer_0-0x6A8F15E9_priv.asc
  36. +37
    -0
      test/test_keys/pub/integrity_test_recip_0-0xF390A40D_pub.asc
  37. +37
    -0
      test/test_keys/pub/integrity_test_signer_0-0xFF26631A_pub.asc
  38. +37
    -0
      test/test_keys/pub/integrity_test_trash_signer_0-0x6A8F15E9_pub.asc
  39. +159
    -0
      test/test_mails/Signed PGP_MIME by unknown signer attach.eml
  40. +119
    -0
      test/test_mails/Signed PGP_MIME by unknown signer no attach.eml
  41. +159
    -0
      test/test_mails/Signed attached key PGP_MIME.eml
  42. +159
    -0
      test/test_mails/Signed attached key PGP_MIME_corrupted.eml
  43. +118
    -0
      test/test_mails/Signed no attach PGP_MIME.eml
  44. +150
    -0
      test/test_mails/Unsigned from PGP_MIME_attach.eml
  45. +150
    -0
      test/test_mails/Unsigned from PGP_MIME_attach_corrupted.eml
  46. +111
    -0
      test/test_mails/Unsigned from PGP_MIME_noattach.eml
  47. +110
    -0
      test/test_mails/Unsigned from PGP_MIME_noattach_corrupted.eml
  48. +110
    -0
      test/test_mails/fake_2.0_good.eml
  49. +72
    -0
      test/test_mails/fake_2.0_signed_no_key_attached.eml
  50. +101
    -0
      test/test_mails/fake_2.0_unsigned.eml

+ 4
- 0
src/pEp_internal.h View File

@ -61,7 +61,11 @@
#else // UNIX
#define _POSIX_C_SOURCE 200809L
#include <dlfcn.h>
#ifdef NDEBUG
#define LOCAL_DB unix_local_db()
#else
#define LOCAL_DB unix_local_db(false)
#endif
#ifndef SYSTEM_DB
#define SYSTEM_DB "/usr/share/pEp/system.db"
#endif


+ 10
- 3
src/pgp_gpg.c View File

@ -262,8 +262,11 @@ PEP_STATUS pgp_init(PEP_SESSION session, bool in_first)
stringlist_add(conf_keys, "allow-freeform-uid");
stringlist_add(conf_values, "");
#if defined(WIN32) || defined(NDEBUG)
bResult = ensure_config_values(conf_keys, conf_values, gpg_conf());
#else
bResult = ensure_config_values(conf_keys, conf_values, gpg_conf(false));
#endif
free_stringlist(conf_keys);
free_stringlist(conf_values);
@ -279,8 +282,11 @@ PEP_STATUS pgp_init(PEP_SESSION session, bool in_first)
stringlist_add(conf_keys, "max-cache-ttl");
stringlist_add(conf_values, "1200");
#if defined(WIN32) || defined(NDEBUG)
bResult = ensure_config_values(conf_keys, conf_values, gpg_agent_conf());
#else
bResult = ensure_config_values(conf_keys, conf_values, gpg_agent_conf(false));
#endif
free_stringlist(conf_keys);
free_stringlist(conf_values);
@ -803,7 +809,8 @@ PEP_STATUS pgp_decrypt_and_verify(
}
case GPG_ERR_CERT_REVOKED:
case GPG_ERR_BAD_SIGNATURE:
result = PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH;
result = PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH;
//result = PEP_DECRYPT_BAD_SIGNATURE;
break;
case GPG_ERR_SIG_EXPIRED:
case GPG_ERR_KEY_EXPIRED:


+ 60
- 1
src/platform_unix.c View File

@ -208,12 +208,21 @@ int regnexec(const regex_t* preg, const char* string,
#endif
#ifdef NDEBUG
const char *unix_local_db(void)
#else
const char *unix_local_db(int reset)
#endif
{
static char buffer[MAX_PATH];
static bool done = false;
if (!done) {
#ifdef NDEBUG
if (!done)
#else
if ((!done) || reset)
#endif
{
char *home_env;
if((home_env = getenv("HOME"))){
char *p = stpncpy(buffer, home_env, MAX_PATH);
@ -240,12 +249,20 @@ static const char *gpg_conf_name = "gpg.conf";
static const char *gpg_agent_conf_name = "gpg-agent.conf";
static const char *gpg_conf_empty = "# Created by pEpEngine\n";
#ifdef NDEBUG
static bool ensure_gpg_home(const char **conf, const char **home){
#else
static bool ensure_gpg_home(const char **conf, const char **home, int reset){
#endif
static char path[MAX_PATH];
static char dirname[MAX_PATH];
static bool done = false;
#ifdef NDEBUG
if (!done) {
#else
if (reset || !done) {
#endif
char *p;
ssize_t len;
char *gpg_home_env = getenv("GNUPGHOME");
@ -317,15 +334,27 @@ static bool ensure_gpg_home(const char **conf, const char **home){
return true;
}
#ifdef NDEBUG
static bool ensure_gpg_agent_conf(const char **agent_conf){
#else
static bool ensure_gpg_agent_conf(const char **agent_conf, int reset){
#endif
static char agent_path[MAX_PATH];
static bool done = false;
#ifdef NDEBUG
if (!done) {
const char *dirname;
if (!ensure_gpg_home(NULL, &dirname)) /* Then dirname won't be set. */
return false;
#else
if (reset || !done) {
const char *dirname;
if (!ensure_gpg_home(NULL, &dirname, reset)) /* Then dirname won't be set. */
return false;
#endif
char *p = stpncpy(agent_path, dirname, MAX_PATH);
@ -367,6 +396,7 @@ static bool ensure_gpg_agent_conf(const char **agent_conf){
return true;
}
#ifdef NDEBUG
const char *gpg_conf(void)
{
const char *conf;
@ -374,7 +404,17 @@ const char *gpg_conf(void)
return conf;
return NULL;
}
#else
const char *gpg_conf(int reset)
{
const char *conf;
if(ensure_gpg_home(&conf, NULL, reset))
return conf;
return NULL;
}
#endif
#ifdef NDEBUG
const char *gpg_home(void)
{
const char *home;
@ -382,7 +422,17 @@ const char *gpg_home(void)
return home;
return NULL;
}
#else
const char *gpg_home(int reset)
{
const char *home;
if(ensure_gpg_home(NULL, &home, reset))
return home;
return NULL;
}
#endif
#ifdef NDEBUG
const char *gpg_agent_conf(void)
{
const char *agent_conf;
@ -390,3 +440,12 @@ const char *gpg_agent_conf(void)
return agent_conf;
return NULL;
}
#else
const char *gpg_agent_conf(int reset)
{
const char *agent_conf;
if(ensure_gpg_agent_conf(&agent_conf, reset))
return agent_conf;
return NULL;
}
#endif

+ 8
- 1
src/platform_unix.h View File

@ -20,11 +20,18 @@
extern "C" {
#endif
#ifdef NDEBUG
const char *unix_local_db(void);
const char *gpg_conf(void);
const char *gpg_agent_conf(void);
const char *gpg_home(void);
#else
const char *unix_local_db(int reset);
const char *gpg_conf(int reset);
const char *gpg_agent_conf(int reset);
const char *gpg_home(int reset);
#endif
#ifdef ANDROID


+ 9
- 2
test/Makefile View File

@ -83,7 +83,7 @@ endif
CPPFLAGS += $(INC_FLAGS) -MMD -MP
all: suitemaker $(TARGET) test_home_
all: suitemaker $(TARGET) test_home_ scripts
$(TARGET): $(OBJS)
$(CXX) $(CPPFLAGS) $(LDFLAGS) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $@
@ -98,7 +98,13 @@ endif
.PHONY: test_home_
test_home_:
mkdir -p $(TEST_HOME)
.PHONY: test_home_
scripts:
ifdef PY_ENV
$(PY_ENV) genscripts.py
endif
.PHONY: test
test: all
@ -107,6 +113,7 @@ test: all
.PHONY: clean
clean:
$(RM) $(TARGET) $(OBJS) $(DEPS)
$(RM) $(HERE)/*Tests


+ 2
- 0
test/convenience_scripts/README View File

@ -1 +1,3 @@
This is just a collection of scripts and source files I've used to convert things and make the test environment behave from time to time. USE AT YOUR OWN RISK.
Note that the keygen script isn't currently deleting keys properly. We probably just have to shell out and do it.

+ 2
- 2
test/convenience_scripts/keygen_for_test.py View File

@ -79,7 +79,7 @@ for i in range(num_keys):
pubkey = gpg.export_keys(fpr)
privkey = gpg.export_keys(fpr, True)
privkey = gpg.export_keys(fpr, True, passphrase="")
pubkey_filename = os.path.join(pub_path, key_filename_prefix + "pub.asc")
privkey_filename = os.path.join(priv_path, key_filename_prefix + "priv.asc")
@ -93,7 +93,7 @@ for i in range(num_keys):
privkey_file.close()
# Delete keys from keyring
gpg.delete_keys(fpr, True) # True => private keys
gpg.delete_keys(fpr, True, passphrase="") # True => private keys
gpg.delete_keys(fpr)
if (args.hgadd):


+ 27
- 0
test/genscripts.py View File

@ -0,0 +1,27 @@
# This file is under GNU General Public License 3.0
# see LICENSE.txt
from os import listdir, getcwd
from os.path import isfile, join
from re import sub
import os
import stat
import datetime
srcpath = join(getcwd(), "src/engine_tests")
ls = listdir(srcpath)
for f in ls:
if isfile(join(srcpath, f)):
if (f.endswith(".cc")):
suite = sub('\.cc$', '', f)
outfile = open(suite, 'w')
output = (
"#!/bin/bash\n"
"# This is a convenience script for launching individual tests and tab completion with TestDriver \n\n" +
"./TestDriver " + suite + "\n\n")
outfile.write(output)
os.chmod(suite,
(stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH | stat.S_IXGRP | stat.S_IXOTH))
outfile.close()

+ 2
- 0
test/include/EncryptMissingPrivateKeyTests.h View File

@ -12,6 +12,8 @@ using namespace std;
class EncryptMissingPrivateKeyTests : public EngineTestSessionSuite {
public:
EncryptMissingPrivateKeyTests(string test_suite, string test_home_dir);
protected:
void setup();
private:
void check_encrypt_missing_private_key();
};


+ 7
- 1
test/include/EngineTestSuite.h View File

@ -18,13 +18,19 @@ class EngineTestSuite : public Test::Suite {
protected:
PEP_SESSION session;
string test_home;
string real_home;
string prev_gpg_home;
string name;
string current_test_name;
#define TEST_FAILED_MESSAGE_BUFSIZE 1000
char failed_msg_buf[TEST_FAILED_MESSAGE_BUFSIZE];
std::map<std::string, void (Test::Suite::*)()> test_map;
string my_name;
unsigned int number_of_tests;
unsigned int on_test_number;
@ -34,6 +40,6 @@ class EngineTestSuite : public Test::Suite {
void set_full_env();
void restore_full_env();
void initialise_test_home();
void set_my_name();
};
#endif

+ 54
- 0
test/include/IntegrityTests.h View File

@ -0,0 +1,54 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#ifndef INTEGRITY_H
#define INTEGRITY_H
#include <string>
#include "pEpEngine.h"
#include "message_api.h"
#include "EngineTestIndividualSuite.h"
using namespace std;
class IntegrityTests : public EngineTestIndividualSuite {
public:
IntegrityTests(string test_suite, string test_home_dir);
protected:
void setup();
void tear_down();
private:
const char* recip_fpr;
// used by each test
string message;
char* decrypted_msg;
PEP_STATUS decrypt_status;
PEP_rating rating;
PEP_decrypt_flags_t flags;
stringlist_t* keylist;
char* dummy_ignore;
void check_unsigned_PGP_MIME();
void check_unsigned_PGP_MIME_attached_key();
void check_unsigned_PGP_MIME_w_render_flag();
void check_known_good_signed_PGP_MIME();
void check_known_good_signed_PGP_MIME_attached_key();
void check_unknown_signed_PGP_MIME_no_key();
void check_unknown_signed_PGP_MIME_attached_key();
void check_unsigned_PGP_MIME_corrupted();
void check_signed_PGP_MIME_corrupted();
void check_unsigned_2_0();
void check_unknown_signed_2_0_no_key();
void check_unknown_signed_2_0_no_key_known_signer();
void check_unknown_signed_2_0_key_attached();
void check_integrity();
};
#endif

+ 2
- 0
test/include/RevokeRegenAttachTests.h View File

@ -12,6 +12,8 @@ using namespace std;
class RevokeRegenAttachTests : public EngineTestSessionSuite {
public:
RevokeRegenAttachTests(string test_suite, string test_home_dir);
protected:
void setup();
private:
void check_revoke_regen_attach();
};


+ 11
- 0
test/include/test_util.h View File

@ -2,6 +2,10 @@
#define PEP_TEST_UTILS_H
#include <string>
#include <stdlib.h>
#include <sys/stat.h>
#include <ftw.h>
#include "pEpEngine.h"
#include "message_api.h"
@ -31,4 +35,11 @@ const char* tl_status_string(PEP_STATUS status);
// Grabs a new uuid for your randomish string needs.
char* get_new_uuid();
bool slurp_message_and_import_key(PEP_SESSION session, const char* message_fname, std::string& message, const char* key_filename);
int util_delete_filepath(const char *filepath,
const struct stat *file_stat,
int ftw_info,
struct FTW * ftw_struct);
#endif

+ 2
- 2
test/src/EngineTestIndividualSuite.cc View File

@ -20,11 +20,11 @@ EngineTestIndividualSuite::~EngineTestIndividualSuite() {
}
void EngineTestIndividualSuite::setup() {
EngineTestSuite::setup();
set_full_env(); // This will be called by default before every test
}
void EngineTestIndividualSuite::tear_down() {
cout << "calling release()\n";
release(session);
restore_full_env();
EngineTestSuite::tear_down();
}

+ 1
- 0
test/src/EngineTestSessionSuite.cc View File

@ -23,6 +23,7 @@ void EngineTestSessionSuite::setup() {
}
void EngineTestSessionSuite::tear_down() {
cout << "Session: tear_down - OTN: " << on_test_number << " NOT: " << number_of_tests << endl;
if (on_test_number == number_of_tests)
restore_full_env();


+ 100
- 25
test/src/EngineTestSuite.cc View File

@ -1,7 +1,14 @@
#include <stdlib.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <ftw.h>
#include <assert.h>
#include "platform_unix.h"
#include "test_util.h"
#include "EngineTestSuite.h"
using namespace std;
@ -9,15 +16,10 @@ using namespace std;
EngineTestSuite::EngineTestSuite(string suitename, string test_home_dir) {
// FIXME: deal with base
test_home = test_home_dir;
// TODO: This is *nix specific, which the current testing env is anyway,
// but it needn't remain so forever and always
char* tmp = getenv("GNUPGHOME");
if (tmp)
prev_gpg_home = getenv("GNUPGHOME");
number_of_tests = 0;
on_test_number = 0;
real_home = getenv("HOME");
}
EngineTestSuite::~EngineTestSuite() {}
@ -29,45 +31,102 @@ void EngineTestSuite::add_test_to_suite(std::pair<std::string, void (Test::Suite
}
void EngineTestSuite::set_full_env() {
if (test_home.empty())
throw std::runtime_error("SETUP: BAD INITIALISATION. No test home.");
int success = 0;
struct stat dirchk;
int success = system("gpgconf --kill all");
set_my_name();
success = system("gpgconf --kill all");
if (success != 0)
throw std::runtime_error("SETUP: Error when executing 'gpgconf --kill all'.");
sleep(1); // hopefully enough time for the system to recognise that it is dead. *sigh*
if (stat(test_home.c_str(), &dirchk) == 0) {
if (!S_ISDIR(dirchk.st_mode))
throw std::runtime_error(("The test directory, " + test_home + "exists, but is not a directory.").c_str());
struct stat buf;
if (stat(test_home.c_str(), &buf) == 0) {
cout << test_home << " exists. We'll recursively delete. We hope we're not horking your whole system..." << endl;
int success = nftw((test_home + "/.").c_str(), util_delete_filepath, 100, FTW_DEPTH);
}
}
else {
int errchk = mkdir(test_home.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
cout << errchk << endl;
if (errchk != 0)
throw std::runtime_error("Error creating a test directory.");
}
string temp_test_home = test_home + "/" + my_name;
int errchk = mkdir(temp_test_home.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
if (errchk != 0)
throw std::runtime_error("Error creating a test directory.");
temp_test_home += "/" + to_string(on_test_number);
errchk = mkdir(temp_test_home.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
if (errchk != 0)
throw std::runtime_error("Error creating a test directory.");
// TODO: This is *nix specific, which the current testing env is anyway,
// but it needn't remain so forever and always
char* tmp = getenv("GNUPGHOME");
if (tmp)
prev_gpg_home = tmp;
if (temp_test_home.empty())
throw std::runtime_error("SETUP: BAD INITIALISATION. No test home.");
string home = getenv("HOME");
if (test_home.compare(home) == 0 || test_home.compare(home + "/") == 0 ||
test_home.compare(home + "/.gnupg") == 0 || test_home.compare(home + ".gnupg") == 0 ||
test_home.compare(prev_gpg_home) == 0 || test_home.compare(prev_gpg_home + "/.gnupg") == 0 ||
test_home.compare(prev_gpg_home + ".gnupg") == 0)
cout << "home is " << home << endl;
assert(temp_test_home.compare(home) != 0);
assert(temp_test_home.compare(home + "/") != 0);
assert(temp_test_home.compare(home + "/.gnupg") != 0);
assert(temp_test_home.compare(home + ".gnupg") != 0);
assert(temp_test_home.compare(prev_gpg_home) != 0);
assert(temp_test_home.compare(prev_gpg_home + "/.gnupg") != 0);
assert(temp_test_home.compare(prev_gpg_home + ".gnupg") != 0);
if (temp_test_home.compare(home) == 0 || temp_test_home.compare(home + "/") == 0 ||
temp_test_home.compare(home + "/.gnupg") == 0 || temp_test_home.compare(home + ".gnupg") == 0 ||
temp_test_home.compare(prev_gpg_home) == 0 || temp_test_home.compare(prev_gpg_home + "/.gnupg") == 0 ||
temp_test_home.compare(prev_gpg_home + ".gnupg") == 0)
throw std::runtime_error("SETUP: new GNUPGHOME threatens to mess up user GNUPGHOME (and delete all their keys). NO DICE.");
cout << "Ok - checked if new test home will be safe. We'll try and make the directory, deleting it if it has already exists." << endl;
// cout << "Ok - checked if new test home will be safe. We'll try and make the directory, deleting it if it has already exists." << endl;
struct stat buf;
success = setenv("GNUPGHOME", (test_home + "/.gnupg").c_str(), 1);
success = setenv("GNUPGHOME", (temp_test_home + "/.gnupg").c_str(), 1);
if (success != 0)
throw std::runtime_error("SETUP: Error when setting GNUPGHOME.");
success = setenv("HOME", test_home.c_str(), 1);
cout << "New GNUPGHOME is " << getenv("GNUPGHOME") << endl;
success = setenv("HOME", temp_test_home.c_str(), 1);
if (success != 0)
throw std::runtime_error("SETUP: Cannot set test_home for init.");
cout << "calling init()\n";
unix_local_db(true);
gpg_conf(true);
gpg_agent_conf(true);
// cout << "calling init()\n";
PEP_STATUS status = init(&session);
// assert(status == PEP_STATUS_OK);
// assert(session);
cout << "init() completed.\n";
assert(status == PEP_STATUS_OK);
assert(session);
// cout << "init() completed.\n";
success = setenv("HOME", home.c_str(), 1);
if (success != 0)
throw std::runtime_error("SETUP: Cannot reset home directory! Either set environment variable manually back to your home, or quit this session!");
}
void EngineTestSuite::restore_full_env() {
release(session);
session = NULL;
int success = system("gpgconf --kill all");
if (success != 0)
throw std::runtime_error("RESTORE: Error when executing 'gpgconf --kill all'.");
@ -75,6 +134,18 @@ void EngineTestSuite::restore_full_env() {
success = setenv("GNUPGHOME", prev_gpg_home.c_str(), 1);
if (success != 0)
throw std::runtime_error("RESTORE: Warning - cannot restore GNUPGHOME. Either set environment variable manually back to your home, or quit this session!");
success = nftw((test_home + "/.").c_str(), util_delete_filepath, 100, FTW_DEPTH);
success = setenv("HOME", real_home.c_str(), 1);
if (success != 0)
throw std::runtime_error("RESTORE: Cannot reset home directory! Either set environment variable manually back to your home, or quit this session!");
else
cout << "RESTORE: HOME is now " << getenv("HOME") << endl;
unix_local_db(true);
gpg_conf(true);
gpg_agent_conf(true);
}
void EngineTestSuite::setup() {
@ -82,3 +153,7 @@ void EngineTestSuite::setup() {
}
void EngineTestSuite::tear_down() {}
void EngineTestSuite::set_my_name() {
my_name = typeid(*this).name();
}

+ 10
- 40
test/src/TestDriver.cc View File

@ -16,57 +16,27 @@
using namespace std;
string common_test_home = "./pEp_test_home";
string common_test_home;
void usage() {
throw std::runtime_error("Bad usage. Fix me, you loser developer.");
}
int util_delete_filepath(const char *filepath,
const struct stat *file_stat,
int ftw_info,
struct FTW * ftw_struct) {
int retval = 0;
switch (ftw_info) {
case FTW_DP:
retval = rmdir(filepath);
break;
case FTW_F:
case FTW_SLN:
retval = unlink(filepath);
break;
default:
retval = -1;
}
return retval;
}
int main(int argc, const char** argv) {
const int MIN_ARGC = 1;
if (argc < MIN_ARGC)
usage();
struct stat dirchk;
if (stat(common_test_home.c_str(), &dirchk) == 0) {
if (!S_ISDIR(dirchk.st_mode))
throw std::runtime_error(("The test directory, " + common_test_home + "exists, but is not a directory.").c_str());
struct stat buf;
size_t BUF_MAX_PATHLEN = 4097;
char buf[BUF_MAX_PATHLEN];// Linux max path size...
string curr_wd = getcwd(buf, BUF_MAX_PATHLEN);
if (curr_wd.empty())
throw std::runtime_error("Error grabbing current working directory");
if (stat(common_test_home.c_str(), &buf) == 0) {
cout << common_test_home << " exists. We'll recursively delete. We hope we're not horking your whole system..." << endl;
int success = nftw((common_test_home + "/.").c_str(), util_delete_filepath, 100, FTW_DEPTH);
}
}
else {
int errchk = mkdir(common_test_home.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
cout << errchk << endl;
if (errchk != 0)
throw std::runtime_error("Error creating a test directory.");
}
common_test_home = curr_wd + "/pEp_test_home";
EngineTestSuite* test_runner = new EngineTestSuite("MainTestDriver", common_test_home);
std::vector<Test::Suite*> suites_to_run;


+ 2
- 1
test/src/engine_tests/AppleMailTests.cc View File

@ -27,7 +27,8 @@ using namespace std;
AppleMailTests::AppleMailTests(string suitename, string test_home_dir) :
EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
TEST_ADD(AppleMailTests::check_apple_mail);
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("AppleMailTests::check_apple_mail"),
static_cast<Func>(&AppleMailTests::check_apple_mail)));
}
void AppleMailTests::check_apple_mail() {


+ 2
- 1
test/src/engine_tests/CaseAndDotAddressTests.cc View File

@ -19,7 +19,8 @@ using namespace std;
CaseAndDotAddressTests::CaseAndDotAddressTests(string suitename, string test_home_dir) :
EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
TEST_ADD(CaseAndDotAddressTests::check_case_and_dot_address);
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("CaseAndDotAddressTests::check_case_and_dot_address"),
static_cast<Func>(&CaseAndDotAddressTests::check_case_and_dot_address)));
}
void CaseAndDotAddressTests::check_case_and_dot_address() {


+ 2
- 1
test/src/engine_tests/CrashdumpTests.cc View File

@ -13,7 +13,8 @@ using namespace std;
CrashdumpTests::CrashdumpTests(string suitename, string test_home_dir) :
EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
TEST_ADD(CrashdumpTests::check_crashdump);
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("CrashdumpTests::check_crashdump"),
static_cast<Func>(&CrashdumpTests::check_crashdump)));
}
void CrashdumpTests::check_crashdump() {


+ 8
- 0
test/src/engine_tests/EncryptMissingPrivateKeyTests.cc View File

@ -6,6 +6,7 @@
#include <fstream>
#include <string>
#include <cstring> // for strcmp()
#include <assert.h>
#include <cpptest.h>
#include "blacklist.h"
@ -29,6 +30,13 @@ EncryptMissingPrivateKeyTests::EncryptMissingPrivateKeyTests(string suitename, s
static_cast<Func>(&EncryptMissingPrivateKeyTests::check_encrypt_missing_private_key)));
}
void EncryptMissingPrivateKeyTests::setup() {
EngineTestSessionSuite::setup();
string recip_key = slurp("test_keys/pub/pep-test-bob-0xC9C2EE39_pub.asc");
PEP_STATUS status = import_key(session, recip_key.c_str(), recip_key.size(), NULL);
assert(status == PEP_STATUS_OK);
}
void EncryptMissingPrivateKeyTests::check_encrypt_missing_private_key() {
pEp_identity* no_key_identity = new_identity("blacklistself@kgrothoff.org",


+ 279
- 0
test/src/engine_tests/IntegrityTests.do.not.run.before.ENGINE-434 View File

@ -0,0 +1,279 @@
// This file is under GNU General Public License 3.0
// see LICENSE.txt
#include <stdlib.h>
#include <string>
#include <assert.h>
#include <unistd.h>
#include "pEpEngine.h"
#include "message_api.h"
#include "test_util.h"
#include "EngineTestIndividualSuite.h"
#include "IntegrityTests.h"
using namespace std;
IntegrityTests::IntegrityTests(string suitename, string test_home_dir) :
EngineTestIndividualSuite::EngineTestIndividualSuite(suitename, test_home_dir) {
recip_fpr = "9D8047989841CF4207EA152A4ACAF735F390A40D";
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_PGP_MIME"),
static_cast<Func>(&IntegrityTests::check_unsigned_PGP_MIME)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_PGP_MIME_attached_key"),
static_cast<Func>(&IntegrityTests::check_unsigned_PGP_MIME_attached_key)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_PGP_MIME_w_render_flag"),
static_cast<Func>(&IntegrityTests::check_unsigned_PGP_MIME_w_render_flag)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_known_good_signed_PGP_MIME"),
static_cast<Func>(&IntegrityTests::check_known_good_signed_PGP_MIME)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_known_good_signed_PGP_MIME_attached_key"),
static_cast<Func>(&IntegrityTests::check_known_good_signed_PGP_MIME_attached_key)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_PGP_MIME_no_key"),
static_cast<Func>(&IntegrityTests::check_unknown_signed_PGP_MIME_no_key)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_PGP_MIME_attached_key"),
static_cast<Func>(&IntegrityTests::check_unknown_signed_PGP_MIME_attached_key)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_PGP_MIME_corrupted"),
static_cast<Func>(&IntegrityTests::check_unsigned_PGP_MIME_corrupted)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_signed_PGP_MIME_corrupted"),
static_cast<Func>(&IntegrityTests::check_signed_PGP_MIME_corrupted)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_2_0"),
static_cast<Func>(&IntegrityTests::check_unsigned_2_0)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_2_0_no_key"),
static_cast<Func>(&IntegrityTests::check_unknown_signed_2_0_no_key)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_2_0_no_key_known_signer"),
static_cast<Func>(&IntegrityTests::check_unknown_signed_2_0_no_key_known_signer)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_2_0_key_attached"),
static_cast<Func>(&IntegrityTests::check_unknown_signed_2_0_key_attached)));
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_integrity"),
static_cast<Func>(&IntegrityTests::check_integrity)));
}
void IntegrityTests::setup() {
EngineTestIndividualSuite::setup();
string recip_key = slurp("test_keys/pub/integrity_test_recip_0-0xF390A40D_pub.asc");
PEP_STATUS status = import_key(session, recip_key.c_str(), recip_key.size(), NULL);
assert(status == PEP_STATUS_OK);
recip_key = "";
string priv_key = slurp("test_keys/priv/integrity_test_recip_0-0xF390A40D_priv.asc");
// cout << priv_key << endl;
// cout << "GNUPGHOME is " << getenv("GNUPGHOME") << endl;
status = import_key(session, priv_key.c_str(), priv_key.size(), NULL);
assert(status == PEP_STATUS_OK);
// stringlist_t* debug_keylist = NULL;
// status = find_private_keys(session, recip_fpr, &debug_keylist);
// assert(debug_keylist);
pEp_identity* me = new_identity("integrity_test_recip@darthmama.org", recip_fpr, PEP_OWN_USERID, "Integrity Test Recipient");
assert(me != NULL);
status = set_own_key(session, me, recip_fpr);
assert(status == PEP_STATUS_OK);
message = "";
decrypted_msg = NULL;
decrypt_status = PEP_STATUS_OK;
rating = PEP_rating_undefined;
flags = 0;
keylist = NULL;
dummy_ignore = NULL;
}
void IntegrityTests::tear_down() {
free_stringlist(keylist);
free(decrypted_msg);
EngineTestIndividualSuite::tear_down();
}
/*
Type Error State Render Status Code
---------------------------------------------------------------------------------------------------------------
inline ALL Yes, if present Whatever GPG gives us
PGP/MIME Unsigned No DECRYPTED_BUT_UNSIGNED (grey)
Signed, no key Yes NO_KEY_FOR_SIGNER
Bad sig No SIGNATURE_DOES_NOT_MATCH
Message 1.0 Unsigned No MODIFICATION_DETECTED
Signed, no key No MODIFICATION_DETECTED
Bad sig No SIGNATURE_DOES_NOT_MATCH
Message 2.0 Unsigned No MODIFICATION_DETECTED (red)
Signed, no key No MODIFICATION_DETECTED (red)
Bad sig No SIGNATURE_DOES_NOT_MATCH
*/
void IntegrityTests::check_known_good_signed_PGP_MIME() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed no attach PGP_MIME.eml", message,
"test_keys/pub/integrity_test_signer_0-0xFF26631A_pub.asc"));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
TEST_ASSERT(decrypted_msg != NULL);
TEST_ASSERT(rating == PEP_rating_reliable);
}
void IntegrityTests::check_known_good_signed_PGP_MIME_attached_key() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed attached key PGP_MIME.eml", message,
NULL));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
TEST_ASSERT(decrypted_msg != NULL);
TEST_ASSERT(rating == PEP_rating_reliable);
}
void IntegrityTests::check_unsigned_PGP_MIME() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Unsigned from PGP_MIME_noattach.eml", message,
"test_keys/pub/integrity_test_signer_0-0xFF26631A_pub.asc"));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPTED_BUT_UNSIGNED", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPTED_BUT_UNSIGNED, failed_msg_buf);
TEST_ASSERT(decrypted_msg == NULL);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Rating == %s, should be PEP_rating_unreliable", tl_rating_string(rating));
TEST_ASSERT_MSG(rating == PEP_rating_unreliable, failed_msg_buf);
}
void IntegrityTests::check_unsigned_PGP_MIME_attached_key() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Unsigned from PGP_MIME_attach.eml", message,
NULL));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPTED_BUT_UNSIGNED", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPTED_BUT_UNSIGNED, failed_msg_buf);
TEST_ASSERT(decrypted_msg == NULL);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Rating == %s, should be PEP_rating_unreliable", tl_rating_string(rating));
TEST_ASSERT_MSG(rating == PEP_rating_unreliable, failed_msg_buf);
}
void IntegrityTests::check_unsigned_PGP_MIME_w_render_flag() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Unsigned from PGP_MIME_noattach.eml", message,
"test_keys/pub/integrity_test_signer_0-0xFF26631A_pub.asc"));
flags |= PEP_decrypt_deliver_pgpmime_badsigned;
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPTED_BUT_UNSIGNED", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPTED_BUT_UNSIGNED, failed_msg_buf);
TEST_ASSERT(decrypted_msg != NULL);
TEST_ASSERT(rating == PEP_rating_unreliable);
}
void IntegrityTests::check_unknown_signed_PGP_MIME_no_key() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed PGP_MIME by unknown signer no attach.eml", message,
NULL));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPT_NO_KEY_FOR_SIGNER", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPT_NO_KEY_FOR_SIGNER, failed_msg_buf);
TEST_ASSERT(decrypted_msg != NULL);
TEST_ASSERT(rating == PEP_rating_unreliable);
}
void IntegrityTests::check_unknown_signed_PGP_MIME_attached_key() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed PGP_MIME by unknown signer attach.eml", message,
NULL));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
TEST_ASSERT(decrypted_msg != NULL);
TEST_ASSERT(rating == PEP_rating_reliable);
}
// FIXME: we need cleverer attacked mails
void IntegrityTests::check_unsigned_PGP_MIME_corrupted() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Unsigned from PGP_MIME_attach_corrupted.eml", message,
NULL));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
// snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
// TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
TEST_ASSERT(decrypt_status != PEP_STATUS_OK && decrypt_status != PEP_DECRYPTED);
TEST_ASSERT(decrypted_msg == NULL);
}
void IntegrityTests::check_signed_PGP_MIME_corrupted() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed attached key PGP_MIME_corrupted.eml", message,
NULL));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
// snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
// TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
TEST_ASSERT(decrypt_status != PEP_STATUS_OK && decrypt_status != PEP_DECRYPTED);
TEST_ASSERT(decrypted_msg == NULL);
}
void IntegrityTests::check_unsigned_2_0() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/fake_2.0_unsigned.eml", message,
NULL));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPT_MODIFICATION_DETECTED", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPT_MODIFICATION_DETECTED, failed_msg_buf);
TEST_ASSERT(decrypted_msg == NULL);
TEST_ASSERT(rating == PEP_rating_under_attack);
}
void IntegrityTests::check_unknown_signed_2_0_no_key() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/fake_2.0_signed_no_key_attached.eml", message,
NULL));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPT_MODIFICATION_DETECTED", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPT_MODIFICATION_DETECTED, failed_msg_buf);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypted msg should have been NULL, but starts with %s", decrypted_msg);
TEST_ASSERT_MSG(decrypted_msg == NULL, failed_msg_buf);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Rating == %s, should be PEP_rating_under_attack", tl_rating_string(rating));
TEST_ASSERT_MSG(rating == PEP_rating_under_attack, failed_msg_buf);
}
void IntegrityTests::check_unknown_signed_2_0_no_key_known_signer() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/fake_2.0_signed_no_key_attached.eml", message,
"test_keys/pub/integrity_test_signer_0-0xFF26631A_pub.asc"));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPT_MODIFICATION_DETECTED", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPT_MODIFICATION_DETECTED, failed_msg_buf);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypted msg should have been NULL, but starts with %s", decrypted_msg);
TEST_ASSERT_MSG(decrypted_msg == NULL, failed_msg_buf);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Rating == %s, should be PEP_rating_under_attack", tl_rating_string(rating));
TEST_ASSERT_MSG(rating == PEP_rating_under_attack, failed_msg_buf);
}
void IntegrityTests::check_unknown_signed_2_0_key_attached() {
TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/fake_2.0_good.eml", message,
NULL));
decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
&rating, &flags, &dummy_ignore);
snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
TEST_ASSERT(decrypted_msg != NULL);
TEST_ASSERT(rating == PEP_rating_reliable);
}
void IntegrityTests::check_integrity() {
TEST_ASSERT(true);
}

+ 0
- 12
test/src/engine_tests/MimeTests.cc View File

@ -69,18 +69,6 @@ static void test_mime_decoding(string filename) {
void MimeTests::check_mime() {
cout << "\n*** mime_test ***\n\n";
PEP_SESSION session;
cout << "calling init()\n";
PEP_STATUS status1 = init(&session);
TEST_ASSERT_MSG((status1 == PEP_STATUS_OK), "status1 == PEP_STATUS_OK");
TEST_ASSERT_MSG((session), "session");
cout << "init() completed.\n";
// mime test code
// testing multipart/alternative
message *msg2 = new_message(PEP_dir_incoming);


+ 12
- 1
test/src/engine_tests/PepSubjectReceivedTests.cc View File

@ -64,6 +64,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -97,6 +98,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -197,6 +199,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -230,6 +233,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -238,7 +242,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
cout << "longmsg: " << final_ptr->longmsg << endl << endl;
cout << "longmsg_formatted: " << (final_ptr->longmsg_formatted ? final_ptr->longmsg_formatted : "(empty)") << endl << endl;
TEST_ASSERT_MSG((strcmp("pp", final_ptr->shortmsg) == 0), "strcmp(\"pp\", final_ptr->shortmsg) == 0");
TEST_ASSERT_MSG((strcmp("pEp", final_ptr->shortmsg) == 0), "strcmp(\"pEp\", final_ptr->shortmsg) == 0");
cout << "Test 3: Subject remains intact as desired." << endl << endl;
@ -264,6 +268,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -297,6 +302,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -330,6 +336,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -363,6 +370,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -397,6 +405,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -431,6 +440,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
@ -464,6 +474,7 @@ void PepSubjectReceivedTests::check_pep_subject_received() {
TEST_ASSERT_MSG((status == PEP_STATUS_OK), "status == PEP_STATUS_OK");
TEST_ASSERT_MSG((msg_ptr), "msg_ptr");
final_ptr = msg_ptr;
//flags = PEP_decrypt_deliver_pgpmime_badsigned; // We created this test before deciding not to display unsigned messages
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;


+ 12
- 1
test/src/engine_tests/RevokeRegenAttachTests.cc View File

@ -7,13 +7,16 @@
#include <time.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#include "pEpEngine.h"
#include "platform.h"
#include "mime.h"
#include "message_api.h"
#include "cpptest.h"
#include "test_util.h"
#include <cpptest.h>
#include "EngineTestSessionSuite.h"
#include "RevokeRegenAttachTests.h"
@ -25,6 +28,14 @@ RevokeRegenAttachTests::RevokeRegenAttachTests(string suitename, string test_hom
static_cast<Func>(&RevokeRegenAttachTests::check_revoke_regen_attach)));
}
void RevokeRegenAttachTests::setup() {
EngineTestSessionSuite::setup();
string recip_key = slurp("test_keys/pub/pep-test-alice-0x6FF00E97_pub.asc");
PEP_STATUS status = import_key(session, recip_key.c_str(), recip_key.size(), NULL);
assert(status == PEP_STATUS_OK);
}
void RevokeRegenAttachTests::check_revoke_regen_attach() {
PEP_STATUS status = PEP_STATUS_OK;


+ 2
- 1
test/src/engine_tests/SequenceTests.cc View File

@ -15,7 +15,8 @@ using namespace std;
SequenceTests::SequenceTests(string suitename, string test_home_dir) :
EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
TEST_ADD(SequenceTests::check_sequences);
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("SequenceTests::check_sequences"),
static_cast<Func>(&SequenceTests::check_sequences)));
}
void SequenceTests::check_sequences() {


+ 2
- 1
test/src/engine_tests/StringlistTests.cc View File

@ -16,7 +16,8 @@ using namespace std;
StringlistTests::StringlistTests(string suitename, string test_home_dir) :
EngineTestSuite::EngineTestSuite(suitename, test_home_dir) {
TEST_ADD(StringlistTests::check_stringlists);
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("StringlistTests::check_stringlists"),
static_cast<Func>(&StringlistTests::check_stringlists)));
}
void StringlistTests::check_stringlists() {


+ 2
- 1
test/src/engine_tests/StringpairListTests.cc View File

@ -17,7 +17,8 @@ using namespace std;
StringpairListTests::StringpairListTests(string suitename, string test_home_dir) :
EngineTestSuite::EngineTestSuite(suitename, test_home_dir) {
TEST_ADD(StringpairListTests::check_stringpair_lists);
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("StringpairListTests::check_stringpair_lists"),
static_cast<Func>(&StringpairListTests::check_stringpair_lists)));
}
bool StringpairListTests::test_stringpair_equals(stringpair_t* val1, stringpair_t* val2) {


+ 2
- 1
test/src/engine_tests/TrustManipulationTests.cc View File

@ -19,7 +19,8 @@ using namespace std;
TrustManipulationTests::TrustManipulationTests(string suitename, string test_home_dir) :
EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
TEST_ADD(TrustManipulationTests::check_trust_manipulation);
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("TrustManipulationTests::check_trust_manipulation"),
static_cast<Func>(&TrustManipulationTests::check_trust_manipulation)));
}
void TrustManipulationTests::check_trust_manipulation() {


+ 2
- 1
test/src/engine_tests/TrustwordsTests.cc View File

@ -14,7 +14,8 @@ using namespace std;
TrustwordsTests::TrustwordsTests(string suitename, string test_home_dir) :
EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
TEST_ADD(TrustwordsTests::check_trustwords);
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("TrustwordsTests::check_trustwords"),
static_cast<Func>(&TrustwordsTests::check_trustwords)));
}
void TrustwordsTests::check_trustwords() {


+ 2
- 1
test/src/engine_tests/UserIDAliasTests.cc View File

@ -19,7 +19,8 @@ using namespace std;
UserIDAliasTests::UserIDAliasTests(string suitename, string test_home_dir) :
EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
TEST_ADD(UserIDAliasTests::check_userid_aliases);
add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("UserIDAliasTests::check_userid_aliases"),
static_cast<Func>(&UserIDAliasTests::check_userid_aliases)));
}
void UserIDAliasTests::check_userid_aliases() {


+ 47
- 1
test/src/util/test_util.cc View File

@ -2,9 +2,16 @@
#include "pEpEngine.h"
#include "pEp_internal.h"
#include "message_api.h"
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <stdlib.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <ftw.h>
char* str_to_lower(const char* str) {
if (!str)
@ -137,6 +144,12 @@ const char* tl_status_string(PEP_STATUS status) {
return "PEP_DECRYPT_NO_KEY";
case PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH:
return "PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH";
// case PEP_DECRYPTED_BUT_UNSIGNED:
// return "PEP_DECRYPTED_BUT_UNSIGNED";
// case PEP_DECRYPT_MODIFICATION_DETECTED:
// return "PEP_DECRYPT_MODIFICATION_DETECTED";
// case PEP_DECRYPT_NO_KEY_FOR_SIGNER:
// return "PEP_DECRYPT_NO_KEY_FOR_SIGNER";
case PEP_VERIFY_NO_KEY:
return "PEP_VERIFY_NO_KEY";
case PEP_VERIFIED_AND_TRUSTED:
@ -204,7 +217,7 @@ const char* tl_status_string(PEP_STATUS status) {
case PEP_OUT_OF_MEMORY:
return "PEP_OUT_OF_MEMORY";
case PEP_UNKNOWN_ERROR:
return "PEP_UNKNOWN_ERROR";
return "PEP_UNKNOWN_ERROR";
default:
return "PEP_STATUS_OMGWTFBBQ - This means you're using a status the test lib doesn't know about!";
@ -317,3 +330,36 @@ const char* tl_ct_string(PEP_comm_type ct) {
return "PEP_ct_OMGWTFBBQ\n\nIn other words, comm type is invalid. Either something's corrupt or a new ct value has been added to the enum but not to the test function.";
}
}
bool slurp_message_and_import_key(PEP_SESSION session, const char* message_fname, std::string& message, const char* key_filename) {
message = slurp(message_fname);
if (key_filename) {
std::string keyfile = slurp(key_filename);
if (import_key(session, keyfile.c_str(), keyfile.size(), NULL) != PEP_STATUS_OK)
return false;
}
return true;
}
int util_delete_filepath(const char *filepath,
const struct stat *file_stat,
int ftw_info,
struct FTW * ftw_struct) {
int retval = 0;
switch (ftw_info) {
case FTW_DP:
retval = rmdir(filepath);
break;
case FTW_F:
case FTW_SLN:
retval = unlink(filepath);
break;
default:
retval = -1;
}
return retval;
}

+ 64
- 0
test/test_keys/priv/integrity_test_recip_0-0xF390A40D_priv.asc View File

@ -0,0 +1,64 @@
-----BEGIN PGP PRIVATE KEY BLOCK-----
lQOYBFr73usBCADhtXwG4vKooTHixzhS3EEMCdqX7DS16yF/cpZJkHfHjahe+JbC
hOUFWMLQI99/ZXecsKNq+Vx7g8/krIyL2qvfwGY4b9RIS84CzxPyDlJ1hgoRLkLf
7qekLL0y25BvP7ZmqpFbtm44MP5jlK5a3GEGlz5Hj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C/BwoCuA8Tf2DYsUwygjOY0G/ESTRx4RrpD9ubMzT1K0OUZ+4V
M1D8As/uIcNxa4bzKiYyJGuiReeCqhXRrmQ8cXXGgXE2ik5kKITMtemmRft2ry48
U+t7Rwvy7PF9WHXrod5wB/9+2ccNnHTHHDJX+TgRHExrh16/2dDtjbZgUj3LTKoP
NelvNA+fzHKpxcA4Ggx9GaUbzpoo/ZKMko5doWFsTU0H2vbYg2V2YWjwEEYE7lzQ
jebWBqz0etkxgyQnXkB+phZeaBOcW/rzEwXHdQUF+z51QtB6Emals/ISLWxc5Mbz
216ym7LANJ1p658s8+ktj92j3mY4W9ERu5LoG4j+sRLtUvjZJ2+R9qrJkLtcjYF3
FNoqB8np+dgGaWEmvkaJw9lMj/vV2LD+tHc/pzYdwOb/cPyG7+311N5uWy9BlRxM
wd64q8+gdnIBAcqZ8Irt5dWCGkBlh1uIyyV1MI5EHu8L
=8JHC
-----END PGP PRIVATE KEY BLOCK-----

+ 64
- 0
test/test_keys/priv/integrity_test_signer_0-0xFF26631A_priv.asc View File

@ -0,0 +1,64 @@
-----BEGIN PGP PRIVATE KEY BLOCK-----
lQOYBFr74WABCADbzBMLyrH+kyBoQshc7aK0vOvxHvwURVNtuxBUPeqzIZ4bCvLB
Dqo2ti7bQ1uRsupCbwX/zx36LrCIUZ/U5huxmnfsGuFosnNVbXNNTc8IlnlR/1bq
ESe2xDn9iqUgzBC8Md4nSk8O6xyqpZYqN5PiL7Q80OdKak/ITd15YxwKbkHxaK8S
eEV3UrL51V3qzWGAQ42jujKVfG6HGGp5rJM/syW98w0FIOHavNQE0fR7utZoX30L
5N14soNSQ7Mg45o4sRs+3l7MNIkPGxiWbfVp/flK7XvrLd8WprvY2swTaHJ8xyQj
9jcvXE/tCgk3/z80g5NjwmRNjMSWfoBh8nm3ABEBAAEAB/4+UzpNXC8nwGFunw1A
qJO8C1weFcqmFthm46XoNVxxagVypqKaUsW6WOOlgg6bnG+n4eKCHKFj+UxOg1K+
pHdS37nEp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