Skip to content

Commit

Permalink
Merge pull request #756 from orgads/srtp-ssrc
Browse files Browse the repository at this point in the history
SRTP: Use global random ssrc instead of hardcoded value
  • Loading branch information
lemenkov authored Sep 15, 2024
2 parents e2900a4 + b4546ef commit c80bb0e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/jlsrtp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <iterator>
#include <sstream> // std::ostringstream

extern unsigned int global_ssrc_id;

// --------------- PRIVATE METHODS ----------------

bool JLSRTP::isBase64(unsigned char c)
Expand Down Expand Up @@ -3518,7 +3520,10 @@ bool JLSRTP::operator!=(const JLSRTP& that)

JLSRTP::JLSRTP()
{
resetCryptoContext(0xCA110000, "127.0.0.1", 0);
if (global_ssrc_id == 0) {
global_ssrc_id = rand();
}
resetCryptoContext(global_ssrc_id, "127.0.0.1", 0);

_pseudorandomstate.cipher = EVP_CIPHER_CTX_new();
if (_pseudorandomstate.cipher != nullptr)
Expand Down

0 comments on commit c80bb0e

Please sign in to comment.