diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2020-08-14 17:29:25 -0400 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2020-08-14 17:29:41 -0400 |
commit | 171044f3fca084bd1c5c1f8f4bfe146434b07f0b (patch) | |
tree | e0d81cc51b02e46bfae638203744f846ec41e380 /src/olm.cpp | |
parent | a0284c2ba36ac8433ea752e93b4a0a331a3f0c0b (diff) |
add support for fallback keys
Diffstat (limited to 'src/olm.cpp')
-rw-r--r-- | src/olm.cpp | 36 |
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 ) { |