Commit c53d68494a
Unregistered key
Layout: unified · split
Cargo.lock +7 −94
| @@ -188,7 +188,7 @@ dependencies = [ | ||
| 188 | 188 | "objc2-core-foundation", |
| 189 | 189 | "objc2-core-graphics", |
| 190 | 190 | "objc2-foundation", |
| 191 | "parking_lot 0.12.5", | |
| 191 | "parking_lot", | |
| 192 | 192 | "percent-encoding", |
| 193 | 193 | "windows-sys 0.60.2", |
| 194 | 194 | "wl-clipboard-rs", |
| @@ -1188,7 +1188,7 @@ dependencies = [ | ||
| 1188 | 1188 | "bitflags 2.13.2", |
| 1189 | 1189 | "crossterm_winapi", |
| 1190 | 1190 | "mio", |
| 1191 | "parking_lot 0.12.5", | |
| 1191 | "parking_lot", | |
| 1192 | 1192 | "rustix 0.38.44", |
| 1193 | 1193 | "serde", |
| 1194 | 1194 | "signal-hook", |
| @@ -1207,7 +1207,7 @@ dependencies = [ | ||
| 1207 | 1207 | "derive_more 2.1.1", |
| 1208 | 1208 | "document-features", |
| 1209 | 1209 | "mio", |
| 1210 | "parking_lot 0.12.5", | |
| 1210 | "parking_lot", | |
| 1211 | 1211 | "rustix 1.1.5", |
| 1212 | 1212 | "serde", |
| 1213 | 1213 | "signal-hook", |
| @@ -2011,16 +2011,6 @@ dependencies = [ | ||
| 2011 | 2011 | "percent-encoding", |
| 2012 | 2012 | ] |
| 2013 | 2013 | |
| 2014 | [[package]] | |
| 2015 | name = "fs2" | |
| 2016 | version = "0.4.3" | |
| 2017 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2018 | checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" | |
| 2019 | dependencies = [ | |
| 2020 | "libc", | |
| 2021 | "winapi", | |
| 2022 | ] | |
| 2023 | ||
| 2024 | 2014 | [[package]] |
| 2025 | 2015 | name = "fs_extra" |
| 2026 | 2016 | version = "1.3.0" |
| @@ -2134,15 +2124,6 @@ dependencies = [ | ||
| 2134 | 2124 | "slab", |
| 2135 | 2125 | ] |
| 2136 | 2126 | |
| 2137 | [[package]] | |
| 2138 | name = "fxhash" | |
| 2139 | version = "0.2.1" | |
| 2140 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2141 | checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" | |
| 2142 | dependencies = [ | |
| 2143 | "byteorder", | |
| 2144 | ] | |
| 2145 | ||
| 2146 | 2127 | [[package]] |
| 2147 | 2128 | name = "generic-array" |
| 2148 | 2129 | version = "0.14.7" |
| @@ -2558,7 +2539,6 @@ dependencies = [ | ||
| 2558 | 2539 | "notify-rust", |
| 2559 | 2540 | "open", |
| 2560 | 2541 | "pretty_assertions", |
| 2561 | "rand 0.10.2", | |
| 2562 | 2542 | "ratatui", |
| 2563 | 2543 | "ratatui-image", |
| 2564 | 2544 | "regex", |
| @@ -2566,8 +2546,6 @@ dependencies = [ | ||
| 2566 | 2546 | "serde", |
| 2567 | 2547 | "serde_json", |
| 2568 | 2548 | "shellexpand", |
| 2569 | "sled", | |
| 2570 | "temp-dir", | |
| 2571 | 2549 | "thiserror 2.0.20", |
| 2572 | 2550 | "tokio", |
| 2573 | 2551 | "tokio-stream", |
| @@ -2909,15 +2887,6 @@ dependencies = [ | ||
| 2909 | 2887 | "syn 3.0.6", |
| 2910 | 2888 | ] |
| 2911 | 2889 | |
| 2912 | [[package]] | |
| 2913 | name = "instant" | |
| 2914 | version = "0.1.13" | |
| 2915 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2916 | checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" | |
| 2917 | dependencies = [ | |
| 2918 | "cfg-if", | |
| 2919 | ] | |
| 2920 | ||
| 2921 | 2890 | [[package]] |
| 2922 | 2891 | name = "interpolate_name" |
| 2923 | 2892 | version = "0.2.4" |
| @@ -4295,17 +4264,6 @@ version = "2.2.1" | ||
| 4295 | 4264 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 4296 | 4265 | checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" |
| 4297 | 4266 | |
| 4298 | [[package]] | |
| 4299 | name = "parking_lot" | |
| 4300 | version = "0.11.2" | |
| 4301 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4302 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" | |
| 4303 | dependencies = [ | |
| 4304 | "instant", | |
| 4305 | "lock_api", | |
| 4306 | "parking_lot_core 0.8.6", | |
| 4307 | ] | |
| 4308 | ||
| 4309 | 4267 | [[package]] |
| 4310 | 4268 | name = "parking_lot" |
| 4311 | 4269 | version = "0.12.5" |
| @@ -4313,21 +4271,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 4313 | 4271 | checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" |
| 4314 | 4272 | dependencies = [ |
| 4315 | 4273 | "lock_api", |
| 4316 | "parking_lot_core 0.9.12", | |
| 4317 | ] | |
| 4318 | ||
| 4319 | [[package]] | |
| 4320 | name = "parking_lot_core" | |
| 4321 | version = "0.8.6" | |
| 4322 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4323 | checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" | |
| 4324 | dependencies = [ | |
| 4325 | "cfg-if", | |
| 4326 | "instant", | |
| 4327 | "libc", | |
| 4328 | "redox_syscall 0.2.16", | |
| 4329 | "smallvec", | |
| 4330 | "winapi", | |
| 4274 | "parking_lot_core", | |
| 4331 | 4275 | ] |
| 4332 | 4276 | |
| 4333 | 4277 | [[package]] |
| @@ -4338,7 +4282,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" | ||
| 4338 | 4282 | dependencies = [ |
| 4339 | 4283 | "cfg-if", |
| 4340 | 4284 | "libc", |
| 4341 | "redox_syscall 0.5.18", | |
| 4285 | "redox_syscall", | |
| 4342 | 4286 | "smallvec", |
| 4343 | 4287 | "windows-link 0.2.1", |
| 4344 | 4288 | ] |
| @@ -5233,15 +5177,6 @@ version = "0.5.5" | ||
| 5233 | 5177 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 5234 | 5178 | checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" |
| 5235 | 5179 | |
| 5236 | [[package]] | |
| 5237 | name = "redox_syscall" | |
| 5238 | version = "0.2.16" | |
| 5239 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 5240 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" | |
| 5241 | dependencies = [ | |
| 5242 | "bitflags 1.3.2", | |
| 5243 | ] | |
| 5244 | ||
| 5245 | 5180 | [[package]] |
| 5246 | 5181 | name = "redox_syscall" |
| 5247 | 5182 | version = "0.5.18" |
| @@ -6023,22 +5958,6 @@ version = "0.4.12" | ||
| 6023 | 5958 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 6024 | 5959 | checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" |
| 6025 | 5960 | |
| 6026 | [[package]] | |
| 6027 | name = "sled" | |
| 6028 | version = "0.34.7" | |
| 6029 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 6030 | checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935" | |
| 6031 | dependencies = [ | |
| 6032 | "crc32fast", | |
| 6033 | "crossbeam-epoch", | |
| 6034 | "crossbeam-utils", | |
| 6035 | "fs2", | |
| 6036 | "fxhash", | |
| 6037 | "libc", | |
| 6038 | "log", | |
| 6039 | "parking_lot 0.11.2", | |
| 6040 | ] | |
| 6041 | ||
| 6042 | 5961 | [[package]] |
| 6043 | 5962 | name = "smallvec" |
| 6044 | 5963 | version = "1.16.1" |
| @@ -6108,7 +6027,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 6108 | 6027 | checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" |
| 6109 | 6028 | dependencies = [ |
| 6110 | 6029 | "new_debug_unreachable", |
| 6111 | "parking_lot 0.12.5", | |
| 6030 | "parking_lot", | |
| 6112 | 6031 | "phf_shared 0.13.1", |
| 6113 | 6032 | "precomputed-hash", |
| 6114 | 6033 | "serde", |
| @@ -6235,12 +6154,6 @@ dependencies = [ | ||
| 6235 | 6154 | "windows-version", |
| 6236 | 6155 | ] |
| 6237 | 6156 | |
| 6238 | [[package]] | |
| 6239 | name = "temp-dir" | |
| 6240 | version = "0.2.0" | |
| 6241 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 6242 | checksum = "016ef9739649996fcc983b9c588fe3d557cf216d4d98503ce1b057ab5a66d689" | |
| 6243 | ||
| 6244 | 6157 | [[package]] |
| 6245 | 6158 | name = "tempfile" |
| 6246 | 6159 | version = "3.27.0" |
| @@ -6270,7 +6183,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 6270 | 6183 | checksum = "9048a889effe34a5cddee0af7f53285198b16dca3be510858d38dfdb3e62a04e" |
| 6271 | 6184 | dependencies = [ |
| 6272 | 6185 | "bitflags 2.13.2", |
| 6273 | "parking_lot 0.12.5", | |
| 6186 | "parking_lot", | |
| 6274 | 6187 | "rustix 1.1.5", |
| 6275 | 6188 | "signal-hook", |
| 6276 | 6189 | "windows-sys 0.61.2", |
Cargo.toml −3
| @@ -55,15 +55,12 @@ mime = "0.3.16" | ||
| 55 | 55 | mime_guess = "2.0.4" |
| 56 | 56 | nom = "8.0" |
| 57 | 57 | open = "5.0.0" |
| 58 | rand = "0.10" | |
| 59 | 58 | ratatui = { version = "0.30.2", features = ["serde"] } |
| 60 | 59 | regex = "1.5" |
| 61 | 60 | rpassword = "7.2" |
| 62 | 61 | serde = "1.0" |
| 63 | 62 | serde_json = "1.0" |
| 64 | 63 | shellexpand = "3.1" |
| 65 | sled = "0.34.7" | |
| 66 | temp-dir = "0.2" | |
| 67 | 64 | thiserror = "2.0" |
| 68 | 65 | tokio-stream = "0.1.19" |
| 69 | 66 | toml = "1.1" |
src/base.rs −4
| @@ -839,10 +839,6 @@ pub enum IambError { | ||
| 839 | 839 | #[error("Failed to import room keys: {0}")] |
| 840 | 840 | FailedKeyImport(#[from] matrix_sdk::encryption::RoomKeyImportError), |
| 841 | 841 | |
| 842 | /// A failure related to the cryptographic store. | |
| 843 | #[error("Cannot export keys from sled: {0}")] | |
| 844 | UpgradeSled(#[from] crate::sled_export::SledMigrationError), | |
| 845 | ||
| 846 | 842 | /// An HTTP error. |
| 847 | 843 | #[error("HTTP client error: {0}")] |
| 848 | 844 | Http(#[from] matrix_sdk::HttpError), |
src/main.rs +1 −122
| @@ -26,7 +26,6 @@ use std::sync::atomic::AtomicUsize; | ||
| 26 | 26 | use clap::{CommandFactory, Parser}; |
| 27 | 27 | use matrix_sdk::ruma::api::error::ErrorKind; |
| 28 | 28 | use matrix_sdk::{OwnedServerName, RoomState}; |
| 29 | use matrix_sdk_crypto::encrypt_room_key_export; | |
| 30 | 29 | use modalkit::actions::{Commandable, TabAction, TabContainer, TabCount, WindowContainer}; |
| 31 | 30 | use modalkit::crossterm; |
| 32 | 31 | use modalkit::crossterm::cursor::SetCursorStyle; |
| @@ -40,11 +39,8 @@ use modalkit_ratatui::cmdbar::CommandBarState; | ||
| 40 | 39 | use modalkit_ratatui::screen::{Screen, ScreenState, TabbedLayoutDescription}; |
| 41 | 40 | use modalkit_ratatui::windows::{WindowLayoutDescription, WindowLayoutState}; |
| 42 | 41 | use modalkit_ratatui::{TerminalExtOps, Window}; |
| 43 | use rand::RngExt as _; | |
| 44 | use rand::distr::Alphanumeric; | |
| 45 | 42 | use ratatui::Terminal; |
| 46 | 43 | use ratatui::backend::CrosstermBackend; |
| 47 | use temp_dir::TempDir; | |
| 48 | 44 | use tokio::sync::Mutex as AsyncMutex; |
| 49 | 45 | use tracing::Level; |
| 50 | 46 | use tracing_subscriber::{EnvFilter, FmtSubscriber}; |
| @@ -66,7 +62,6 @@ mod message; | ||
| 66 | 62 | mod notifications; |
| 67 | 63 | mod prelude; |
| 68 | 64 | mod preview; |
| 69 | mod sled_export; | |
| 70 | 65 | mod util; |
| 71 | 66 | mod verifications; |
| 72 | 67 | mod windows; |
| @@ -899,10 +894,6 @@ impl Application { | ||
| 899 | 894 | } |
| 900 | 895 | } |
| 901 | 896 | |
| 902 | fn gen_passphrase() -> String { | |
| 903 | rand::rng().sample_iter(&Alphanumeric).take(20).map(char::from).collect() | |
| 904 | } | |
| 905 | ||
| 906 | 897 | fn read_response(question: &str) -> String { |
| 907 | 898 | println!("{question}"); |
| 908 | 899 | let mut input = String::new(); |
| @@ -981,111 +972,6 @@ fn print_exit<T: Display, N>(v: T) -> N { | ||
| 981 | 972 | process::exit(2); |
| 982 | 973 | } |
| 983 | 974 | |
| 984 | // We can't access the OlmMachine directly, so write the keys to a temporary | |
| 985 | // file first, and then import them later. | |
| 986 | async fn check_import_keys( | |
| 987 | settings: &ApplicationSettings, | |
| 988 | ) -> IambResult<Option<(temp_dir::TempDir, String)>> { | |
| 989 | let do_import = settings.sled_dir.is_dir() && !settings.sqlite_dir.is_dir(); | |
| 990 | ||
| 991 | if !do_import { | |
| 992 | return Ok(None); | |
| 993 | } | |
| 994 | ||
| 995 | let question = format!( | |
| 996 | "Found old sled store in {}. Would you like to export room keys from it? [y]es/[n]o", | |
| 997 | settings.sled_dir.display() | |
| 998 | ); | |
| 999 | ||
| 1000 | loop { | |
| 1001 | match read_yesno(&question) { | |
| 1002 | Some('y') => { | |
| 1003 | break; | |
| 1004 | }, | |
| 1005 | Some('n') => { | |
| 1006 | return Ok(None); | |
| 1007 | }, | |
| 1008 | Some(_) | None => { | |
| 1009 | continue; | |
| 1010 | }, | |
| 1011 | } | |
| 1012 | } | |
| 1013 | ||
| 1014 | let keys = sled_export::export_room_keys(&settings.sled_dir).await?; | |
| 1015 | let passphrase = gen_passphrase(); | |
| 1016 | ||
| 1017 | println!("* Encrypting {} room keys with the passphrase {passphrase:?}...", keys.len()); | |
| 1018 | ||
| 1019 | let encrypted = match encrypt_room_key_export(&keys, &passphrase, 500000) { | |
| 1020 | Ok(encrypted) => encrypted, | |
| 1021 | Err(e) => { | |
| 1022 | eprintln!("* Failed to encrypt room keys during export: {e}"); | |
| 1023 | process::exit(2); | |
| 1024 | }, | |
| 1025 | }; | |
| 1026 | ||
| 1027 | let tmpdir = TempDir::new()?; | |
| 1028 | let exported = tmpdir.child("keys"); | |
| 1029 | ||
| 1030 | println!("* Writing encrypted room keys to {}...", exported.display()); | |
| 1031 | tokio::fs::write(&exported, &encrypted).await?; | |
| 1032 | ||
| 1033 | Ok(Some((tmpdir, passphrase))) | |
| 1034 | } | |
| 1035 | ||
| 1036 | async fn login_upgrade( | |
| 1037 | keydir: TempDir, | |
| 1038 | passphrase: String, | |
| 1039 | worker: &Requester, | |
| 1040 | settings: &ApplicationSettings, | |
| 1041 | store: &AsyncProgramStore, | |
| 1042 | ) -> IambResult<()> { | |
| 1043 | println!( | |
| 1044 | "Please log in for {} to import the room keys into a new session", | |
| 1045 | settings.profile.user_id | |
| 1046 | ); | |
| 1047 | ||
| 1048 | login(worker, settings).await?; | |
| 1049 | ||
| 1050 | println!("* Importing room keys..."); | |
| 1051 | ||
| 1052 | let exported = keydir.child("keys"); | |
| 1053 | let imported = worker.client.encryption().import_room_keys(exported, &passphrase).await; | |
| 1054 | ||
| 1055 | match imported { | |
| 1056 | Ok(res) => { | |
| 1057 | println!( | |
| 1058 | "* Successfully imported {} out of {} keys", | |
| 1059 | res.imported_count, res.total_count | |
| 1060 | ); | |
| 1061 | let _ = keydir.cleanup(); | |
| 1062 | }, | |
| 1063 | Err(e) => { | |
| 1064 | println!( | |
| 1065 | "Failed to import room keys from {}/keys: {e}\n\n\ | |
| 1066 | They have been encrypted with the passphrase {passphrase:?}.\ | |
| 1067 | Please save them and try importing them manually instead\n", | |
| 1068 | keydir.path().display() | |
| 1069 | ); | |
| 1070 | ||
| 1071 | loop { | |
| 1072 | match read_yesno("Would you like to continue logging in? [y]es/[n]o") { | |
| 1073 | Some('y') => break, | |
| 1074 | Some('n') => print_exit("* Exiting..."), | |
| 1075 | Some(_) | None => continue, | |
| 1076 | } | |
| 1077 | } | |
| 1078 | }, | |
| 1079 | } | |
| 1080 | ||
| 1081 | println!("* Syncing..."); | |
| 1082 | worker::do_first_sync(&worker.client, store) | |
| 1083 | .await | |
| 1084 | .map_err(IambError::from)?; | |
| 1085 | ||
| 1086 | Ok(()) | |
| 1087 | } | |
| 1088 | ||
| 1089 | 975 | async fn login_normal( |
| 1090 | 976 | worker: &Requester, |
| 1091 | 977 | settings: &ApplicationSettings, |
| @@ -1109,9 +995,6 @@ async fn run( | ||
| 1109 | 995 | // setup_tty() and pop in restore_tty(). |
| 1110 | 996 | settings.probe_enhanced_keys(); |
| 1111 | 997 | |
| 1112 | // Get old keys the first time we run w/ the upgraded SDK. | |
| 1113 | let import_keys = check_import_keys(&settings).await?; | |
| 1114 | ||
| 1115 | 998 | // Set up client state. |
| 1116 | 999 | create_dir_all(settings.sqlite_dir.as_path())?; |
| 1117 | 1000 | let client = worker::create_client(&settings).await; |
| @@ -1130,11 +1013,7 @@ async fn run( | ||
| 1130 | 1013 | let store = Arc::new(AsyncMutex::new(store)); |
| 1131 | 1014 | worker.init(store.clone()); |
| 1132 | 1015 | |
| 1133 | let res = if let Some((keydir, pass)) = import_keys { | |
| 1134 | login_upgrade(keydir, pass, &worker, &settings, &store).await | |
| 1135 | } else { | |
| 1136 | login_normal(&worker, &settings, &store).await | |
| 1137 | }; | |
| 1016 | let res = login_normal(&worker, &settings, &store).await; | |
| 1138 | 1017 | |
| 1139 | 1018 | match res { |
| 1140 | 1019 | Err(UIError::Application(IambError::Matrix(e))) => { |
src/sled_export.rs deleted −58
| @@ -1,58 +0,0 @@ | ||
| 1 | //! # sled -> sqlite migration code | |
| 2 | //! | |
| 3 | //! Before the 0.0.9 release, iamb used matrix-sdk@0.6.2, which used [sled] | |
| 4 | //! for storing information, including room keys. In matrix-sdk@0.7.0, | |
| 5 | //! the SDK switched to using SQLite. This module takes care of opening | |
| 6 | //! sled, exporting the inbound group sessions used for decryption, | |
| 7 | //! and importing them into SQLite. | |
| 8 | //! | |
| 9 | //! This code will eventually be removed once people have been given enough | |
| 10 | //! time to upgrade off of pre-0.0.9 versions. | |
| 11 | //! | |
| 12 | //! [sled]: https://docs.rs/sled/0.34.7/sled/index.html | |
| 13 | ||
| 14 | use matrix_sdk_crypto::olm::{ExportedRoomKey, InboundGroupSession, PickledInboundGroupSession}; | |
| 15 | use sled::{Config, IVec}; | |
| 16 | ||
| 17 | use crate::prelude::*; | |
| 18 | ||
| 19 | #[derive(Debug, thiserror::Error)] | |
| 20 | pub enum SledMigrationError { | |
| 21 | #[error("sled failure: {0}")] | |
| 22 | Sled(#[from] sled::Error), | |
| 23 | ||
| 24 | #[error("deserialization failure: {0}")] | |
| 25 | Deserialize(#[from] serde_json::Error), | |
| 26 | } | |
| 27 | ||
| 28 | fn group_session_from_slice( | |
| 29 | (_, bytes): (IVec, IVec), | |
| 30 | ) -> Result<PickledInboundGroupSession, SledMigrationError> { | |
| 31 | serde_json::from_slice(&bytes).map_err(SledMigrationError::from) | |
| 32 | } | |
| 33 | ||
| 34 | async fn export_room_keys_priv( | |
| 35 | sled_dir: &Path, | |
| 36 | ) -> Result<Vec<ExportedRoomKey>, SledMigrationError> { | |
| 37 | let path = sled_dir.join("matrix-sdk-state"); | |
| 38 | let store = Config::new().temporary(false).path(&path).open()?; | |
| 39 | let inbound_groups = store.open_tree("inbound_group_sessions")?; | |
| 40 | ||
| 41 | let mut exported = vec![]; | |
| 42 | let sessions = inbound_groups | |
| 43 | .iter() | |
| 44 | .map(|p| p.map_err(SledMigrationError::from).and_then(group_session_from_slice)) | |
| 45 | .collect::<Result<Vec<_>, _>>()? | |
| 46 | .into_iter() | |
| 47 | .filter_map(|p| InboundGroupSession::from_pickle(p).ok()); | |
| 48 | ||
| 49 | for session in sessions { | |
| 50 | exported.push(session.export().await); | |
| 51 | } | |
| 52 | ||
| 53 | Ok(exported) | |
| 54 | } | |
| 55 | ||
| 56 | pub async fn export_room_keys(sled_dir: &Path) -> Result<Vec<ExportedRoomKey>, IambError> { | |
| 57 | export_room_keys_priv(sled_dir).await.map_err(IambError::from) | |
| 58 | } | |