Thomas 7 months ago
parent
commit
a2e773e0b4
35 changed files with 223 additions and 164 deletions
  1. +35
    -2
      src/message_api.c
  2. +21
    -1
      src/message_api.h
  3. +7
    -3
      test/src/AppleMailTest.cc
  4. +1
    -1
      test/src/AsciiBinaryAtt998Test.cc
  5. +1
    -1
      test/src/BareDecryptShellTest.cc
  6. +4
    -4
      test/src/CheckRenewedExpiredKeyTrustStatusTest.cc
  7. +2
    -2
      test/src/DecryptAttachPrivateKeyTrustedTest.cc
  8. +1
    -1
      test/src/DecryptAttachPrivateKeyUntrustedTest.cc
  9. +2
    -2
      test/src/ElevatedAttachmentsTest.cc
  10. +8
    -6
      test/src/EncryptForIdentityTest.cc
  11. +4
    -4
      test/src/Engine463Test.cc
  12. +1
    -1
      test/src/Engine514Test.cc
  13. +3
    -3
      test/src/Engine619Test.cc
  14. +1
    -1
      test/src/Engine655Test.cc
  15. +1
    -1
      test/src/Engine704Test.cc
  16. +2
    -2
      test/src/ExternalRevokeTest.cc
  17. +34
    -34
      test/src/GroupEncryptionTest.cc
  18. +1
    -1
      test/src/HeaderKeyImportTest.cc
  19. +18
    -18
      test/src/KeyAttachmentTest.cc
  20. +14
    -14
      test/src/KeyResetMessageTest.cc
  21. +1
    -1
      test/src/LeastColorGroupTest.cc
  22. +2
    -2
      test/src/LeastCommonDenomColorTest.cc
  23. +2
    -2
      test/src/MessageNullFromTest.cc
  24. +1
    -1
      test/src/MessageTwoPointOhTest.cc
  25. +2
    -2
      test/src/NoOwnIdentWritesOnDecryptTest.cc
  26. +3
    -3
      test/src/OldMessageApiTest.cc
  27. +6
    -6
      test/src/PassphraseTest.cc
  28. +13
    -13
      test/src/PepSubjectReceivedTest.cc
  29. +3
    -3
      test/src/ReceiverRatingTest.cc
  30. +24
    -24
      test/src/ReencryptPlusExtraKeysTest.cc
  31. +1
    -1
      test/src/SenderFPRTest.cc
  32. +1
    -1
      test/src/TestUtilities.cc
  33. +1
    -1
      test/src/URIAddressTest.cc
  34. +1
    -1
      test/src/UnencryptedPepMailTest.cc
  35. +1
    -1
      test/src/VerifyTest.cc

+ 35
- 2
src/message_api.c View File

