test/src/engine_tests/IntegrityTests.cc
author Krista Bennett <krista@pep-project.org>
Tue, 22 May 2018 12:56:27 +0200
branchENGINE-434
changeset 2684 a5175dd76542
parent 2679 567462e5b11a
permissions -rw-r--r--
ENGINE-434 - Tests work now individually (yay!) and down to the expected bug, I think. Added a debug option to some internal functions with static variables inside of them so we can test. This only applies to unix and when NDEBUG is not defined.
krista@2678
     1
// This file is under GNU General Public License 3.0
krista@2678
     2
// see LICENSE.txt
krista@2678
     3
krista@2678
     4
#include <stdlib.h>
krista@2678
     5
#include <string>
krista@2678
     6
#include <assert.h>
krista@2679
     7
#include <unistd.h>
krista@2678
     8
krista@2678
     9
#include "pEpEngine.h"
krista@2678
    10
#include "message_api.h"
krista@2678
    11
krista@2678
    12
#include "test_util.h"
krista@2678
    13
krista@2678
    14
#include "EngineTestIndividualSuite.h"
krista@2678
    15
#include "IntegrityTests.h"
krista@2678
    16
krista@2678
    17
using namespace std;
krista@2678
    18
krista@2678
    19
IntegrityTests::IntegrityTests(string suitename, string test_home_dir) :
krista@2678
    20
    EngineTestIndividualSuite::EngineTestIndividualSuite(suitename, test_home_dir) {
krista@2678
    21
    recip_fpr = "9D8047989841CF4207EA152A4ACAF735F390A40D";
krista@2678
    22
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_PGP_MIME"),
krista@2678
    23
                                                                      static_cast<Func>(&IntegrityTests::check_unsigned_PGP_MIME)));
krista@2678
    24
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_PGP_MIME_attached_key"),
krista@2678
    25
                                                                      static_cast<Func>(&IntegrityTests::check_unsigned_PGP_MIME_attached_key)));
krista@2678
    26
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_PGP_MIME_w_render_flag"),
krista@2678
    27
                                                                      static_cast<Func>(&IntegrityTests::check_unsigned_PGP_MIME_w_render_flag)));
krista@2678
    28
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_known_good_signed_PGP_MIME"),
krista@2678
    29
                                                                      static_cast<Func>(&IntegrityTests::check_known_good_signed_PGP_MIME)));
krista@2678
    30
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_known_good_signed_PGP_MIME_attached_key"),
krista@2678
    31
                                                                      static_cast<Func>(&IntegrityTests::check_known_good_signed_PGP_MIME_attached_key)));
krista@2678
    32
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_PGP_MIME_no_key"),
krista@2678
    33
                                                                      static_cast<Func>(&IntegrityTests::check_unknown_signed_PGP_MIME_no_key)));
krista@2678
    34
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_PGP_MIME_attached_key"),
krista@2678
    35
                                                                      static_cast<Func>(&IntegrityTests::check_unknown_signed_PGP_MIME_attached_key)));
krista@2678
    36
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_PGP_MIME_corrupted"),
krista@2678
    37
                                                                      static_cast<Func>(&IntegrityTests::check_unsigned_PGP_MIME_corrupted)));
krista@2678
    38
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_signed_PGP_MIME_corrupted"),
krista@2678
    39
                                                                      static_cast<Func>(&IntegrityTests::check_signed_PGP_MIME_corrupted)));
krista@2679
    40
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unsigned_2_0"),
krista@2679
    41
                                                                      static_cast<Func>(&IntegrityTests::check_unsigned_2_0)));
krista@2679
    42
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_2_0_no_key"),
krista@2679
    43
                                                                      static_cast<Func>(&IntegrityTests::check_unknown_signed_2_0_no_key)));
krista@2679
    44
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_2_0_no_key_known_signer"),
krista@2679
    45
                                                                      static_cast<Func>(&IntegrityTests::check_unknown_signed_2_0_no_key_known_signer)));                                                                                                                                        
