mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-09 08:27:32 -04:00
crypto: Document when a key export may panic.
This commit is contained in:
@@ -1727,6 +1727,11 @@ impl Client {
|
||||
/// returns `true` the `InboundGroupSessoin` will be included in the export,
|
||||
/// if the closure returns `false` it will not be included.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This method will panic if it can't get enough randomness from the OS to
|
||||
/// encrypt the exported keys securely.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
|
||||
@@ -122,6 +122,11 @@ pub fn decrypt_key_export(
|
||||
/// attacks. Should be at least `10000`, while values in the `100000` ranges
|
||||
/// should be preferred.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This method will panic if it can't get enough randomness from the OS to
|
||||
/// encrypt the exported keys securely.
|
||||
///
|
||||
/// # Examples
|
||||
/// ```no_run
|
||||
/// # use matrix_sdk_crypto::{OlmMachine, encrypt_key_export};
|
||||
|
||||
@@ -172,7 +172,7 @@ impl OlmMachine {
|
||||
let store = Store::new(store);
|
||||
let verification_machine = VerificationMachine::new(account.clone(), store.clone());
|
||||
let user_id = Arc::new(user_id.clone());
|
||||
let device_id: Arc<DeviceIdBox> = Arc::new(device_id.into());
|
||||
let device_id: Arc<DeviceIdBox> = Arc::new(device_id);
|
||||
let key_request_machine =
|
||||
KeyRequestMachine::new(user_id.clone(), device_id.clone(), store.clone());
|
||||
|
||||
@@ -1612,6 +1612,17 @@ impl OlmMachine {
|
||||
|
||||
/// Export the keys that match the given predicate.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `predicate` - A closure that will be called for every known
|
||||
/// `InboundGroupSession`, which represents a room key. If the closure
|
||||
/// returns `true` the `InboundGroupSessoin` will be included in the export,
|
||||
/// if the closure returns `false` it will not be included.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This method will panic if it can't get enough randomness from the OS to
|
||||
/// encrypt the exported keys securely.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user