@ -6226,7 +6226,7 @@ pEp_error:
return status;
}
DYNAMIC_API PEP_STATUS decrypt_message(
DYNAMIC_API PEP_STATUS decrypt_message_2(
PEP_SESSION session,
message *src,
message **dst,
@ -6335,6 +6335,39 @@ DYNAMIC_API PEP_STATUS decrypt_message(
return status;
}
/* The API compatibility alternative to decrypt_message_2. This is, of course,
just a thin compatibility layer on top of it. */
DYNAMIC_API PEP_STATUS decrypt_message(
PEP_SESSION session,
message *src,
message **dst,
stringlist_t **keylist,
PEP_rating *rating,
PEP_decrypt_flags_t *flags
)
{
/* Check that the rating output parameter has been passed correctly;
initialise it just to ease debugging (stress the passed pointer by
dereferencing it), even if it would not be necessary. */
assert(rating);
if (! rating)
return PEP_ILLEGAL_VALUE;
* rating = PEP_rating_undefined;
/* Do the actual work. */
PEP_STATUS res = decrypt_message_2(session, src, dst, keylist, flags);
/* Set the output rating, copying it from the message field. Notice that
the message field itself has been initialised correctly in
decrypt_message_2 , so this will be reasonable even if decryption
failed. */
message *msg = *dst ? *dst : src;
* rating = msg->rating;
/* We are done. */
return res;
}
DYNAMIC_API PEP_STATUS own_message_private_key_details(
PEP_SESSION session,
message *msg,
@ -6932,7 +6965,7 @@ DYNAMIC_API PEP_STATUS get_message_trustwords(
message *dst = NULL;
stringlist_t *_keylist = keylist;
PEP_decrypt_flags_t flags;
status = decrypt_message( session, msg, &dst, &_keylist, &flags);
status = decrypt_message_2( session, msg, &dst, &_keylist, &flags);
if (status != PEP_STATUS_OK) {
free_message(dst);


+ 21
- 1
src/message_api.h View File

@ -242,7 +242,7 @@ typedef unsigned int PEP_decrypt_flags_t;
/**
* <!-- decrypt_message() -->
* <!-- decrypt_message_2() -->
*
* @brief Decrypt message in memory
*
@ -315,11 +315,31 @@ typedef unsigned int PEP_decrypt_flags_t;
* so that they can be handled by the internal algorithm appropriately)
*/
DYNAMIC_API PEP_STATUS decrypt_message_2(
PEP_SESSION session,
message *src,
message **dst,
stringlist_t **keylist,
PEP_decrypt_flags_t *flags
);
/**
* <!-- decrypt_message() -->
*
* @brief Exactly like decrypt_message_2, but with the rating output parameter.
* This function is kept for API compatibility: new code should use
* decrypt_message_2 instead of this function.
*
* @param[out] rating output message rating, only valid in case
* decryption succeeded.
*/
DYNAMIC_API PEP_STATUS decrypt_message(
PEP_SESSION session,
message *src,
message **dst,
stringlist_t **keylist,
PEP_rating *rating,
PEP_decrypt_flags_t *flags
);


+ 7
- 3
test/src/AppleMailTest.cc View File

@ -132,14 +132,18 @@ TEST_F(AppleMailTest, check_apple_mail_text_signed_encrypted) {
final_ptr = msg_ptr;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &flags);
/* This time get the rating from the old-style API, to test it as well. */
PEP_rating rating;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &rating,
&flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
output_stream << "shortmsg: " << final_ptr->shortmsg << endl << endl;
output_stream << "longmsg: " << final_ptr->longmsg << endl << endl;
output_stream << "longmsg_formatted: " << (final_ptr->longmsg_formatted ? final_ptr->longmsg_formatted : "(empty)") << endl << endl;
ASSERT_EQ(color_from_rating(final_ptr->rating) , PEP_color_green);
ASSERT_EQ(final_ptr->rating, rating);
ASSERT_EQ(color_from_rating(rating) , PEP_color_green);
if (final_ptr == dest_msg)
free_message(dest_msg);
@ -193,7 +197,7 @@ TEST_F(AppleMailTest, check_apple_mail_html_signed_encrypted) {
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(msg_ptr);
final_ptr = msg_ptr;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &flags);
status = decrypt_message_2(session, msg_ptr, &dest_msg, &keylist, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
output_stream << "shortmsg: " << final_ptr->shortmsg << endl << endl;


+ 1
- 1
test/src/AsciiBinaryAtt998Test.cc View File

@ -165,7 +165,7 @@ TEST_F(AsciiBinary998Test, check_engine_895) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_EQ(memcmp(data_copy, dec_msg->attachments->value, data_size), 0);


+ 1
- 1
test/src/BareDecryptShellTest.cc View File

@ -104,7 +104,7 @@ TEST_F(BareDecryptShellTest, check_bare_decrypt_shell) {
PEP_decrypt_flags_t flags = 0;
mime_decode_message(inmsg_str.c_str(), inmsg_str.size(), &inmsg, NULL);
PEP_STATUS status = decrypt_message(session, inmsg, &outmsg, &keylist, &rating, &flags);
PEP_STATUS status = decrypt_message_2(session, inmsg, &outmsg, &keylist, &rating, &flags);
ASSERT_OK;
cout << message_to_str(outmsg);
}


+ 4
- 4
test/src/CheckRenewedExpiredKeyTrustStatusTest.cc View File

@ -124,7 +124,7 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
status = mime_decode_message(msg.c_str(), msg.size(), &enc_msg, NULL);
ASSERT_OK;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_DECRYPTED); // ???
ok = slurp_and_import_key(session, "test_keys/pub/inquisitor-0xA4728718_renewed_pub.asc");
@ -189,7 +189,7 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
status = mime_decode_message(msg.c_str(), msg.size(), &enc_msg, NULL);
ASSERT_OK;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_DECRYPTED); // ???
ok = slurp_and_import_key(session, "test_keys/pub/inquisitor-0xA4728718_renewed_pub.asc");
@ -280,7 +280,7 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
status = mime_decode_message(msg.c_str(), msg.size(), &enc_msg, NULL);
ASSERT_OK;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_DECRYPTED); // ???
ok = slurp_and_import_key(session, "test_keys/pub/inquisitor-0xA4728718_renewed_pub.asc");
@ -354,7 +354,7 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
status = mime_decode_message(msg.c_str(), msg.size(), &enc_msg, NULL);
ASSERT_OK;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_DECRYPTED);
ok = slurp_and_import_key(session, "test_keys/pub/inquisitor-0xA4728718_renewed_pub.asc");


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

@ -170,7 +170,7 @@ TEST_F(DecryptAttachPrivateKeyTrustedTest, check_decrypt_attach_private_key_trus
ASSERT_EQ(same_addr_same_uid->comm_type, PEP_ct_pEp);
flags = 0;
status = decrypt_message(session, encoded_text, &decrypted_text,
status = decrypt_message_2(session, encoded_text, &decrypted_text,
&keylist_used, &flags);
status = get_trust(session, same_addr_same_uid);
@ -178,7 +178,7 @@ TEST_F(DecryptAttachPrivateKeyTrustedTest, check_decrypt_attach_private_key_trus
wipe_message_ptr(&decrypted_text);
flags = 0;
status = decrypt_message(session, encoded_text, &decrypted_text,
status = decrypt_message_2(session, encoded_text, &decrypted_text,
&keylist_used, &flags);
output_stream << "Status: " << tl_status_string(status) << endl;


+ 1
- 1
test/src/DecryptAttachPrivateKeyUntrustedTest.cc View File

@ -176,7 +176,7 @@ TEST_F(DecryptAttachPrivateKeyUntrustedTest, check_decrypt_attach_private_key_un
ASSERT_NE(same_addr_same_uid->comm_type & PEP_ct_confirmed, PEP_ct_confirmed);
flags = 0;
status = decrypt_message(session, encoded_text, &decrypted_text,
status = decrypt_message_2(session, encoded_text, &decrypted_text,
&keylist_used, &flags);
status = get_trust(session, same_addr_same_uid);


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

@ -270,7 +270,7 @@ TEST_F(ElevatedAttachmentsTest, check_encrypt_decrypt_message) {
stringlist_t *keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_STREQ(dec_msg->shortmsg, enc_msg->shortmsg);
ASSERT_STREQ(msg->longmsg, dec_msg->longmsg);
@ -405,7 +405,7 @@ TEST_F(ElevatedAttachmentsTest, check_encrypt_decrypt_message_elevated) {
stringlist_t *keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, art_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, art_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_TRUE(dec_msg);
// today the engine is sucking keys in


+ 8
- 6
test/src/EncryptForIdentityTest.cc View File

@ -178,10 +178,12 @@ TEST_F(EncryptForIdentityTest, check_encrypt_for_identity) {
PEP_decrypt_flags_t flags;
flags = 0;
status = decrypt_message(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
/* Here use the old-style API, so that we test that as well. */
PEP_rating rating;
status = decrypt_message(session, encrypted_msg, &decrypted_msg, &keylist_used, &rating, &flags);
ASSERT_NOTNULL(decrypted_msg);
PEP_rating rating = decrypted_msg->rating;
ASSERT_NOTNULL(keylist_used);
ASSERT_EQ(rating, decrypted_msg->rating);
ASSERT_NE(rating, 0);
ASSERT_TRUE(status == PEP_DECRYPTED && rating == PEP_rating_unreliable);
PEP_comm_type ct = encrypted_msg->from->comm_type;
@ -226,7 +228,7 @@ TEST_F(EncryptForIdentityTest, check_encrypt_for_identity) {
output_stream << "message encrypted.\n";
flags = 0;
status = decrypt_message(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_NOTNULL(decrypted_msg);
rating = decrypted_msg->rating;
ASSERT_NOTNULL(keylist_used);
@ -314,7 +316,7 @@ TEST_F(EncryptForIdentityTest, check_encrypt_for_identity) {
PEP_decrypt_flags_t mimeflags;
mimeflags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist_used, &mimeflags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist_used, &mimeflags);
ASSERT_NOTNULL(dec_msg);
PEP_rating mimerating = dec_msg->rating;
@ -438,7 +440,7 @@ TEST_F(EncryptForIdentityTest, check_encrypt_for_identity_with_URI) {
PEP_decrypt_flags_t flags;
flags = 0;
status = decrypt_message(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_NOTNULL(decrypted_msg);
PEP_rating rating = decrypted_msg->rating;
ASSERT_NOTNULL(keylist_used);
@ -486,7 +488,7 @@ TEST_F(EncryptForIdentityTest, check_encrypt_for_identity_with_URI) {
output_stream << "message encrypted.\n";
flags = 0;
status = decrypt_message(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_NOTNULL(decrypted_msg);
rating = decrypted_msg->rating;
ASSERT_NOTNULL(keylist_used);


+ 4
- 4
test/src/Engine463Test.cc View File

@ -101,7 +101,7 @@ TEST_F(Engine463Test, check_engine_463_no_own_key) {
stringlist_t* keylist_used = nullptr;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_OK;
}
@ -127,7 +127,7 @@ TEST_F(Engine463Test, check_engine_463_sender_expired_and_renewed) {
stringlist_t* keylist_used = nullptr;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
free(decrypted_msg);
@ -144,7 +144,7 @@ TEST_F(Engine463Test, check_engine_463_sender_expired_and_renewed) {
flags = 0;
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_NOTNULL(decrypted_msg);
ASSERT_OK;
rating = decrypted_msg->rating;
@ -182,7 +182,7 @@ TEST_F(Engine463Test, check_engine_463_sender_expired_and_renewed) {
stringlist_t* keylist_used = nullptr;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
free(decrypted_msg);


+ 1
- 1
test/src/Engine514Test.cc View File

@ -269,7 +269,7 @@ TEST_F(Engine514Test, check_engine514_encrypted) {
PEP_decrypt_flags_t flags = 0;
stringlist_t* keylist = NULL;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_STREQ(msg->attachments->mime_type, "message/rfc822");
ASSERT_NULL(msg->attachments->next);


+ 3
- 3
test/src/Engine619Test.cc View File

@ -271,7 +271,7 @@ namespace {
// PEP_rating rating;
// PEP_decrypt_flags_t flags = 0;
// status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
// status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
// ASSERT_EQ(status, PEP_STATUS_OK);
// ASSERT_STREQ(dec_msg->shortmsg, enc_msg->shortmsg);
// ASSERT_STREQ(msg->longmsg, dec_msg->longmsg);
@ -407,7 +407,7 @@ namespace {
// PEP_rating rating;
// PEP_decrypt_flags_t flags = 0;
// status = decrypt_message(session, art_msg, &dec_msg, &keylist, &rating, &flags);
// status = decrypt_message_2(session, art_msg, &dec_msg, &keylist, &rating, &flags);
// ASSERT_EQ(status, PEP_STATUS_OK);
// ASSERT_TRUE(dec_msg);
// // today the engine is sucking keys in
@ -441,7 +441,7 @@ TEST_F(Engine619Test, decrypt_message_with_private_key) {
stringlist_t* keys = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, message_src, & message_dst,
status = decrypt_message_2(session, message_src, & message_dst,
& keys, & flags);
/* It is normal and expected that decryption fails here: this message is
unencrypted. The point of this test is to arrive at a call to


+ 1
- 1
test/src/Engine655Test.cc View File

@ -144,7 +144,7 @@ TEST_F(Engine655Test, check_engine655) {
keylist = NULL;
message* dec_msg = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
EXPECT_EQ(status, PEP_DECRYPTED); // really, expect PEP_STATUS_OK, but it doesn't verify and msg may be broken
// EXPECT_NE(ptext, nullptr);
// EXPECT_NE(keylist, nullptr);


+ 1
- 1
test/src/Engine704Test.cc View File

@ -130,7 +130,7 @@ TEST_F(Engine704Test, check_engine704) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_STREQ(dec_msg->from->username, alicename);
ASSERT_STREQ(dec_msg->to->ident->username, bobname);
}

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

@ -204,7 +204,7 @@ TEST_F(ExternalRevokeTest, check_external_revoke) {
flags = 0;
output_stream << "Decrypting message." << endl;
status = decrypt_message(session, encrypted_outgoing_msg, &outgoing_msg, &keylist, &flags);
status = decrypt_message_2(session, encrypted_outgoing_msg, &outgoing_msg, &keylist, &flags);
output_stream << "Decrypted message with status " << tl_status_string(status) << endl;
ASSERT_OK;
PEP_rating rating = outgoing_msg->rating;
@ -384,7 +384,7 @@ TEST_F(ExternalRevokeTest, check_external_revoke) {
flags = 0;
status = decrypt_message(session, encrypted_outgoing_msg, &decrypted_msg, &keylist, &flags);
status = decrypt_message_2(session, encrypted_outgoing_msg, &decrypted_msg, &keylist, &flags);
output_stream << "Decryption returns with status " << tl_status_string(status) << endl;
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(decrypted_msg);


+ 34
- 34
test/src/GroupEncryptionTest.cc View File

@ -1032,7 +1032,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_create_receive_member_1) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1123,7 +1123,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_create_receive_member_2) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1187,7 +1187,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_create_receive_member_3) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1251,7 +1251,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_create_receive_member_4) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1484,7 +1484,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_1) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -1557,7 +1557,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_2) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -1616,7 +1616,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_3) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -1675,7 +1675,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_4) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -1771,7 +1771,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_receive) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1869,7 +1869,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_send) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// Member 1
@ -1882,7 +1882,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_send) {
free_stringlist(keylist);
keylist = NULL;
flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// Member 2
@ -1895,7 +1895,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_send) {
free_stringlist(keylist);
keylist = NULL;
flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(msg);
@ -2060,7 +2060,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_receive) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
@ -2098,7 +2098,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_receive) {
dec_msg = NULL;
keylist = NULL;
flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
status = retrieve_own_membership_info_for_group_and_identity(session, group, me);
@ -2171,7 +2171,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_unknown) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// Now make sure we didn't do anything with the message
@ -2220,7 +2220,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_group_unknown) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -2604,7 +2604,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_not_manager) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(msg);
@ -2620,7 +2620,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_not_manager) {
keylist = NULL;
flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
free_message(msg);
ASSERT_OK;
free_message(dec_msg);
@ -2646,7 +2646,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_not_manager) {
keylist = NULL;
flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, msg, &dec_msg, &keylist, &flags);
free_message(msg);
free_message(dec_msg);
ASSERT_OK;
@ -3087,11 +3087,11 @@ TEST_F(GroupEncryptionTest, check_protocol_group_key_reset_two_recents) {
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_1, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_2, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
@ -3188,7 +3188,7 @@ TEST_F(GroupEncryptionTest, check_group_key_reset_receive_member_2) {
enc_msg = string_to_msg(invite);
ASSERT_NE(enc_msg, nullptr);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
pEp_identity* group_ident = new_identity(group_1_address, NULL, "MEMBER2", group_1_name);
@ -3207,7 +3207,7 @@ TEST_F(GroupEncryptionTest, check_group_key_reset_receive_member_2) {
enc_msg = string_to_msg(resetmsg);
ASSERT_NE(enc_msg, nullptr);
free_message(dec_msg);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
bool is_revoked;
@ -3247,7 +3247,7 @@ TEST_F(GroupEncryptionTest, check_group_key_reset_receive_partner_1) {
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// FIXME: reinstate this when key election removal is in - fails due to delete_keypair
@ -3289,7 +3289,7 @@ TEST_F(GroupEncryptionTest, check_group_key_reset_receive_partner_2) {
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
// FIXME: reinstate this when key election removal is in - fails due to delete_keypair
@ -3431,11 +3431,11 @@ TEST_F(GroupEncryptionTest, check_protocol_group_key_reset_two_recents_two_missi
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_1, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_2, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
@ -3600,7 +3600,7 @@ TEST_F(GroupEncryptionTest, check_protocol_group_key_reset_one_recent_all_missin
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_1, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
free_message(message_1);
@ -3852,11 +3852,11 @@ TEST_F(GroupEncryptionTest, check_protocol_remove_member_from_group_two_recents)
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_1, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_2, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
@ -4060,11 +4060,11 @@ TEST_F(GroupEncryptionTest, check_protocol_remove_member_not_joined_from_group_t
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_1, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_2, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
@ -4267,11 +4267,11 @@ TEST_F(GroupEncryptionTest, check_protocol_remove_unknown_member_from_group_two_
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_1, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, message_2, &dec_msg, &keylist, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;


+ 1
- 1
test/src/HeaderKeyImportTest.cc View File

@ -730,7 +730,7 @@ TEST_F(HeaderKeyImportTest, check_header_key_import) {
flags = 0;
message* enc_msg = string_to_msg(strmsg);
PEP_STATUS status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
PEP_STATUS status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
PEP_rating rating = dec_msg->rating;
ASSERT_EQ(rating, PEP_rating_reliable);


+ 18
- 18
test/src/KeyAttachmentTest.cc View File

@ -106,7 +106,7 @@ TEST_F(KeyAttachmentTest, check_key_attach_inline) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
#if KEYS_STAY_ATTACHED
ASSERT_NOTNULL(dec_msg->attachments );
@ -132,7 +132,7 @@ TEST_F(KeyAttachmentTest, check_key_plus_encr_att_inline) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -166,7 +166,7 @@ TEST_F(KeyAttachmentTest, check_encr_att_plus_key_inline) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -202,7 +202,7 @@ TEST_F(KeyAttachmentTest, check_key_plus_unencr_att_inline) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -238,7 +238,7 @@ TEST_F(KeyAttachmentTest, check_unencr_att_plus_key_inline) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_NOTNULL(dec_msg);
ASSERT_NOTNULL(dec_msg->attachments);
@ -272,7 +272,7 @@ TEST_F(KeyAttachmentTest, check_many_keys_inline) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -295,7 +295,7 @@ TEST_F(KeyAttachmentTest, check_many_keys_w_encr_file_inline) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -328,7 +328,7 @@ TEST_F(KeyAttachmentTest, check_many_keys_w_unencr_file_inline) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -361,7 +361,7 @@ TEST_F(KeyAttachmentTest, check_many_keys_with_many_files_inline) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_NOTNULL(dec_msg);
@ -416,7 +416,7 @@ TEST_F(KeyAttachmentTest, check_key_attach_OpenPGP) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -443,7 +443,7 @@ TEST_F(KeyAttachmentTest, check_key_plus_encr_att_OpenPGP) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -476,7 +476,7 @@ TEST_F(KeyAttachmentTest, check_encr_att_plus_key_OpenPGP) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -512,7 +512,7 @@ TEST_F(KeyAttachmentTest, check_key_plus_unencr_att_OpenPGP) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -547,7 +547,7 @@ TEST_F(KeyAttachmentTest, check_unencr_att_plus_key_OpenPGP) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
ASSERT_NOTNULL(dec_msg->attachments);
@ -576,7 +576,7 @@ TEST_F(KeyAttachmentTest, check_many_keys_OpenPGP) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -599,7 +599,7 @@ TEST_F(KeyAttachmentTest, check_many_keys_w_encr_file_OpenPGP) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
ASSERT_NOTNULL(dec_msg->attachments);
@ -630,7 +630,7 @@ TEST_F(KeyAttachmentTest, check_many_keys_w_unencr_file_OpenPGP) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
ASSERT_NOTNULL(dec_msg->attachments);
@ -661,7 +661,7 @@ TEST_F(KeyAttachmentTest, check_many_keys_w_many_files_OpenPGP) {
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_NOTNULL(dec_msg);


+ 14
- 14
test/src/KeyResetMessageTest.cc View File

@ -422,7 +422,7 @@ TEST_F(KeyResetMessageTest, check_non_reset_receive_revoked) {
message* dec_msg_obj = NULL;
status = mime_decode_message(received_mail.c_str(), received_mail.size(), &enc_msg_obj, NULL);
ASSERT_OK;
status = decrypt_message(session, enc_msg_obj, &dec_msg_obj, &keylist, &flags);
status = decrypt_message_2(session, enc_msg_obj, &dec_msg_obj, &keylist, &flags);
ASSERT_OK;
@ -473,7 +473,7 @@ TEST_F(KeyResetMessageTest, check_reset_receive_revoked) {
message* decrypted_msg = NULL;
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, received_mail,
status = decrypt_message_2(session, received_mail,
&decrypted_msg, &keylist, &flags);
ASSERT_OK;
@ -513,7 +513,7 @@ TEST_F(KeyResetMessageTest, revoke_and_check_receive_message) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(dec_msg);
ASSERT_EQ(m_queue.size() , 0);
@ -542,7 +542,7 @@ TEST_F(KeyResetMessageTest, check_receive_message_to_revoked_key_from_unknown) {
message* decrypted_msg = NULL;
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, received_mail,
status = decrypt_message_2(session, received_mail,
&decrypted_msg, &keylist, &flags);
ASSERT_EQ(m_queue.size() , 0);
free_message(decrypted_msg);
@ -613,7 +613,7 @@ TEST_F(KeyResetMessageTest, check_receive_message_to_revoked_key_from_contact) {
// here if we don't put it there, we do now.
received_mail->to->ident->user_id = strdup(PEP_OWN_USERID);
status = decrypt_message(session, received_mail,
status = decrypt_message_2(session, received_mail,
&decrypted_msg, &keylist, &flags);
ASSERT_EQ(m_queue.size() , 1);
@ -770,7 +770,7 @@ TEST_F(KeyResetMessageTest, check_reset_grouped_own_recv) {
message* decrypted_msg = NULL;
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, received_mail,
status = decrypt_message_2(session, received_mail,
&decrypted_msg, &keylist, &flags);
status = myself(session, alice);
@ -959,7 +959,7 @@ TEST_F(KeyResetMessageTest, check_reset_grouped_own_multi_ident_one_fpr_recv) {
ASSERT_NOTNULL(new_msg);
ASSERT_EQ(status, PEP_STATUS_OK);
status = decrypt_message(session, new_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, new_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
status = myself(session, alex_id);
@ -1442,7 +1442,7 @@ TEST_F(KeyResetMessageTest, check_reset_all_own_grouped_recv) {
ASSERT_NOTNULL(new_msg);
ASSERT_EQ(status, PEP_STATUS_OK);
status = decrypt_message(session, new_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, new_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
}
@ -1544,7 +1544,7 @@ TEST_F(KeyResetMessageTest, check_reset_all_own_grouped_recv_with_sticky) {
ASSERT_NE(new_msg, nullptr);
ASSERT_EQ(status, PEP_STATUS_OK);
status = decrypt_message(session, new_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, new_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
char* new_main_key = NULL;
@ -1646,7 +1646,7 @@ TEST_F(KeyResetMessageTest, check_reset_grouped_own_multiple_keys_multiple_ident
ASSERT_NOTNULL(new_msg);
ASSERT_EQ(status, PEP_STATUS_OK);
status = decrypt_message(session, new_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, new_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
}
@ -1863,7 +1863,7 @@ TEST_F(KeyResetMessageTest, check_reset_grouped_own_multiple_keys_multiple_ident
ASSERT_NOTNULL(new_msg);
ASSERT_EQ(status, PEP_STATUS_OK);
status = decrypt_message(session, new_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, new_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
status = myself(session, alex_id);
@ -2635,7 +2635,7 @@ TEST_F(KeyResetMessageTest, check_no_reset_message_to_self) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(m_queue.size(), 0);
ASSERT_EQ(status, PEP_VERIFY_SIGNER_KEY_REVOKED);
}
@ -2672,7 +2672,7 @@ TEST_F(KeyResetMessageTest, check_reset_mistrust_next_msg_have_not_mailed) {
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
//
// status = decrypt_message(session, bob_enc_msg, &bob_dec_msg, &keylist, &flags);
// status = decrypt_message_2(session, bob_enc_msg, &bob_dec_msg, &keylist, &flags);
// ASSERT_EQ(status, PEP_STATUS_OK);
// rating = bob_dec_msg->rating;
// ASSERT_EQ(rating, PEP_rating_mistrust);
@ -2700,7 +2700,7 @@ TEST_F(KeyResetMessageTest, check_reset_mistrust_next_msg_have_not_mailed) {
keylist = NULL;
flags = 0;
status = decrypt_message(session, bob_enc_msg, &bob_dec_msg, &keylist, &flags);
status = decrypt_message_2(session, bob_enc_msg, &bob_dec_msg, &keylist, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
rating = bob_dec_msg->rating;
ASSERT_EQ(rating, PEP_rating_reliable);


+ 1
- 1
test/src/LeastColorGroupTest.cc View File

@ -142,7 +142,7 @@ TEST_F(LeastColorGroupTest, check_least_color_group) {
ASSERT_NOTNULL(msg_ptr);
final_ptr = msg_ptr;
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &flags);
status = decrypt_message_2(session, msg_ptr, &dest_msg, &keylist, &flags);
final_ptr = dest_msg ? dest_msg : msg_ptr;
PEP_rating rating = final_ptr->rating;


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

@ -154,7 +154,7 @@ TEST_F(LeastCommonDenomColorTest, check_least_common_denom_color) {
ASSERT_NOTNULL(msg_ptr);
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &flags);
status = decrypt_message_2(session, msg_ptr, &dest_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_NOTNULL(dest_msg);
PEP_rating rating = dest_msg->rating;
@ -203,7 +203,7 @@ TEST_F(LeastCommonDenomColorTest, check_least_common_denom_color) {
ASSERT_OK;
ASSERT_NOTNULL(msg_ptr);
flags = 0;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &flags);
status = decrypt_message_2(session, msg_ptr, &dest_msg, &keylist, &flags);
output_stream << "shortmsg: " << dest_msg->shortmsg << endl << endl;
output_stream << "longmsg: " << dest_msg->longmsg << endl << endl;


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

@ -110,7 +110,7 @@ TEST_F(MessageNullFromTest, check_message_null_from_no_header_key_unencrypted) {
message* enc_msg = string_to_msg(null_from_msg);
message* dec_msg = NULL;
ASSERT_NOTNULL(enc_msg);
PEP_STATUS status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
PEP_STATUS status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_UNENCRYPTED);
}
@ -122,7 +122,7 @@ TEST_F(MessageNullFromTest, check_message_null_from_header_key_unencrypted) {
message* enc_msg = string_to_msg(null_from_msg);
message* dec_msg = NULL;
ASSERT_NOTNULL(enc_msg);
PEP_STATUS status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
PEP_STATUS status = decrypt_message_2(session, enc_msg, &dec_msg, &keylist, &flags);
ASSERT_EQ(status , PEP_UNENCRYPTED);
}


+ 1
- 1
test/src/MessageTwoPointOhTest.cc View File

@ -200,7 +200,7 @@ TEST_F(MessageTwoPointOhTest, check_message_two_point_oh) {
stringpair_t* autoconsume = new_stringpair("pEp-auto-consume", "yes");
stringpair_list_add(encrypted_msg->opt_fields, autoconsume);
flags = 0;
status = decrypt_message(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_NOTNULL(decrypted_msg);
PEP_rating rating = decrypted_msg->rating;
ASSERT_NOTNULL(keylist_used);


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

@ -181,7 +181,7 @@ TEST_F(NoOwnIdentWritesOnDecryptTest, check_no_own_ident_writes_on_decrypt) {
stringlist_t* keylist = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, copy, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, copy, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_STREQ(dec_msg->to->next->ident->username, "Hot Bob");
@ -241,7 +241,7 @@ TEST_F(NoOwnIdentWritesOnDecryptTest, check_no_own_ident_writes_on_decrypt) {
keylist = NULL;
flags = 0;
status = decrypt_message(session, copy, &dec_msg, &keylist, &flags);
status = decrypt_message_2(session, copy, &dec_msg, &keylist, &flags);
ASSERT_OK;
ASSERT_STREQ(dec_msg->to->next->ident->username, "Hot Bob");


+ 3
- 3
test/src/OldMessageApiTest.cc View File

@ -170,7 +170,7 @@ TEST_F(OldMessageApiTest, check_message_api) {
PEP_decrypt_flags_t flags;
flags = 0;
PEP_STATUS status4 = decrypt_message(session, enc_msg2, &msg4, &keylist4, &flags);
PEP_STATUS status4 = decrypt_message_2(session, enc_msg2, &msg4, &keylist4, &flags);
ASSERT_EQ(status4 , PEP_STATUS_OK);
ASSERT_NOTNULL(msg4);
PEP_rating rating = msg4->rating;
@ -214,7 +214,7 @@ TEST_F(OldMessageApiTest, check_message_api) {
stringlist_t *keylist5 = nullptr;
PEP_decrypt_flags_t flags2;
flags2 = 0;
PEP_STATUS status6 = decrypt_message(session, msg5, &msg6, &keylist5, &flags2);
PEP_STATUS status6 = decrypt_message_2(session, msg5, &msg6, &keylist5, &flags2);
ASSERT_EQ(status6 , PEP_DECRYPT_NO_KEY);
ASSERT_NULL(msg6 );
PEP_rating rating2 = msg5->rating;
@ -241,7 +241,7 @@ TEST_F(OldMessageApiTest, check_message_api) {
dec_flags = 0;
PEP_STATUS status8 = decrypt_message(session, enc_msg, &dec_msg, &keys_used, &dec_flags);
PEP_STATUS status8 = decrypt_message_2(session, enc_msg, &dec_msg, &keys_used, &dec_flags);
ASSERT_EQ(status8 , PEP_STATUS_OK);
print_mail(dec_msg);


+ 6
- 6
test/src/PassphraseTest.cc View File

@ -641,7 +641,7 @@ TEST_F(PassphraseTest, check_bob_primary_pass_subkey_no_passphrase_nopass_decryp
message* decrypted_msg = NULL;
stringlist_t* keylist_used = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, enc_msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(decrypted_msg);
@ -680,7 +680,7 @@ TEST_F(PassphraseTest, check_carol_primary_unenc_subkeys_passphrase_nopass_decry
message* decrypted_msg = NULL;
stringlist_t* keylist_used = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, enc_msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_EQ(status, PEP_PASSPHRASE_REQUIRED);
ASSERT_NULL(decrypted_msg);
@ -962,7 +962,7 @@ TEST_F(PassphraseTest, check_carol_primary_unenc_subkeys_passphrase_withpass_dec
message* decrypted_msg = NULL;
stringlist_t* keylist_used = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, enc_msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(decrypted_msg);
@ -1005,7 +1005,7 @@ TEST_F(PassphraseTest, check_carol_primary_unenc_subkeys_passphrase_wrongpass_de
message* decrypted_msg = NULL;
stringlist_t* keylist_used = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message_2(session, enc_msg, &decrypted_msg, &keylist_used, &flags);
ASSERT_EQ(status, PEP_WRONG_PASSPHRASE);
ASSERT_NULL(decrypted_msg);
@ -1163,7 +1163,7 @@ TEST_F(PassphraseTest, check_fenris_encrypted_key_generate_with_passphrase_decry
msg = NULL;
stringlist_t* keylist_used = NULL;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &msg, &keylist_used, &flags);
status = decrypt_message_2(session, enc_msg, &msg, &keylist_used, &flags);
ASSERT_EQ(status, PEP_STATUS_OK);
</