krista@2679
    46
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_unknown_signed_2_0_key_attached"),
krista@2679
    47
                                                                      static_cast<Func>(&IntegrityTests::check_unknown_signed_2_0_key_attached)));  
krista@2678
    48
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("IntegrityTests::check_integrity"),
krista@2678
    49
                                                                      static_cast<Func>(&IntegrityTests::check_integrity)));
krista@2678
    50
}
krista@2678
    51
krista@2678
    52
void IntegrityTests::setup() {
krista@2678
    53
    EngineTestIndividualSuite::setup();
krista@2678
    54
    string recip_key = slurp("test_keys/pub/integrity_test_recip_0-0xF390A40D_pub.asc");
krista@2678
    55
    PEP_STATUS status = import_key(session, recip_key.c_str(), recip_key.size(), NULL);
krista@2678
    56
    assert(status == PEP_STATUS_OK);
krista@2679
    57
    recip_key = "";
krista@2679
    58
    string priv_key = slurp("test_keys/priv/integrity_test_recip_0-0xF390A40D_priv.asc");
krista@2684
    59
    // cout << priv_key << endl;
krista@2684
    60
    // cout << "GNUPGHOME is " << getenv("GNUPGHOME") << endl;
krista@2679
    61
    status = import_key(session, priv_key.c_str(), priv_key.size(), NULL);
krista@2678
    62
    assert(status == PEP_STATUS_OK);
krista@2684
    63
    // stringlist_t* debug_keylist = NULL;
krista@2684
    64
    // status = find_private_keys(session, recip_fpr, &debug_keylist);
krista@2684
    65
    // assert(debug_keylist);
krista@2679
    66
    
krista@2678
    67
    pEp_identity* me = new_identity("integrity_test_recip@darthmama.org", recip_fpr, PEP_OWN_USERID, "Integrity Test Recipient");
krista@2678
    68
    assert(me != NULL);
krista@2678
    69
    status = set_own_key(session, me, recip_fpr);
krista@2678
    70
    assert(status == PEP_STATUS_OK);
krista@2678
    71
krista@2678
    72
    message = "";
krista@2678
    73
    decrypted_msg = NULL;
krista@2678
    74
    decrypt_status = PEP_STATUS_OK;
krista@2678
    75
    rating = PEP_rating_undefined;
krista@2678
    76
    flags = 0;
krista@2678
    77
    keylist = NULL;
krista@2678
    78
    dummy_ignore = NULL;
krista@2678
    79
}
krista@2678
    80
krista@2678
    81
void IntegrityTests::tear_down() {
krista@2678
    82
    free_stringlist(keylist);
krista@2678
    83
    free(decrypted_msg);
krista@2678
    84
    EngineTestIndividualSuite::tear_down();
krista@2678
    85
}
krista@2678
    86
krista@2678
    87
/*
krista@2678
    88
Type            Error State             Render              Status Code
krista@2678
    89
---------------------------------------------------------------------------------------------------------------
krista@2678
    90
inline          ALL                     Yes, if present     Whatever GPG gives us
krista@2678
    91
PGP/MIME        Unsigned                No                  DECRYPTED_BUT_UNSIGNED (grey)
krista@2678
    92
                Signed, no key          Yes                 NO_KEY_FOR_SIGNER
krista@2678
    93
                Bad sig                 No                  SIGNATURE_DOES_NOT_MATCH
krista@2678
    94
Message 1.0     Unsigned                No                  MODIFICATION_DETECTED
krista@2678
    95
                Signed, no key          No                  MODIFICATION_DETECTED
krista@2678
    96
                Bad sig                 No                  SIGNATURE_DOES_NOT_MATCH
krista@2678
    97
Message 2.0     Unsigned                No                  MODIFICATION_DETECTED (red)
krista@2678
    98
                Signed, no key          No                  MODIFICATION_DETECTED  (red)
krista@2678
    99
                Bad sig                 No                  SIGNATURE_DOES_NOT_MATCH
krista@2678
   100
krista@2678
   101
*/
krista@2678
   102
