Browse Source

temporarily undo the changes in ENGINE-959: some other projects are not up to date yet

master before-incompatible-change-in-ENGINE-959
Luca Saiu 1 month ago
parent
commit
f1632b7c10
38 changed files with 332 additions and 314 deletions
  1. +1
    -1
      src/keymanagement.c
  2. +0
    -4
      src/message.c
  3. +0
    -1
      src/message.h
  4. +13
    -49
      src/message_api.c
  5. +39
    -34
      src/message_api.h
  6. +0
    -34
      src/pEpEngine.h
  7. +5
    -4
      test/src/AppleMailTest.cc
  8. +2
    -1
      test/src/AsciiBinaryAtt998Test.cc
  9. +8
    -8
      test/src/CheckRenewedExpiredKeyTrustStatusTest.cc
  10. +3
    -2
      test/src/DecryptAttachPrivateKeyTrustedTest.cc
  11. +2
    -1
      test/src/DecryptAttachPrivateKeyUntrustedTest.cc
  12. +4
    -2
      test/src/ElevatedAttachmentsTest.cc
  13. +8
    -10
      test/src/EncryptForIdentityTest.cc
  14. +7
    -7
      test/src/Engine463Test.cc
  15. +2
    -1
      test/src/Engine514Test.cc
  16. +2
    -1
      test/src/Engine619Test.cc
  17. +2
    -1
      test/src/Engine655Test.cc
  18. +2
    -1
      test/src/Engine704Test.cc
  19. +3
    -4
      test/src/ExternalRevokeTest.cc
  20. +59
    -34
      test/src/GroupEncryptionTest.cc
  21. +3
    -3
      test/src/HeaderKeyImportTest.cc
  22. +36
    -18
      test/src/KeyAttachmentTest.cc
  23. +26
    -16
      test/src/KeyResetMessageTest.cc
  24. +2
    -2
      test/src/LeastColorGroupTest.cc
  25. +3
    -4
      test/src/LeastCommonDenomColorTest.cc
  26. +4
    -2
      test/src/MessageNullFromTest.cc
  27. +2
    -2
      test/src/MessageTwoPointOhTest.cc
  28. +4
    -2
      test/src/NoOwnIdentWritesOnDecryptTest.cc
  29. +5
    -5
      test/src/OldMessageApiTest.cc
  30. +12
    -6
      test/src/PassphraseTest.cc
  31. +26
    -13
      test/src/PepSubjectReceivedTest.cc
  32. +4
    -6
      test/src/ReceiverRatingTest.cc
  33. +33
    -24
      test/src/ReencryptPlusExtraKeysTest.cc
  34. +2
    -1
      test/src/SenderFPRTest.cc
  35. +2
    -6
      test/src/TestUtilities.cc
  36. +2
    -1
      test/src/URIAddressTest.cc
  37. +2
    -1
      test/src/UnencryptedPepMailTest.cc
  38. +2
    -2
      test/src/VerifyTest.cc

+ 1
- 1
src/keymanagement.c View File

