Fix Cygwin compilation:

- Fix various incompatibilities and differences between Linux and Cygwin builds
- Make usrsctp an optional dependency
- Fix building without SSL
- Add new secure random bytes function, use it for websockets
- Switch to libsrtp2 v2.6.0 (currently latest release)
- Add patch that makes latest libsrtp2 build in latest Cygwin
- Add patch that makes srt build in latest Cygwin
- Correctly allow linking libsrtp2 and srt to local mbedtls version
This commit is contained in:
Thulinma 2024-03-26 12:04:53 +01:00
parent db30be38c5
commit dbafa808b8
23 changed files with 131 additions and 23 deletions

View file

@ -1604,6 +1604,7 @@ namespace Mist{
if (connectedUsers || isAlwaysOn()){activityCounter = Util::bootSecs();}
if (thisTime >= lastBuffered){
if (sourceIdx != idx){
#ifdef SSL
if (encryption.find(":") != std::string::npos || M.getEncryption(idx).find(":") != std::string::npos){
if (encryption == ""){
encryption = M.getEncryption(idx);
@ -1622,8 +1623,11 @@ namespace Mist{
thisPacket = encPacket;
}
}else{
#endif
thisPacket = DTSC::Packet(thisPacket, idx);
#ifdef SSL
}
#endif
}
//Sanity check: are we matching the key's data size?
if (thisPacket.getFlag("keyframe")){

View file

@ -5,13 +5,16 @@
#include <mist/config.h>
#include <mist/defines.h>
#include <mist/dtsc.h>
#include <mist/encryption.h>
#include <mist/json.h>
#include <mist/shared_memory.h>
#include <mist/timing.h>
#include <mist/url.h>
#include <set>
#ifdef SSL
#include <mist/encryption.h>
#endif
#include "../io.h"
namespace Mist{
@ -110,7 +113,9 @@ namespace Mist{
Comms::Users users;
size_t connectedUsers;
#ifdef SSL
Encryption::AES aesCipher;
#endif
IPC::sharedPage streamStatus;

View file

@ -1,5 +1,7 @@
#include "input_hls.h"
#ifdef SSL
#include "mbedtls/aes.h"
#endif
#include <algorithm>
#include <cerrno>
#include <cstdio>

View file

@ -67,7 +67,9 @@ namespace Mist{
Util::ResizeablePointer * currBuf;
size_t encOffset;
unsigned char tmpIvec[16];
#ifdef SSL
mbedtls_aes_context aes;
#endif
bool isOpen;
};