krista@2678
   103
void IntegrityTests::check_known_good_signed_PGP_MIME() {
krista@2678
   104
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed no attach PGP_MIME.eml", message,
krista@2678
   105
                                             "test_keys/pub/integrity_test_signer_0-0xFF26631A_pub.asc"));
krista@2678
   106
krista@2678
   107
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2678
   108
                                          &rating, &flags, &dummy_ignore);
krista@2678
   109
krista@2678
   110
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
krista@2678
   111
    TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
krista@2678
   112
    TEST_ASSERT(decrypted_msg != NULL);
krista@2678
   113
    TEST_ASSERT(rating == PEP_rating_reliable);
krista@2678
   114
}
krista@2678
   115
krista@2678
   116
void IntegrityTests::check_known_good_signed_PGP_MIME_attached_key() {
krista@2678
   117
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed attached key PGP_MIME.eml", message,
krista@2678
   118
                                             NULL));
krista@2678
   119
krista@2678
   120
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2678
   121
                                          &rating, &flags, &dummy_ignore);
krista@2678
   122
krista@2678
   123
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
krista@2678
   124
    TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
krista@2678
   125
    TEST_ASSERT(decrypted_msg != NULL);
krista@2678
   126
    TEST_ASSERT(rating == PEP_rating_reliable);
krista@2678
   127
}
krista@2678
   128
krista@2678
   129
void IntegrityTests::check_unsigned_PGP_MIME() {
krista@2678
   130
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Unsigned from PGP_MIME_noattach.eml", message,
krista@2678
   131
                                             "test_keys/pub/integrity_test_signer_0-0xFF26631A_pub.asc"));
krista@2678
   132
krista@2678
   133
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2678
   134
                                          &rating, &flags, &dummy_ignore);
krista@2678
   135
krista@2678
   136
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPTED_BUT_UNSIGNED", tl_status_string(decrypt_status));
krista@2678
   137
    TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPTED_BUT_UNSIGNED, failed_msg_buf);
krista@2678
   138
    TEST_ASSERT(decrypted_msg == NULL);
krista@2678
   139
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Rating == %s, should be PEP_rating_unreliable", tl_rating_string(rating));
krista@2678
   140
    TEST_ASSERT_MSG(rating == PEP_rating_unreliable, failed_msg_buf);
krista@2678
   141
}
krista@2678
   142
krista@2678
   143
void IntegrityTests::check_unsigned_PGP_MIME_attached_key() {
krista@2678
   144
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Unsigned from PGP_MIME_attach.eml", message,
krista@2678
   145
                                             NULL));
krista@2678
   146
krista@2678
   147
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2678
   148
                                          &rating, &flags, &dummy_ignore);
krista@2678
   149
krista@2678
   150
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPTED_BUT_UNSIGNED", tl_status_string(decrypt_status));
krista@2678
   151
    TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPTED_BUT_UNSIGNED, failed_msg_buf);
krista@2678
   152
    TEST_ASSERT(decrypted_msg == NULL);
krista@2678
   153
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Rating == %s, should be PEP_rating_unreliable", tl_rating_string(rating));
krista@2678
   154
    TEST_ASSERT_MSG(rating == PEP_rating_unreliable, failed_msg_buf);
krista@2678
   155
}
krista@2678
   156
krista@2678
   157
void IntegrityTests::check_unsigned_PGP_MIME_w_render_flag() {
krista@2678
   158
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Unsigned from PGP_MIME_noattach.eml", message,
krista@2678
   159
                                             "test_keys/pub/integrity_test_signer_0-0xFF26631A_pub.asc"));
krista@2678
   160
    flags |= PEP_decrypt_deliver_pgpmime_badsigned;
