|
@ -12,21 +12,17 @@ using namespace pEp; |
|
|
using namespace pEp::Adapter; |
|
|
using namespace pEp::Adapter; |
|
|
using namespace std; |
|
|
using namespace std; |
|
|
|
|
|
|
|
|
vector<string> expected_msg = { |
|
|
vector<string> expected_msg = { "synchronizeGroupKeys", |
|
|
"synchronizeGroupKeys", |
|
|
|
|
|
"groupKeysUpdate", |
|
|
"groupKeysUpdate", |
|
|
"initUnledGroupKeyReset", |
|
|
"initUnledGroupKeyReset", |
|
|
"beacon", |
|
|
"beacon", |
|
|
"beacon" |
|
|
"beacon" }; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
vector<::sync_handshake_signal> expected_notification = { |
|
|
vector<::sync_handshake_signal> expected_notification = { SYNC_NOTIFY_IN_GROUP, |
|
|
SYNC_NOTIFY_IN_GROUP, |
|
|
|
|
|
SYNC_NOTIFY_START, |
|
|
SYNC_NOTIFY_START, |
|
|
SYNC_NOTIFY_SOLE, |
|
|
SYNC_NOTIFY_SOLE, |
|
|
SYNC_NOTIFY_START, |
|
|
SYNC_NOTIFY_START, |
|
|
SYNC_NOTIFY_STOP |
|
|
SYNC_NOTIFY_STOP }; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
PEP_STATUS test_messageToSend(::message* _msg) |
|
|
PEP_STATUS test_messageToSend(::message* _msg) |
|
|
{ |
|
|
{ |
|
@ -63,7 +59,8 @@ int main(int argc, char **argv) |
|
|
passphrase_cache.add("erwin"); |
|
|
passphrase_cache.add("erwin"); |
|
|
passphrase_cache.add("bob"); |
|
|
passphrase_cache.add("bob"); |
|
|
|
|
|
|
|
|
const char* bob_filename = ENGINE_TEST "/test_keys/bob-primary-with-password-bob-subkey-without.pgp"; |
|
|
const char* bob_filename = ENGINE_TEST |
|
|
|
|
|
"/test_keys/bob-primary-with-password-bob-subkey-without.pgp"; |
|
|
const char* bob_fpr = "5C76378A62B04CF3F41BEC8D4940FC9FA1878736"; |
|
|
const char* bob_fpr = "5C76378A62B04CF3F41BEC8D4940FC9FA1878736"; |
|
|
|
|
|
|
|
|
const char* erwin_filename = ENGINE_TEST "/test_keys/erwin_normal_encrypted.pgp"; |
|
|
const char* erwin_filename = ENGINE_TEST "/test_keys/erwin_normal_encrypted.pgp"; |
|
@ -72,14 +69,16 @@ int main(int argc, char **argv) |
|
|
Test::import_key_from_file(bob_filename); |
|
|
Test::import_key_from_file(bob_filename); |
|
|
Test::import_key_from_file(erwin_filename); |
|
|
Test::import_key_from_file(erwin_filename); |
|
|
|
|
|
|
|
|
Test::Identity bob = Test::make_identity(::new_identity("bob@example.org", bob_fpr, "BOB", "Bob Dog")); |
|
|
Test::Identity bob = Test::make_identity( |
|
|
|
|
|
::new_identity("bob@example.org", bob_fpr, "BOB", "Bob Dog")); |
|
|
PEP_STATUS status = ::set_own_key(session(), bob.get(), bob_fpr); |
|
|
PEP_STATUS status = ::set_own_key(session(), bob.get(), bob_fpr); |
|
|
assert(status == PEP_STATUS_OK); |
|
|
assert(status == PEP_STATUS_OK); |
|
|
|
|
|
|
|
|
status = ::enable_identity_for_sync(session(), bob.get()); |
|
|
status = ::enable_identity_for_sync(session(), bob.get()); |
|
|
assert(status == PEP_STATUS_OK); |
|
|
assert(status == PEP_STATUS_OK); |
|
|
|
|
|
|
|
|
Test::Identity erwin = Test::make_identity(::new_identity("erwin@example.org", erwin_fpr, "BOB", "Bob is Erwin")); |
|
|
Test::Identity erwin = Test::make_identity( |
|
|
|
|
|
::new_identity("erwin@example.org", erwin_fpr, "BOB", "Bob is Erwin")); |
|
|
status = ::set_own_key(session(), erwin.get(), erwin_fpr); |
|
|
status = ::set_own_key(session(), erwin.get(), erwin_fpr); |
|
|
assert(status == PEP_STATUS_OK); |
|
|
assert(status == PEP_STATUS_OK); |
|
|
|
|
|
|
|
@ -118,4 +117,3 @@ int main(int argc, char **argv) |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|