We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99add1e commit 9a05029Copy full SHA for 9a05029
tests/test_crypto.py
@@ -1,12 +1,15 @@
1
+import pytest
2
from xcloud.protocol import srtp_crypto
3
4
def test_decrypt(test_data: dict, crypto_context: srtp_crypto.SrtpContext):
5
rtp_packet_raw = test_data['rtp_connection_probing.bin']
-
6
rtp_header, rtp_body = rtp_packet_raw[:12], rtp_packet_raw[12:]
7
+
8
plaintext = crypto_context.decrypt(rtp_body, aad=rtp_header)
9
+ with pytest.raises(Exception):
10
+ # Skip 1 byte of "additional data" to ensure invalid data
11
+ crypto_context.decrypt(rtp_body, aad=rtp_header[1:])
12
- print(plaintext)
13
assert plaintext is not None
14
15
def test_init_master_keys(srtp_key: str):
0 commit comments