krista@2678
   161
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2678
   162
                                          &rating, &flags, &dummy_ignore);
krista@2678
   163
krista@2678
   164
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPTED_BUT_UNSIGNED", tl_status_string(decrypt_status));
krista@2678
   165
    TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPTED_BUT_UNSIGNED, failed_msg_buf);
krista@2678
   166
    TEST_ASSERT(decrypted_msg != NULL);
krista@2678
   167
    TEST_ASSERT(rating == PEP_rating_unreliable);
krista@2678
   168
}
krista@2678
   169
krista@2678
   170
krista@2678
   171
void IntegrityTests::check_unknown_signed_PGP_MIME_no_key() {
krista@2678
   172
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed PGP_MIME by unknown signer no attach.eml", message,
krista@2678
   173
                                             NULL));
krista@2678
   174
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2678
   175
                                          &rating, &flags, &dummy_ignore);
krista@2678
   176
krista@2678
   177
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPT_NO_KEY_FOR_SIGNER", tl_status_string(decrypt_status));
krista@2678
   178
    TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPT_NO_KEY_FOR_SIGNER, failed_msg_buf);
krista@2678
   179
    TEST_ASSERT(decrypted_msg != NULL);
krista@2678
   180
    TEST_ASSERT(rating == PEP_rating_unreliable);
krista@2678
   181
}
krista@2678
   182
krista@2678
   183
void IntegrityTests::check_unknown_signed_PGP_MIME_attached_key() {
krista@2678
   184
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed PGP_MIME by unknown signer attach.eml", message,
krista@2678
   185
                                             NULL));
krista@2678
   186
krista@2678
   187
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2678
   188
                                          &rating, &flags, &dummy_ignore);
krista@2678
   189
krista@2678
   190
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
krista@2678
   191
    TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
krista@2678
   192
    TEST_ASSERT(decrypted_msg != NULL);
krista@2678
   193
    TEST_ASSERT(rating == PEP_rating_reliable);
krista@2678
   194
}
krista@2678
   195
krista@2678
   196
// FIXME: we need cleverer attacked mails
krista@2678
   197
void IntegrityTests::check_unsigned_PGP_MIME_corrupted() {
krista@2678
   198
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Unsigned from PGP_MIME_attach_corrupted.eml", message,
krista@2678
   199
                                             NULL));
krista@2678
   200
krista@2678
   201
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2678
   202
                                          &rating, &flags, &dummy_ignore);
krista@2678
   203
krista@2678
   204
//    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
krista@2678
   205
//    TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
krista@2678
   206
    TEST_ASSERT(decrypt_status != PEP_STATUS_OK && decrypt_status != PEP_DECRYPTED);
krista@2678
   207
    TEST_ASSERT(decrypted_msg == NULL);
krista@2678
   208
}
krista@2678
   209
krista@2678
   210
void IntegrityTests::check_signed_PGP_MIME_corrupted() {
krista@2678
   211
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/Signed attached key PGP_MIME_corrupted.eml", message,
krista@2678
   212
                                             NULL));
krista@2678
   213
krista@2678
   214
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2678
   215
                                          &rating, &flags, &dummy_ignore);
krista@2678
   216
krista@2678
   217
//    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
krista@2678
   218
//    TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
krista@2678
   219
    TEST_ASSERT(decrypt_status != PEP_STATUS_OK && decrypt_status != PEP_DECRYPTED);
krista@2678
   220
    TEST_ASSERT(decrypted_msg == NULL);
krista@2678
   221
}
krista@2678
   222
krista@2679
   223
void IntegrityTests::check_unsigned_2_0() {
krista@2679
   224
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/fake_2.0_unsigned.eml", message,
krista@2679
   225
                                             NULL));
krista@2679
   226
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2679
   227
                                          &rating, &flags, &dummy_ignore);
krista@2679
   228
