Page MenuHomePhabricator

D12340.diff
No OneTemporary

D12340.diff

diff --git a/services/commtest/src/identity/olm_account_infos.rs b/services/commtest/src/identity/olm_account_infos.rs
--- a/services/commtest/src/identity/olm_account_infos.rs
+++ b/services/commtest/src/identity/olm_account_infos.rs
@@ -16,11 +16,32 @@
}
impl ClientPublicKeys {
+ /// Generates random keys with given `ed25519` primary account
+ /// signing public key. Use [`ClientPublicKeys::default`] for random key.
+ pub fn new(primary_signing_public_key: impl Into<String>) -> Self {
+ Self {
+ primary_identity_public_keys: IdentityPublicKeys {
+ ed25519: primary_signing_public_key.into(),
+ curve25519: generate_random_olm_key(),
+ },
+ notification_identity_public_keys: IdentityPublicKeys {
+ ed25519: generate_random_olm_key(),
+ curve25519: generate_random_olm_key(),
+ },
+ }
+ }
+
pub fn device_id(&self) -> String {
self.primary_identity_public_keys.ed25519.clone()
}
}
+impl Default for ClientPublicKeys {
+ fn default() -> Self {
+ Self::new(generate_random_olm_key())
+ }
+}
+
lazy_static! {
pub static ref DEFAULT_CLIENT_KEYS: ClientPublicKeys = ClientPublicKeys {
primary_identity_public_keys: IdentityPublicKeys {

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 13, 1:27 PM (20 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2650857
Default Alt Text
D12340.diff (1 KB)

Event Timeline