Merge pull request #1310 in FS/freeswitch from ~TADAMS/fs-9785:master to master
* commit 'fb46f87b076608968c49bc93af539454ab78d367': FS-9785: fix ./mod_conference.h:353:23: error: enumerator value for ‘EFLAG_BLIND_MEMBER’ is not an integer constant expression [-Werror=pedantic] EFLAG_BLIND_MEMBER = (1 << 31) FS-9785: update mod_event_multicast to work with OpenSSL 1.1.0. FS-9785: Fix src/switch_ivr_play_say.c:1668:48: error: ‘*’ in boolean context, suggest ‘&&’ instead [-Werror=int-in-bool-context] FS-9785: Fix format-truncation warnings for systems that treat it as an error.
This commit is contained in:
commit
9c8cf40ada
|
@ -76,7 +76,7 @@ static int is_color = 1;
|
|||
static int warn_stop = 0;
|
||||
static int connected = 0;
|
||||
static int allow_ctl_c = 0;
|
||||
static char bare_prompt_str[512] = "";
|
||||
static char bare_prompt_str[514] = "";
|
||||
static int bare_prompt_str_len = 0;
|
||||
static char prompt_str[512] = "";
|
||||
static char prompt_color[12] = {ESL_SEQ_DEFAULT_COLOR};
|
||||
|
|
|
@ -3817,7 +3817,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_queue_dtmf(ftdm_channel_t *ftdmchan, cons
|
|||
if (!ftdmchan->dtmfdbg.file) {
|
||||
struct tm currtime;
|
||||
time_t currsec;
|
||||
char dfile[1024];
|
||||
char dfile[1138];
|
||||
|
||||
currsec = time(NULL);
|
||||
|
||||
|
@ -5636,7 +5636,7 @@ FT_DECLARE(ftdm_status_t) ftdm_unload_modules(void)
|
|||
{
|
||||
ftdm_hash_iterator_t *i = NULL;
|
||||
ftdm_dso_lib_t lib = NULL;
|
||||
char modpath[255] = { 0 };
|
||||
char modpath[256] = { 0 };
|
||||
|
||||
/* stop signaling interfaces first as signaling depends on I/O and not the other way around */
|
||||
for (i = hashtable_first(globals.module_hash); i; i = hashtable_next(i)) {
|
||||
|
|
|
@ -350,7 +350,7 @@ typedef enum {
|
|||
EFLAG_HUP_MEMBER = (1 << 28),
|
||||
EFLAG_PLAY_FILE_DONE = (1 << 29),
|
||||
EFLAG_SET_POSITION_MEMBER = (1 << 30),
|
||||
EFLAG_BLIND_MEMBER = (1 << 31)
|
||||
EFLAG_BLIND_MEMBER = (int)(1U << 31U)
|
||||
} event_type_t;
|
||||
|
||||
#ifdef OPENAL_POSITIONING
|
||||
|
|
|
@ -291,7 +291,11 @@ static void event_handler(switch_event_t *event)
|
|||
char *buf;
|
||||
#ifdef HAVE_OPENSSL
|
||||
int outlen, tmplen;
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000
|
||||
EVP_CIPHER_CTX *ctx;
|
||||
#else
|
||||
EVP_CIPHER_CTX ctx;
|
||||
#endif
|
||||
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
|
||||
switch_uuid_t uuid;
|
||||
|
||||
|
@ -309,6 +313,19 @@ static void event_handler(switch_event_t *event)
|
|||
if (globals.psk) {
|
||||
switch_copy_string(buf, uuid_str, SWITCH_UUID_FORMATTED_LENGTH);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000
|
||||
ctx = EVP_CIPHER_CTX_new();
|
||||
EVP_EncryptInit(ctx, EVP_bf_cbc(), NULL, NULL);
|
||||
EVP_CIPHER_CTX_set_key_length(ctx, strlen(globals.psk));
|
||||
EVP_EncryptInit(ctx, NULL, (unsigned char *) globals.psk, (unsigned char *) uuid_str);
|
||||
EVP_EncryptUpdate(ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH,
|
||||
&outlen, (unsigned char *) packet, (int) strlen(packet));
|
||||
EVP_EncryptUpdate(ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH + outlen,
|
||||
&tmplen, (unsigned char *) MAGIC, (int) strlen((char *) MAGIC));
|
||||
outlen += tmplen;
|
||||
EVP_EncryptFinal(ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH + outlen, &tmplen);
|
||||
EVP_CIPHER_CTX_cleanup(ctx);
|
||||
#else
|
||||
EVP_CIPHER_CTX_init(&ctx);
|
||||
EVP_EncryptInit(&ctx, EVP_bf_cbc(), NULL, NULL);
|
||||
EVP_CIPHER_CTX_set_key_length(&ctx, strlen(globals.psk));
|
||||
|
@ -320,6 +337,7 @@ static void event_handler(switch_event_t *event)
|
|||
outlen += tmplen;
|
||||
EVP_EncryptFinal(&ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH + outlen, &tmplen);
|
||||
EVP_CIPHER_CTX_cleanup(&ctx);
|
||||
#endif
|
||||
outlen += tmplen;
|
||||
len = (size_t) outlen + SWITCH_UUID_FORMATTED_LENGTH;
|
||||
*(buf + SWITCH_UUID_FORMATTED_LENGTH + outlen) = '\0';
|
||||
|
@ -530,7 +548,11 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime)
|
|||
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
|
||||
char *tmp;
|
||||
int outl, tmplen;
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
EVP_CIPHER_CTX *ctx;
|
||||
#else
|
||||
EVP_CIPHER_CTX ctx;
|
||||
#endif
|
||||
|
||||
len -= SWITCH_UUID_FORMATTED_LENGTH;
|
||||
|
||||
|
@ -541,6 +563,15 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime)
|
|||
switch_copy_string(uuid_str, packet, SWITCH_UUID_FORMATTED_LENGTH);
|
||||
packet += SWITCH_UUID_FORMATTED_LENGTH;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
ctx = EVP_CIPHER_CTX_new();
|
||||
EVP_DecryptInit(ctx, EVP_bf_cbc(), NULL, NULL);
|
||||
EVP_CIPHER_CTX_set_key_length(ctx, strlen(globals.psk));
|
||||
EVP_DecryptInit(ctx, NULL, (unsigned char *) globals.psk, (unsigned char *) uuid_str);
|
||||
EVP_DecryptUpdate(ctx, (unsigned char *) tmp, &outl, (unsigned char *) packet, (int) len);
|
||||
EVP_DecryptFinal(ctx, (unsigned char *) tmp + outl, &tmplen);
|
||||
EVP_CIPHER_CTX_cleanup(ctx);
|
||||
#else
|
||||
EVP_CIPHER_CTX_init(&ctx);
|
||||
EVP_DecryptInit(&ctx, EVP_bf_cbc(), NULL, NULL);
|
||||
EVP_CIPHER_CTX_set_key_length(&ctx, strlen(globals.psk));
|
||||
|
@ -548,6 +579,8 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime)
|
|||
EVP_DecryptUpdate(&ctx, (unsigned char *) tmp, &outl, (unsigned char *) packet, (int) len);
|
||||
EVP_DecryptFinal(&ctx, (unsigned char *) tmp + outl, &tmplen);
|
||||
EVP_CIPHER_CTX_cleanup(&ctx);
|
||||
#endif
|
||||
|
||||
*(tmp + outl + tmplen) = '\0';
|
||||
|
||||
/*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "decrypted event as %s\n----------\n of actual length %d (%d) %d\n", tmp, outl + tmplen, (int) len, (int) strlen(tmp)); */
|
||||
|
|
|
@ -1665,7 +1665,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
|||
}
|
||||
}
|
||||
|
||||
buflen = FILE_STARTSAMPLES * sizeof(*abuf) * fh->cur_channels ? fh->cur_channels : fh->channels;
|
||||
buflen = (FILE_STARTSAMPLES * sizeof(*abuf) * fh->cur_channels) > 0 ? fh->cur_channels : fh->channels;
|
||||
|
||||
if (buflen > write_frame.buflen) {
|
||||
abuf = realloc(abuf, buflen);
|
||||
|
|
Loading…
Reference in New Issue