File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -328,7 +328,20 @@ std::future<proto::ConnectCallback> FfiClient::connectAsync(const std::string& u
328328
329329 auto * enc = opts->mutable_encryption ();
330330 enc->set_encryption_type (static_cast <proto::EncryptionType>(e2ee.encryption_type ));
331- enc->mutable_key_provider_options ()->CopyFrom (toProto (kpo));
331+ auto * kp = enc->mutable_key_provider_options ();
332+ // shared_key is optional. If not set, leave the field unset/cleared.
333+ if (kpo.shared_key && !kpo.shared_key ->empty ()) {
334+ kp->set_shared_key (bytesToString (*kpo.shared_key ));
335+ } else {
336+ kp->clear_shared_key ();
337+ }
338+
339+ const auto ratchet_salt = kpo.ratchet_salt .empty () ? defaultRatchetSalt () : kpo.ratchet_salt ;
340+ kp->set_ratchet_window_size (kpo.ratchet_window_size );
341+ kp->set_ratchet_salt (bytesToString (ratchet_salt));
342+ kp->set_failure_tolerance (kpo.failure_tolerance );
343+ kp->set_key_ring_size (kDefaultKeyRingSize );
344+ kp->set_key_derivation_function (kDefaultKeyDerivationFunction );
332345 }
333346
334347 // --- RTC configuration (optional) ---
You can’t perform that action at this time.
0 commit comments