Skip to content

Commit a3604b2

Browse files
committed
Reexport KeyDerivationAlgorithm, use const for default KeyDerivationAlgorithm.
1 parent 8189aa9 commit a3604b2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

livekit/src/room/e2ee/key_provider.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use libwebrtc::native::frame_cryptor::{self as fc, KeyDerivationAlgorithm};
15+
use libwebrtc::native::frame_cryptor as fc;
1616
use std::sync::{
1717
atomic::{AtomicI32, Ordering},
1818
Arc,
1919
};
2020

2121
use crate::id::ParticipantIdentity;
2222

23+
pub use libwebrtc::native::frame_cryptor::KeyDerivationAlgorithm;
24+
2325
const DEFAULT_RATCHET_SALT: &str = "LKFrameEncryptionKey";
2426
const DEFAULT_RATCHET_WINDOW_SIZE: i32 = 16;
2527
const DEFAULT_FAILURE_TOLERANCE: i32 = -1; // no tolerance by default
2628
const DEFAULT_KEY_RING_SIZE: i32 = 16;
29+
const DEFAULT_KEY_DERIVATION_ALGORITHM: KeyDerivationAlgorithm = KeyDerivationAlgorithm::PBKDF2;
2730

2831
#[derive(Clone)]
2932
pub struct KeyProviderOptions {
@@ -41,7 +44,7 @@ impl Default for KeyProviderOptions {
4144
ratchet_salt: DEFAULT_RATCHET_SALT.to_owned().into_bytes(),
4245
failure_tolerance: DEFAULT_FAILURE_TOLERANCE,
4346
key_ring_size: DEFAULT_KEY_RING_SIZE,
44-
key_derivation_algorithm: KeyDerivationAlgorithm::PBKDF2,
47+
key_derivation_algorithm: DEFAULT_KEY_DERIVATION_ALGORITHM,
4548
}
4649
}
4750
}

0 commit comments

Comments
 (0)