aboutsummaryrefslogtreecommitdiff
path: root/tests/test_olm.cpp
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-07-10 11:57:53 +0100
committerMark Haines <mark.haines@matrix.org>2015-07-10 11:57:53 +0100
commitb6e248c9a58cccbcd5dea7bdc8e3cdee4af03722 (patch)
tree0924e69d210b7d6878c7fb11f68b942b15f3ca6c /tests/test_olm.cpp
parent373acefde7be92f86b8294b325519ad916b1e054 (diff)
Output simpler JSON for the account keys, don't sign the JSON but instead provide a olm_account_sign method so that the user of the library can sign the JSON themselves
Diffstat (limited to 'tests/test_olm.cpp')
-rw-r--r--tests/test_olm.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/test_olm.cpp b/tests/test_olm.cpp
index 8545e59..ccd023f 100644
--- a/tests/test_olm.cpp
+++ b/tests/test_olm.cpp
@@ -86,11 +86,9 @@ std::uint8_t o_random[::olm_account_generate_one_time_keys_random_length(
mock_random_b(o_random, sizeof(o_random));
::olm_account_generate_one_time_keys(b_account, 42, o_random, sizeof(o_random));
-std::uint8_t b_id_keys[::olm_account_identity_keys_length(b_account, 0, 0, 0, 0)];
+std::uint8_t b_id_keys[::olm_account_identity_keys_length(b_account)];
std::uint8_t b_ot_keys[::olm_account_one_time_keys_length(b_account)];
-::olm_account_identity_keys(
- b_account, nullptr, 0, nullptr, 0, 0, 0, b_id_keys, sizeof(b_id_keys)
-);
+::olm_account_identity_keys(b_account, b_id_keys, sizeof(b_id_keys));
::olm_account_one_time_keys(b_account, b_ot_keys, sizeof(b_ot_keys));
std::uint8_t a_session_buffer[::olm_session_size()];
@@ -99,8 +97,8 @@ std::uint8_t a_rand[::olm_create_outbound_session_random_length(a_session)];
mock_random_a(a_rand, sizeof(a_rand));
assert_not_equals(std::size_t(-1), ::olm_create_outbound_session(
a_session, a_account,
- b_id_keys + 88, 43,
- b_ot_keys + 22, 43,
+ b_id_keys + 15, 43,
+ b_ot_keys + 25, 43,
a_rand, sizeof(a_rand)
));
@@ -195,11 +193,9 @@ std::uint8_t o_random[::olm_account_generate_one_time_keys_random_length(
mock_random_b(o_random, sizeof(o_random));
::olm_account_generate_one_time_keys(b_account, 42, o_random, sizeof(o_random));
-std::uint8_t b_id_keys[::olm_account_identity_keys_length(b_account, 0, 0, 0, 0)];
+std::uint8_t b_id_keys[::olm_account_identity_keys_length(b_account)];
std::uint8_t b_ot_keys[::olm_account_one_time_keys_length(b_account)];
-::olm_account_identity_keys(
- b_account, nullptr, 0, nullptr, 0, 0, 0, b_id_keys, sizeof(b_id_keys)
-);
+::olm_account_identity_keys(b_account, b_id_keys, sizeof(b_id_keys));
::olm_account_one_time_keys(b_account, b_ot_keys, sizeof(b_ot_keys));
std::uint8_t a_session_buffer[::olm_session_size()];
@@ -208,8 +204,8 @@ std::uint8_t a_rand[::olm_create_outbound_session_random_length(a_session)];
mock_random_a(a_rand, sizeof(a_rand));
assert_not_equals(std::size_t(-1), ::olm_create_outbound_session(
a_session, a_account,
- b_id_keys + 88, 43,
- b_ot_keys + 22, 43,
+ b_id_keys + 15, 43,
+ b_ot_keys + 25, 43,
a_rand, sizeof(a_rand)
));