Skip to content

Commit defe785

Browse files
committed
Tests: Ensure consistent Session key derival
1 parent 9a406ce commit defe785

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_crypto.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import binascii
23
from xcloud.protocol import srtp_crypto
34

45
def test_decrypt(test_data: dict, crypto_context: srtp_crypto.SrtpContext):
@@ -22,3 +23,10 @@ def test_init_master_keys(srtp_key: str):
2223

2324
assert null_keys is not None
2425
assert dummy_keys is not None
26+
27+
def test_derive_session_keys(srtp_key: str):
28+
session_keys = srtp_crypto.SrtpContext.from_base64(srtp_key).session_keys
29+
30+
assert binascii.hexlify(session_keys.crypt_key) == b'45eaf77f1262638cf5d3ad0db5838d1d'
31+
assert binascii.hexlify(session_keys.auth_key) == b'd03d6382e1fec9480feb65e603c81e48'
32+
assert binascii.hexlify(session_keys.salt_key) == b'dad2a3c84f32ff7dbca6802ea223'

0 commit comments

Comments
 (0)