aboutsummaryrefslogtreecommitdiff
path: root/src/olm.cpp
diff options
context:
space:
mode:
authorHubert Chathi <hubertc@matrix.org>2020-09-17 21:42:25 +0000
committerHubert Chathi <hubertc@matrix.org>2020-09-17 21:42:25 +0000
commit3cd6b15853923fff512138ebb5e8ba390cfb38e2 (patch)
tree6830d4d13f7c1106f8e4e772e16f9204d523fcd5 /src/olm.cpp
parent89050dc0b68f0d5f1bf9f9f386f7c2f4ac043f4f (diff)
parentc47c6ca3992c74489700cda44443ec29c3cb3b13 (diff)
Merge branch 'uhoreg/fallback' into 'master'
add support for fallback keys See merge request matrix-org/olm!13
Diffstat (limited to 'src/olm.cpp')
-rw-r--r--src/olm.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/olm.cpp b/src/olm.cpp
index 0333b10..50742cc 100644
--- a/src/olm.cpp
+++ b/src/olm.cpp
@@ -417,6 +417,42 @@ size_t olm_account_generate_one_time_keys(
}
+size_t olm_account_generate_fallback_key_random_length(
+ OlmAccount * account
+) {
+ return from_c(account)->generate_fallback_key_random_length();
+}
+
+
+size_t olm_account_generate_fallback_key(
+ OlmAccount * account,
+ void * random, size_t random_length
+) {
+ size_t result = from_c(account)->generate_fallback_key(
+ from_c(random), random_length
+ );
+ olm::unset(random, random_length);
+ return result;
+}
+
+
+size_t olm_account_fallback_key_length(
+ OlmAccount * account
+) {
+ return from_c(account)->get_fallback_key_json_length();
+}
+
+
+size_t olm_account_fallback_key(
+ OlmAccount * account,
+ void * fallback_key_json, size_t fallback_key_json_length
+) {
+ return from_c(account)->get_fallback_key_json(
+ from_c(fallback_key_json), fallback_key_json_length
+ );
+}
+
+
size_t olm_create_outbound_session_random_length(
OlmSession * session
) {