krista@2679
   229
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPT_MODIFICATION_DETECTED", tl_status_string(decrypt_status));
krista@2679
   230
    TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPT_MODIFICATION_DETECTED, failed_msg_buf);
krista@2679
   231
    TEST_ASSERT(decrypted_msg == NULL);
krista@2679
   232
    TEST_ASSERT(rating == PEP_rating_under_attack);
krista@2679
   233
}
krista@2679
   234
krista@2679
   235
void IntegrityTests::check_unknown_signed_2_0_no_key() {
krista@2679
   236
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/fake_2.0_signed_no_key_attached.eml", message,
krista@2679
   237
                                             NULL));
krista@2679
   238
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2679
   239
                                          &rating, &flags, &dummy_ignore);
krista@2679
   240
krista@2679
   241
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPT_MODIFICATION_DETECTED", tl_status_string(decrypt_status));
krista@2679
   242
    TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPT_MODIFICATION_DETECTED, failed_msg_buf);
krista@2679
   243
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypted msg should have been NULL, but starts with %s", decrypted_msg);
krista@2679
   244
    TEST_ASSERT_MSG(decrypted_msg == NULL, failed_msg_buf);
krista@2679
   245
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Rating == %s, should be PEP_rating_under_attack", tl_rating_string(rating));
krista@2679
   246
    TEST_ASSERT_MSG(rating == PEP_rating_under_attack, failed_msg_buf);
krista@2679
   247
}
krista@2679
   248
krista@2679
   249
void IntegrityTests::check_unknown_signed_2_0_no_key_known_signer() {
krista@2679
   250
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/fake_2.0_signed_no_key_attached.eml", message,
krista@2679
   251
                                             "test_keys/pub/integrity_test_signer_0-0xFF26631A_pub.asc"));
krista@2679
   252
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2679
   253
                                          &rating, &flags, &dummy_ignore);
krista@2679
   254
krista@2679
   255
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_DECRYPT_MODIFICATION_DETECTED", tl_status_string(decrypt_status));
krista@2679
   256
    TEST_ASSERT_MSG(decrypt_status == PEP_DECRYPT_MODIFICATION_DETECTED, failed_msg_buf);
krista@2679
   257
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypted msg should have been NULL, but starts with %s", decrypted_msg);
krista@2679
   258
    TEST_ASSERT_MSG(decrypted_msg == NULL, failed_msg_buf);
krista@2679
   259
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Rating == %s, should be PEP_rating_under_attack", tl_rating_string(rating));
krista@2679
   260
    TEST_ASSERT_MSG(rating == PEP_rating_under_attack, failed_msg_buf);
krista@2679
   261
}
krista@2679
   262
krista@2679
   263
krista@2679
   264
void IntegrityTests::check_unknown_signed_2_0_key_attached() {
krista@2679
   265
    TEST_ASSERT(slurp_message_and_import_key(session, "test_mails/fake_2.0_good.eml", message,
krista@2679
   266
                                             NULL));
krista@2679
   267
    decrypt_status = MIME_decrypt_message(session, message.c_str(), message.size(), &decrypted_msg, &keylist,
krista@2679
   268
                                          &rating, &flags, &dummy_ignore);
krista@2679
   269
krista@2679
   270
    snprintf(failed_msg_buf, TEST_FAILED_MESSAGE_BUFSIZE, "Decrypt status == %s, should be PEP_STATUS_OK", tl_status_string(decrypt_status));
krista@2679
   271
    TEST_ASSERT_MSG(decrypt_status == PEP_STATUS_OK, failed_msg_buf);
krista@2679
   272
    TEST_ASSERT(decrypted_msg != NULL);
krista@2679
   273
    TEST_ASSERT(rating == PEP_rating_reliable);
krista@2679
   274
}
krista@2679
   275
krista@2679
   276
krista@2678
   277
void IntegrityTests::check_integrity() {
krista@2678
   278
    TEST_ASSERT(true);
krista@2678
   279
}