aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-07-09 18:35:54 +0100
committerMark Haines <mark.haines@matrix.org>2015-07-09 18:35:54 +0100
commit373acefde7be92f86b8294b325519ad916b1e054 (patch)
tree9d80437d0b059808eb3cd960d4517fdc59ab4731 /tests
parent5634be05074168e33b77246bbc9b60bd683759d8 (diff)
Add c bindings for the methods for managing one time keys
Diffstat (limited to 'tests')
-rw-r--r--tests/test_olm.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_olm.cpp b/tests/test_olm.cpp
index bedabf3..8545e59 100644
--- a/tests/test_olm.cpp
+++ b/tests/test_olm.cpp
@@ -41,6 +41,12 @@ std::uint8_t account_buffer[::olm_account_size()];
std::uint8_t random[::olm_create_account_random_length(account)];
mock_random(random, sizeof(random));
::olm_create_account(account, random, sizeof(random));
+std::uint8_t ot_random[::olm_account_generate_one_time_keys_random_length(
+ account, 42
+)];
+mock_random(ot_random, sizeof(ot_random));
+::olm_account_generate_one_time_keys(account, 42, ot_random, sizeof(ot_random));
+
std::size_t pickle_length = ::olm_pickle_account_length(account);
std::uint8_t pickle1[pickle_length];
::olm_pickle_account(account, "secret_key", 10, pickle1, pickle_length);
@@ -74,6 +80,11 @@ std::uint8_t b_account_buffer[::olm_account_size()];
std::uint8_t b_random[::olm_create_account_random_length(b_account)];
mock_random_b(b_random, sizeof(b_random));
::olm_create_account(b_account, b_random, sizeof(b_random));
+std::uint8_t o_random[::olm_account_generate_one_time_keys_random_length(
+ b_account, 42
+)];
+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_ot_keys[::olm_account_one_time_keys_length(b_account)];
@@ -178,6 +189,11 @@ std::uint8_t b_account_buffer[::olm_account_size()];
std::uint8_t b_random[::olm_create_account_random_length(b_account)];
mock_random_b(b_random, sizeof(b_random));
::olm_create_account(b_account, b_random, sizeof(b_random));
+std::uint8_t o_random[::olm_account_generate_one_time_keys_random_length(
+ b_account, 42
+)];
+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_ot_keys[::olm_account_one_time_keys_length(b_account)];