@ -1020,7 +1020,7 @@ PEP_STATUS _myself(PEP_SESSION session,
// this leads to crashes otherwise
if (EMPTYSTR(identity->user_id)) {
if (!(identity->user_id && identity->user_id[0])) {
free(identity->user_id);
identity->user_id = strdup(PEP_OWN_USERID);
assert(identity->user_id);


+ 0
- 4
src/message.c View File

@ -197,8 +197,6 @@ DYNAMIC_API message * message_dup(const message *src)
msg->enc_format = src->enc_format;
msg->rating = src->rating;
return msg;
enomem:
@ -211,13 +209,11 @@ DYNAMIC_API void message_transfer(message* dst, message *src)
assert(dst);
assert(src);
/* Scalars */
dst->dir = src->dir;
dst->rawmsg_ref = src->rawmsg_ref;
dst->rawmsg_size = src->rawmsg_size;
dst->refering_msg_ref = src->refering_msg_ref;
dst->enc_format = src->enc_format;
dst->rating = src->rating;
/* Strings */
free(dst->id);


+ 0
- 1
src/message.h View File

@ -87,7 +87,6 @@ typedef struct _message {
char* _sender_fpr; // INTERNAL USE ONLY - fingerprint of
// sending signer.
// (read_only to the outside)
PEP_rating rating; // message rating
} message;
/**


+ 13
- 49
src/message_api.c View File

@ -24,8 +24,6 @@
#include "group.h"
#include "group_internal.h"
#include "status_to_string.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
@ -110,8 +108,6 @@ static char * keylist_to_string(const stringlist_t *keylist)
static const char * rating_to_string(PEP_rating rating)
{
switch (rating) {
case PEP_rating_undefined:
return "undefined";
case PEP_rating_cannot_decrypt:
return "cannot_decrypt";
case PEP_rating_have_no_key:
@ -135,7 +131,7 @@ static const char * rating_to_string(PEP_rating rating)
case PEP_rating_under_attack:
return "under_attack";
default:
assert(0);
return "undefined";
}
}
@ -408,8 +404,6 @@ void decorate_message(
replace_opt_field(msg, "X-KeyList", _keylist, clobber);
free(_keylist);
}
msg->rating = rating;
}
/**
@ -2688,9 +2682,6 @@ DYNAMIC_API PEP_STATUS encrypt_message(
if (src->dir == PEP_dir_incoming)
return PEP_ILLEGAL_VALUE;
// Reset the message rating before doing anything...
src->rating = PEP_rating_undefined;
determine_encryption_format(src);
// TODO: change this for multi-encryption in message format 2.0
if (src->enc_format != PEP_enc_none)
@ -2953,16 +2944,7 @@ DYNAMIC_API PEP_STATUS encrypt_message(
}
if (msg) {
/* Obtain the message rating... */
PEP_rating rating;
status = sent_message_rating(session, msg, & rating);
if (status == PEP_OUT_OF_MEMORY)
goto enomem;
else if (status != PEP_STATUS_OK)
goto pEp_error;
/* ...And store it into the message along with the other decorations. */
decorate_message(session, msg, rating, NULL, true, true);
decorate_message(session, msg, PEP_rating_undefined, NULL, true, true);
if (_src->id) {
msg->id = strdup(_src->id);
assert(msg->id);
@ -5008,9 +4990,7 @@ static const char* process_key_claim(message* src,
// There are times when we don't want errors during calls to be fatal. Once any action is taken on that
// status, if we are going to continue processing and not bail from the message, the status needs to be reset
// to PEP_STATUS_OK, or, alternately, we need to be using a temp status variable.
//
// This internal function does *not* set the rating field of the message: that
// part of the job is within decrypt_message.
static PEP_STATUS _decrypt_message(
PEP_SESSION session,
message *src,
@ -6284,6 +6264,7 @@ DYNAMIC_API PEP_STATUS decrypt_message(
message *src,
message **dst,
stringlist_t **keylist,
PEP_rating *rating,
PEP_decrypt_flags_t *flags
)
{
@ -6291,32 +6272,24 @@ DYNAMIC_API PEP_STATUS decrypt_message(
assert(src);
assert(dst);
assert(keylist);
assert(rating);
assert(flags);
if (!(session && src && dst && keylist && flags))
if (!(session && src && dst && keylist && rating && flags))
return PEP_ILLEGAL_VALUE;
if (!(*flags & PEP_decrypt_flag_untrusted_server))
*keylist = NULL;
// Reset the message rating before doing anything. We will compute a new
// value, that _decrypt_message sets as an output parameter.
src->rating = PEP_rating_undefined;
PEP_rating rating = PEP_rating_undefined;
stringlist_t* imported_key_fprs = NULL;
uint64_t changed_key_bitvec = 0;
PEP_STATUS status = _decrypt_message(session, src, dst, keylist,
&rating, flags, NULL,
rating, flags, NULL,
&imported_key_fprs, &changed_key_bitvec);
message *msg = *dst ? *dst : src;
/* Set the rating field of the message. Notice that even in case of non-ok
result status the value of this field may be meaningful. */
msg->rating = rating;
// Ok, now we check to see if it was an administrative message. We do this by testing base_extract for success
// with protocol families.
if (msg && msg->from) {
@ -6330,10 +6303,10 @@ DYNAMIC_API PEP_STATUS decrypt_message(
tmp_status = base_extract_message(session, msg, BASE_SYNC, &size, &data, &sender_fpr);
if (!tmp_status && size && data) {
if (sender_fpr)
signal_Sync_message(session, rating, data, size, msg->from, sender_fpr);
signal_Sync_message(session, *rating, data, size, msg->from, sender_fpr);
// FIXME: this must be changed to sender_fpr
else if (*keylist)
signal_Sync_message(session, rating, data, size, msg->from, (*keylist)->value);
signal_Sync_message(session, *rating, data, size, msg->from, (*keylist)->value);
}
}
if (tmp_status != PEP_STATUS_OK) {
@ -6351,7 +6324,7 @@ DYNAMIC_API PEP_STATUS decrypt_message(
PEP_STATUS tmpstatus = base_extract_message(session, msg, BASE_DISTRIBUTION, &size, &data,
&sender_fpr);
if (!tmpstatus && size && data) {
process_Distribution_message(session, msg, rating, data, size, sender_fpr);
process_Distribution_message(session, msg, *rating, data, size, sender_fpr);
}
}
}
@ -6379,7 +6352,7 @@ DYNAMIC_API PEP_STATUS decrypt_message(
// // if ((!event_sender_fpr) && *keylist)
// // event_sender_fpr = (*keylist)->value;
// if (event_sender_fpr)
// signal_Sync_message(session, rating, data, size, msg->from, event_sender_fpr);
// signal_Sync_message(session, *rating, data, size, msg->from, event_sender_fpr);
// }
// free(sender_fpr);
// }
@ -6507,16 +6480,6 @@ static void _max_comm_type_from_identity_list_preview(
}
}
DYNAMIC_API PEP_STATUS sent_message_rating(
PEP_SESSION session,
message *msg,
PEP_rating *rating
)
{
// FIXME: this is a stub. See ENGINE-847.
return outgoing_message_rating (session, msg, rating);
}
DYNAMIC_API PEP_STATUS outgoing_message_rating(
PEP_SESSION session,
message *msg,
@ -6984,8 +6947,9 @@ DYNAMIC_API PEP_STATUS get_message_trustwords(
// Message is to be decrypted
message *dst = NULL;
stringlist_t *_keylist = keylist;
PEP_rating rating;
PEP_decrypt_flags_t flags;
status = decrypt_message( session, msg, &dst, &_keylist, &flags);
status = decrypt_message( session, msg, &dst, &_keylist, &rating, &flags);
if (status != PEP_STATUS_OK) {
free_message(dst);


+ 39
- 34
src/message_api.h View File

@ -70,11 +70,9 @@ typedef enum _message_wrap_type {
* @brief Encrypt message in memory
*
* @param[in] session session handle
* @param[in,out] src message to encrypt - usually in-only except for
* the rating field, but can be in-out for
* unencrypted messages; in that case, we may
* attach the key and decorate the message.
* In any case, reset the rating.
* @param[in,out] src message to encrypt - usually in-only, but can be
* in-out for unencrypted messages; in that case,
* we may attach the key and decorate the message
* @param[in] extra extra keys for encryption
* @param[out] dst pointer to new encrypted message or NULL if no
* encryption could take place
@ -195,6 +193,39 @@ DYNAMIC_API PEP_STATUS encrypt_message_for_self(
PEP_encrypt_flags_t flags
);
/**
* @enum PEP_rating
*
* @brief TODO
*
*/
typedef enum _PEP_rating {
PEP_rating_undefined = 0,
// no color
PEP_rating_cannot_decrypt = 1,
PEP_rating_have_no_key = 2,
PEP_rating_unencrypted = 3,
PEP_rating_unreliable = 5,
PEP_rating_b0rken = -2,
// yellow
PEP_rating_reliable = 6,
// green
PEP_rating_trusted = 7,
PEP_rating_trusted_and_anonymized = 8,
PEP_rating_fully_anonymous = 9,
// red
PEP_rating_mistrust = -1,
PEP_rating_under_attack = -3
} PEP_rating;
/**
* @enum PEP_color
@ -247,9 +278,7 @@ typedef unsigned int PEP_decrypt_flags_t;
* @brief Decrypt message in memory
*
* @param[in] session session handle
* @param[in,out] src message to decrypt - see warning about identities below.
* the rating field of src (instead of dst) is updated
* in case encryption fails.
* @param[in,out] src message to decrypt - see warning about identities below
* @param[out] dst pointer to new decrypted message or NULL on failure
* @param[in,out] keylist in: stringlist with additional keyids for reencryption if needed
* (will be freed and replaced with output keylist)
@ -257,6 +286,7 @@ typedef unsigned int PEP_decrypt_flags_t;
* first key is signer, additional keys are the ones it was encrypted
* to. Only signer and whichever of the user's keys was used are
* reliable
* @param[out] rating rating for the message
* @param[in,out] flags flags to signal special decryption features
*
* @retval <ERROR> any error status
@ -320,6 +350,7 @@ DYNAMIC_API PEP_STATUS decrypt_message(
message *src,
message **dst,
stringlist_t **keylist,
PEP_rating *rating,
PEP_decrypt_flags_t *flags
);
@ -353,32 +384,6 @@ DYNAMIC_API PEP_STATUS own_message_private_key_details(
);
/**
* <!-- sent_message_rating() -->
*
* @brief Get rating for a sent message
*
* @param[in] session session handle
* @param[in] msg message to get the rating for
* @param[out] rating rating for the message
*
*
* @retval PEP_STATUS_OK
* @retval PEP_ILLEGAL_VALUE illegal parameter values
*
* @warning msg->from must point to a valid pEp_identity
* msg->dir must be PEP_dir_outgoing
* the ownership of msg remains with the caller
*
*/
DYNAMIC_API PEP_STATUS sent_message_rating(
PEP_SESSION session,
message *msg,
PEP_rating *rating
);
// FIXME: the current implementation is a stub, until ENGINE-847 is ready.
/**
* <!-- outgoing_message_rating() -->
*


+ 0
- 34
src/pEpEngine.h View File

@ -214,40 +214,6 @@ typedef enum _PEP_enc_format {
PEP_enc_auto = 255 // figure out automatically where possible
} PEP_enc_format;
/**
* @enum PEP_rating
*
* @brief TODO
*
*/
typedef enum _PEP_rating {
PEP_rating_undefined = 0,
// no color
PEP_rating_cannot_decrypt = 1,
PEP_rating_have_no_key = 2,
PEP_rating_unencrypted = 3,
PEP_rating_unreliable = 5,
PEP_rating_b0rken = -2,
// yellow
PEP_rating_reliable = 6,
// green
PEP_rating_trusted = 7,
PEP_rating_trusted_and_anonymized = 8,
PEP_rating_fully_anonymous = 9,
// red
PEP_rating_mistrust = -1,
PEP_rating_under_attack = -3
} PEP_rating;
/**
* <!-- messageToSend() -->


+ 5
- 4
test/src/AppleMailTest.cc View File

@ -120,6 +120,7 @@ TEST_F(AppleMailTest, check_apple_mail_text_signed_encrypted) {
message* msg_ptr = nullptr;
message* dest_msg = nullptr;
stringlist_t* keylist = nullptr;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* final_ptr = nullptr;
@ -132,14 +133,14 @@ TEST_F(AppleMailTest, check_apple_mail_text_signed_encrypted) {
final_ptr = msg_ptr;
status = decrypt_message(session, msg_ptr, &dest_msg, &keylist, &flags);
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(color_from_rating(rating) , PEP_color_green);
if (final_ptr == dest_msg)
free_message(dest_msg);
@ -193,14 +194,14 @@ 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(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(color_from_rating(rating) , PEP_color_green);
if (final_ptr == dest_msg)
free_message(dest_msg);


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

@ -163,9 +163,10 @@ TEST_F(AsciiBinary998Test, check_engine_895) {
message* dec_msg = NULL;
enc_msg->dir = PEP_dir_incoming;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
ASSERT_EQ(memcmp(data_copy, dec_msg->attachments->value, data_size), 0);


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

@ -117,6 +117,7 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
char* decrypted_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
@ -124,7 +125,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(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_EQ(status, PEP_DECRYPTED); // ???
ok = slurp_and_import_key(session, "test_keys/pub/inquisitor-0xA4728718_renewed_pub.asc");
@ -139,7 +140,6 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
msg2->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
// We don't keep OpenPGP expired keys. We'll have to receive the new one via mail.
PEP_rating rating;
status = outgoing_message_rating(session, msg2, &rating);
ASSERT_OK;
ASSERT_EQ(rating, PEP_rating_reliable);
@ -182,6 +182,7 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
char* decrypted_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
@ -189,7 +190,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(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_EQ(status, PEP_DECRYPTED); // ???
ok = slurp_and_import_key(session, "test_keys/pub/inquisitor-0xA4728718_renewed_pub.asc");
@ -204,7 +205,6 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
msg2->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
// We don't keep OpenPGP expired keys. We'll have to receive the new one via mail.
PEP_rating rating;
status = outgoing_message_rating(session, msg2, &rating);
ASSERT_OK;
ASSERT_EQ(rating, PEP_rating_reliable);
@ -273,6 +273,7 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
stringlist_t* keylist = NULL;
// char* modified_src = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
@ -280,7 +281,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(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_EQ(status, PEP_DECRYPTED); // ???
ok = slurp_and_import_key(session, "test_keys/pub/inquisitor-0xA4728718_renewed_pub.asc");
@ -304,7 +305,6 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
msg2->longmsg = strdup("Blahblahblah!");
msg2->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
PEP_rating rating;
status = outgoing_message_rating(session, msg2, &rating);
ASSERT_OK;
ASSERT_EQ(rating, PEP_rating_trusted);
@ -347,6 +347,7 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
char* decrypted_msg = NULL;
stringlist_t* keylist = nullptr;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
@ -354,7 +355,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(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_EQ(status, PEP_DECRYPTED);
ok = slurp_and_import_key(session, "test_keys/pub/inquisitor-0xA4728718_renewed_pub.asc");
@ -369,7 +370,6 @@ TEST_F(CheckRenewedExpiredKeyTrustStatusTest, check_renewed_expired_key_trust_st
msg2->longmsg = strdup("Blahblahblah!");
msg2->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
PEP_rating rating;
status = outgoing_message_rating(session, msg2, &rating);
ASSERT_OK;
ASSERT_EQ(rating , PEP_rating_reliable);


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

@ -156,6 +156,7 @@ TEST_F(DecryptAttachPrivateKeyTrustedTest, check_decrypt_attach_private_key_trus
output_stream << "decrypt with attached private key: Same address, same user_id, trusted" << endl;
message* decrypted_text = NULL;
stringlist_t* keylist_used = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
output_stream << "Trusting own key for " << same_addr_same_uid->user_id << " and " << same_addr_same_uid->fpr << endl;
@ -171,7 +172,7 @@ TEST_F(DecryptAttachPrivateKeyTrustedTest, check_decrypt_attach_private_key_trus
flags = 0;
status = decrypt_message(session, encoded_text, &decrypted_text,
&keylist_used, &flags);
&keylist_used, &rating, &flags);
status = get_trust(session, same_addr_same_uid);
ASSERT_EQ(same_addr_same_uid->comm_type, PEP_ct_pEp);
@ -179,7 +180,7 @@ TEST_F(DecryptAttachPrivateKeyTrustedTest, check_decrypt_attach_private_key_trus
flags = 0;
status = decrypt_message(session, encoded_text, &decrypted_text,
&keylist_used, &flags);
&keylist_used, &rating, &flags);
output_stream << "Status: " << tl_status_string(status) << endl;
ASSERT_EQ(status, PEP_STATUS_OK);


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

@ -163,6 +163,7 @@ TEST_F(DecryptAttachPrivateKeyUntrustedTest, check_decrypt_attach_private_key_un
output_stream << "Same address, same user_id, untrusted" << endl;
message* decrypted_text = NULL;
stringlist_t* keylist_used = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = get_trust(session, same_addr_same_uid);
@ -177,7 +178,7 @@ TEST_F(DecryptAttachPrivateKeyUntrustedTest, check_decrypt_attach_private_key_un
flags = 0;
status = decrypt_message(session, encoded_text, &decrypted_text,
&keylist_used, &flags);
&keylist_used, &rating, &flags);
status = get_trust(session, same_addr_same_uid);
ASSERT_EQ(same_addr_same_uid->comm_type, PEP_ct_pEp_unconfirmed);


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

@ -268,9 +268,10 @@ TEST_F(ElevatedAttachmentsTest, check_encrypt_decrypt_message) {
message *dec_msg = NULL;
stringlist_t *keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message(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);
@ -403,9 +404,10 @@ TEST_F(ElevatedAttachmentsTest, check_encrypt_decrypt_message_elevated) {
message *dec_msg = NULL;
stringlist_t *keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, art_msg, &dec_msg, &keylist, &flags);
status = decrypt_message(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


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

@ -175,12 +175,12 @@ TEST_F(EncryptForIdentityTest, check_encrypt_for_identity) {
message* decrypted_msg = nullptr;
stringlist_t* keylist_used = nullptr;
PEP_rating rating;
PEP_decrypt_flags_t flags;
flags = 0;
status = decrypt_message(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
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_NE(rating, 0);
ASSERT_TRUE(status == PEP_DECRYPTED && rating == PEP_rating_unreliable);
@ -226,9 +226,8 @@ 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(session, encrypted_msg, &decrypted_msg, &keylist_used, &rating, &flags);
ASSERT_NOTNULL(decrypted_msg);
rating = decrypted_msg->rating;
ASSERT_NOTNULL(keylist_used);
ASSERT_NE(rating, 0);
ASSERT_TRUE(status == PEP_DECRYPTED && rating == PEP_rating_unreliable);
@ -312,12 +311,12 @@ TEST_F(EncryptForIdentityTest, check_encrypt_for_identity) {
free_stringlist(keylist_used);
keylist_used = nullptr;
PEP_decrypt_flags_t mimeflags;
PEP_rating mimerating;
mimeflags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist_used, &mimeflags);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist_used, &mimerating, &mimeflags);
ASSERT_NOTNULL(dec_msg);
PEP_rating mimerating = dec_msg->rating;
ASSERT_NOTNULL(keylist_used);
ASSERT_NE(mimerating, 0);
@ -435,12 +434,12 @@ TEST_F(EncryptForIdentityTest, check_encrypt_for_identity_with_URI) {
message* decrypted_msg = nullptr;
stringlist_t* keylist_used = nullptr;
PEP_rating rating;
PEP_decrypt_flags_t flags;
flags = 0;
status = decrypt_message(session, encrypted_msg, &decrypted_msg, &keylist_used, &flags);
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_NE(rating, 0);
ASSERT_TRUE(status == PEP_DECRYPTED && rating == PEP_rating_unreliable);
@ -486,9 +485,8 @@ 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(session, encrypted_msg, &decrypted_msg, &keylist_used, &rating, &flags);
ASSERT_NOTNULL(decrypted_msg);
rating = decrypted_msg->rating;
ASSERT_NOTNULL(keylist_used);
ASSERT_NE(rating, 0);
ASSERT_TRUE(status == PEP_DECRYPTED && rating == PEP_rating_unreliable);


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

@ -99,9 +99,10 @@ TEST_F(Engine463Test, check_engine_463_no_own_key) {
message* decrypted_msg = NULL;
stringlist_t* keylist_used = nullptr;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &rating, &flags);
ASSERT_OK;
}
@ -125,9 +126,10 @@ TEST_F(Engine463Test, check_engine_463_sender_expired_and_renewed) {
message* decrypted_msg = NULL;
stringlist_t* keylist_used = nullptr;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &rating, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
free(decrypted_msg);
@ -137,17 +139,15 @@ TEST_F(Engine463Test, check_engine_463_sender_expired_and_renewed) {
pEp_identity* expired_inquisitor = new_identity("inquisitor@darthmama.org", NULL, NULL, "Lady Claire Trevelyan");
PEP_rating rating;
status = identity_rating(session, expired_inquisitor, &rating);
ASSERT_OK;
ASSERT_EQ(rating , PEP_rating_reliable);
flags = 0;
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &rating, &flags);
ASSERT_NOTNULL(decrypted_msg);
ASSERT_OK;
rating = decrypted_msg->rating;
ASSERT_EQ(rating , PEP_rating_reliable);
free_identity(expired_inquisitor);
@ -180,9 +180,10 @@ TEST_F(Engine463Test, check_engine_463_sender_expired_and_renewed) {
message* decrypted_msg = NULL;
stringlist_t* keylist_used = nullptr;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &flags);
status = decrypt_message(session, msg, &decrypted_msg, &keylist_used, &rating, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
free(decrypted_msg);
@ -199,7 +200,6 @@ TEST_F(Engine463Test, check_engine_463_sender_expired_and_renewed) {
msg2->longmsg = strdup("Blahblahblah!");
msg2->attachments = new_bloblist(NULL, 0, "application/octet-stream", NULL);
PEP_rating rating;
status = outgoing_message_rating(session, msg2, &rating);
ASSERT_OK;
ASSERT_EQ(rating , PEP_rating_reliable);


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

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


+ 2
- 1
test/src/Engine619Test.cc View File

@ -439,10 +439,11 @@ TEST_F(Engine619Test, decrypt_message_with_private_key) {
message *message_dst;
stringlist_t* keys = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, message_src, & message_dst,
& keys, & flags);
& keys, & rating, & 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
pgp_import_keydata , which used to corrut the heap (ENGINE-619). */


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

@ -143,8 +143,9 @@ TEST_F(Engine655Test, check_engine655) {
//
keylist = NULL;
message* dec_msg = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &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);


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

@ -128,9 +128,10 @@ TEST_F(Engine704Test, check_engine704) {
message* dec_msg = NULL;
enc_msg->dir = PEP_dir_incoming;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_STREQ(dec_msg->from->username, alicename);
ASSERT_STREQ(dec_msg->to->ident->username, bobname);
}

+ 3
- 4
test/src/ExternalRevokeTest.cc View File

@ -196,6 +196,7 @@ TEST_F(ExternalRevokeTest, check_external_revoke) {
outgoing_msg = NULL;
stringlist_t* keylist = nullptr;
PEP_rating rating;
PEP_decrypt_flags_t flags;
output_stream << endl << "---------------------------------------------------------" << endl;
@ -204,10 +205,9 @@ 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(session, encrypted_outgoing_msg, &outgoing_msg, &keylist, &rating, &flags);
output_stream << "Decrypted message with status " << tl_status_string(status) << endl;
ASSERT_OK;
PEP_rating rating = outgoing_msg->rating;
ASSERT_EQ(rating , PEP_rating_trusted);
// check rating
@ -384,11 +384,10 @@ TEST_F(ExternalRevokeTest, check_external_revoke) {
flags = 0;
status = decrypt_message(session, encrypted_outgoing_msg, &decrypted_msg, &keylist, &flags);
status = decrypt_message(session, encrypted_outgoing_msg, &decrypted_msg, &keylist, &rating, &flags);
output_stream << "Decryption returns with status " << tl_status_string(status) << endl;
ASSERT_EQ(status, PEP_STATUS_OK);
ASSERT_NOTNULL(decrypted_msg);
rating = decrypted_msg->rating;
// check rating
output_stream << "Rating of decrypted message to trusted recip: " << tl_rating_string(rating) << endl;


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

@ -1030,9 +1030,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_create_receive_member_1) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1121,9 +1122,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_create_receive_member_2) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1185,9 +1187,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_create_receive_member_3) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1249,9 +1252,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_create_receive_member_4) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1482,9 +1486,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_1) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -1555,9 +1560,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_2) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -1614,9 +1620,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_3) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -1673,9 +1680,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_4) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -1769,9 +1777,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_receive) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// Ok, so that worked.
@ -1868,8 +1877,9 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_send) {
mime_decode_message(msg_str.c_str(), msg_str.size(), &msg, NULL);
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// Member 1
@ -1881,8 +1891,9 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_send) {
dec_msg = NULL;
free_stringlist(keylist);
keylist = NULL;
rating = PEP_rating_undefined;
flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// Member 2
@ -1894,8 +1905,9 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_send) {
dec_msg = NULL;
free_stringlist(keylist);
keylist = NULL;
rating = PEP_rating_undefined;
flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(msg);
@ -2059,8 +2071,9 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_receive) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
@ -2098,7 +2111,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(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
status = retrieve_own_membership_info_for_group_and_identity(session, group, me);
@ -2169,9 +2182,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_join_member_unknown) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// Now make sure we didn't do anything with the message
@ -2220,7 +2234,8 @@ 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);
PEP_rating rating;
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
pEp_identity* group_identity = new_identity(group_1_address, NULL, own_id, NULL);
@ -2602,9 +2617,10 @@ TEST_F(GroupEncryptionTest, check_protocol_group_dissolve_not_manager) {
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(msg);
@ -2620,7 +2636,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(session, msg, &dec_msg, &keylist, &rating, &flags);
free_message(msg);
ASSERT_OK;
free_message(dec_msg);
@ -2646,7 +2662,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(session, msg, &dec_msg, &keylist, &rating, &flags);
free_message(msg);
free_message(dec_msg);
ASSERT_OK;
@ -3084,14 +3100,15 @@ TEST_F(GroupEncryptionTest, check_protocol_group_key_reset_two_recents) {
ASSERT_NE(message_2, nullptr);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_1, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_2, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
@ -3183,12 +3200,13 @@ TEST_F(GroupEncryptionTest, check_group_key_reset_receive_member_2) {
message* enc_msg = NULL;
message* dec_msg = NULL;
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
enc_msg = string_to_msg(invite);
ASSERT_NE(enc_msg, nullptr);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
pEp_identity* group_ident = new_identity(group_1_address, NULL, "MEMBER2", group_1_name);
@ -3207,7 +3225,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(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
bool is_revoked;
@ -3244,10 +3262,11 @@ TEST_F(GroupEncryptionTest, check_group_key_reset_receive_partner_1) {
message* enc_msg = string_to_msg(slurp(string("test_mails/group_key_reset_mixed_output_to_partner_public_") + manager_2_address + ".eml"));
ASSERT_NE(enc_msg, nullptr);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// FIXME: reinstate this when key election removal is in - fails due to delete_keypair
@ -3286,10 +3305,11 @@ TEST_F(GroupEncryptionTest, check_group_key_reset_receive_partner_2) {
message* enc_msg = string_to_msg(slurp(string("test_mails/group_key_reset_mixed_output_to_partner_public_") + me->address + ".eml"));
ASSERT_NE(enc_msg, nullptr);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
// FIXME: reinstate this when key election removal is in - fails due to delete_keypair
@ -3428,14 +3448,15 @@ TEST_F(GroupEncryptionTest, check_protocol_group_key_reset_two_recents_two_missi
ASSERT_NE(message_2, nullptr);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_1, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_2, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
@ -3597,10 +3618,11 @@ TEST_F(GroupEncryptionTest, check_protocol_group_key_reset_one_recent_all_missin
ASSERT_NE(message_1, nullptr);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_1, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
free_message(message_1);
@ -3849,14 +3871,15 @@ TEST_F(GroupEncryptionTest, check_protocol_remove_member_from_group_two_recents)
ASSERT_NE(message_2, nullptr);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_1, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_2, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
@ -4057,14 +4080,15 @@ TEST_F(GroupEncryptionTest, check_protocol_remove_member_not_joined_from_group_t
ASSERT_NE(message_2, nullptr);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_1, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_2, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
@ -4264,14 +4288,15 @@ TEST_F(GroupEncryptionTest, check_protocol_remove_unknown_member_from_group_two_
ASSERT_NE(message_2, nullptr);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
message* dec_msg = NULL;
status = decrypt_message(session, message_1, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_1, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;
status = decrypt_message(session, message_2, &dec_msg, &keylist, &flags);
status = decrypt_message(session, message_2, &dec_msg, &keylist, &rating, &flags);
ASSERT_OK;
free_message(dec_msg);
dec_msg = NULL;


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

@ -726,14 +726,14 @@ TEST_F(HeaderKeyImportTest, check_header_key_import) {
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags;
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(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_EQ(rating , PEP_rating_reliable);
ASSERT_OK;
PEP_rating rating = dec_msg->rating;
ASSERT_EQ(rating, PEP_rating_reliable);
pEp_identity* alice_check = new_identity("pep.test.alice@pep-project.org", NULL, NULL, "pEp Test Alice");
status = update_identity(session, alice_check);


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

@ -105,8 +105,9 @@ TEST_F(KeyAttachmentTest, check_key_attach_inline) {
ASSERT_OK;
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
#if KEYS_STAY_ATTACHED
ASSERT_NOTNULL(dec_msg->attachments );
@ -131,8 +132,9 @@ TEST_F(KeyAttachmentTest, check_key_plus_encr_att_inline) {
ASSERT_OK;
ASSERT_NOTNULL(enc_msg);
stringlist_t* keylist = NULL;
PEP_rating rating;
PEP_decrypt_flags_t flags = 0;
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &flags);
status = decrypt_message(session, enc_msg, &dec_msg, &keylist, &rating, &flags);
ASSERT_EQ(status , PEP_DECRYPTED);
ASSERT_NOTNULL(dec_msg);
#if KEYS_STAY_ATTACHED
@ -165,8 +167,9 @@ TEST_F(KeyAttachmentTest, check_encr_att_plus_key_inline) {
ASSERT_OK;