Commit Graph

30304 Commits

Author SHA1 Message Date
Corey Farrell 4ac6dd4e95 res_pjsip_t38: Better error checking for t38_create_media_state.
Change-Id: I81b2587427c6982aa3e2a3f9ad69cce8d316eb10
2017-11-07 12:34:19 -05:00
Jenkins2 06746b0af5 Merge "res_pjsip: Ignore empty TLS configuration" 2017-11-07 11:05:13 -06:00
Corey Farrell fb18895108 stream: Return error from ast_stream_topology_set_stream.
ast_stream_topology_set_stream had suppressed error codes from
AST_VECTOR_APPEND.  The result of AST_VECTOR_APPEND needs to be returned
to the caller so they can take appropriate action on the stream.

Change-Id: I6c0d12755743eadba1357f6153526cc055592856
2017-11-07 11:28:53 -05:00
Corey Farrell 801094da7b res_stasis: Fix multiple leaks.
* res/stasis/app.c JSON passed to app_send needs to be released.
* res/stasis_message.c: objects leak if vector append fails.

Change-Id: I8dd5385b9f50a5cadf2b1d16efecffd6ddb4db4a
2017-11-07 11:24:48 -05:00
Joshua Colp 3c897daabf Merge "tcptls: Print notice when TLS is enabled but not configured." 2017-11-07 10:12:41 -06:00
Joshua Colp 83c61383c8 Merge "stasis: Remove silly use of RAII_VAR in stasis_forward_all." 2017-11-07 09:32:45 -06:00
Joshua Colp a34b36c513 Merge "stasis_channels.c: Remove a very silly RAII_VAR()." 2017-11-07 08:44:12 -06:00
Joshua Colp a576d7c2e4 Merge "stasis/app.c: Optimize stasis_app_get_debug_by_name()" 2017-11-07 07:57:39 -06:00
Joshua Colp e7c52d1b61 Merge "Fix ast_(v)asprintf() malloc failure usage conditions." 2017-11-07 07:18:12 -06:00
Richard Mudgett 02329b9a34 res_pjproject.c: Fix ast_strdup() alloc failure.
Change-Id: I74688038e7afe3a279359cce53aadb28ade51ead
2017-11-07 08:11:32 -05:00
Aaron An a36d8cc533 res_pjsip: Avoid crash when contact uri is empty string
Asterisk will crash if contact uri is invalid, so contact_apply_handler
should check if the uri is NULL or empty.

ASTERISK-27393 #close
Reported-by: Aaron An
Tested-by: AaronAn

Change-Id: Ia0309bdc6b697c73c9c736e1caec910b77ca69f5
2017-11-07 08:01:08 -05:00
Joshua Colp 5407291ec6 Merge "RTP Engine: Deal with errors returned from AST_VECTOR_REPLACE." 2017-11-07 06:36:32 -06:00
Corey Farrell 7ef38d399a res_pjsip_outbound_registration: Fix leak on vector add failure.
Change-Id: I774b88b3c9da41edd4dc8d78f095481f52f2bd46
2017-11-06 18:55:00 -05:00
Corey Farrell 8684219f79 res_pjsip_exten_state: Check for vector append failure.
Release reference to publisher if we fail to add it to the vector.

Change-Id: I64dff3f481b67b9884f37cadba7a5ccf23d084f3
2017-11-06 18:48:06 -05:00
Corey Farrell f899368cd6 res_pjsip_config_wizard: Fix leaks and add check for malloc failure.
wizard_apply_handler():
- Free host if we fail to add it to the vector.

wizard_mapped_observer():
- Check for otw allocation failure.
- Free otw if we fail to add it to the vector.

Change-Id: Ib5d3bcabbd9c24dd8a3c9cc692a794a5f60243ad
2017-11-06 18:44:01 -05:00
Corey Farrell 4016884ef3 res_stasis_playback: Check for failure to append vector.
Free resources and return error if we fail to append the vector in
stasis_app_control_play_uri.

Change-Id: I22c4a90dd859b253f2850c6511de48b25609422b
2017-11-06 18:38:35 -05:00
Corey Farrell 24b9751aaa test_sorcery_memory_cache_thrash: Handle error from vector append.
Cleanup resources when we fail to append the vector and report test
failure.

Change-Id: I6eb41586fd11dee8c0dfe35e91cb465a4cab7298
2017-11-06 18:33:13 -05:00
Corey Farrell 29205e7adc res_pjsip: Fix leak on error in ast_sip_auth_vector_init.
Change-Id: Ib0fc7a18f3135ca8990c3984c9e15f6d26e556e8
2017-11-06 18:28:35 -05:00
Corey Farrell 70fcc043bb res_pjproject: Handle error from adding to the buildopts vector.
Change-Id: I076c7bd207c7989a23005395ce1735392657be65
2017-11-06 18:17:13 -05:00
Corey Farrell 5247ba4b88 res_ari_events: Fix use after free / double-free of JSON message.
When stasis_app_message_handler needs to queue a message for a later
connection it needs to bump the message reference so it doesn't get
freed when the caller releases it's reference.

Change-Id: I82696df8fe723b3365c15c3f7089501da8daa892
2017-11-06 18:11:08 -05:00
Corey Farrell adb4fdcb7b stasis: Release object if vector append fails.
Change-Id: I3e5cc669169aab6175ddfaf7486edeaeb4fdcfb1
2017-11-06 16:33:00 -05:00
Corey Farrell 2f4f216026 RTP Engine: Deal with errors returned from AST_VECTOR_REPLACE.
Check for errors from AST_VECTOR_REPLACE and clean memory if needed.

Change-Id: I124d15cc1d645f85a72a1279f623c1993b304b0b
2017-11-06 16:20:06 -05:00
Corey Farrell 5762f72425 PBX: Handle errors from AST_VECTOR_APPEND.
This resolves potentials leaks on AST_VECTOR_APPEND error in:
* ast_context_add_include2
* ast_context_add_switch2
* ast_context_add_ignorepat2

Change-Id: Ib60e95c4f622fa3b832d87227c0523a695d736b6
2017-11-06 16:16:35 -05:00
Corey Farrell 714026b32e Messaging: Report error on failure to register tech or handler.
Message tech and handler registrations use a vector which could fail to
expand.  If it does log and error and return error.

Change-Id: I593a8de81a07fb0452e9b0efd5d4018b77bca6f4
2017-11-06 16:10:56 -05:00
Corey Farrell e43c8af77c format_cap: Fix leak on AST_VECTOR_APPEND error.
format_cap_framed_init can fail on AST_VECTOR_APPEND.  This should
report failure to the caller and clean the newly allocated frame.

Change-Id: Ica0661235bf09497bf23d844ceb01f21b41a55b0
2017-11-06 16:07:01 -05:00
Corey Farrell 64bcb65a78 stasis: Remove silly use of RAII_VAR in stasis_forward_all.
Change-Id: I46de4c968d40144d5b049966304ff66c1469fb65
2017-11-06 15:23:46 -05:00
Corey Farrell b7e1034009 CLI: Remove unused internal command.
The internal CLI command "_command complete" was last used by Asterisk
0.2.0.  Since then we've been using "_command nummatches" and "_command
matchesarray".

Change-Id: I682fe1e21a24a3bb5bd04146e639f1c5866bcfce
2017-11-06 13:51:32 -05:00
Joshua Colp 637b37fb98 Merge "dtls: Add support for ephemeral DTLS certificates." 2017-11-06 12:22:38 -06:00
Richard Mudgett 923424019b stasis_bridges.c: Fix off-nominal json memory leaks.
Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8
2017-11-06 13:11:04 -05:00
Richard Mudgett f81970d3fc stasis_channels.c: Remove a very silly RAII_VAR().
Change-Id: I28b458b3c1a442c4ef0be7b4986a95ea4149e14f
2017-11-06 13:06:56 -05:00
Joshua Colp 36fedea8c1 res_pjsip_pubsub: Ensure remote URI contains URI only.
This change makes it so that any user of the pubsub
API that requests the remote URI receives only the URI.
Previously the entire string was returned, which could
contain a display name.

ASTERISK-27290

Change-Id: If1d0cd6630f0a264856d31d2a67933109187a017
2017-11-06 13:02:43 -05:00
Joshua Colp 3126c396b1 Merge "install_prereq: Checkout of libSRTP 2.x." 2017-11-06 11:57:58 -06:00
Richard Mudgett 9771f089f5 stasis/app.c: Optimize stasis_app_get_debug_by_name()
* Eliminate RAII_VAR()
* Short circuit application name lookup if global debug enabled.

Change-Id: I5f78b7bd6ca7fd2c3b07cbbe036c6a93b4681123
2017-11-06 12:50:23 -05:00
Richard Mudgett ee08f10d06 Fix ast_(v)asprintf() malloc failure usage conditions.
When (v)asprintf() fails, the state of the allocated buffer is undefined.
The library had better not leave an allocated buffer as a result or no one
will know to free it.  The most likely way it can return failure is for an
allocation failure.  If the printf conversion fails then you actually have
a threading problem which is much worse because another thread modified
the parameter values.

* Made __ast_asprintf()/__ast_vasprintf() set the returned buffer to NULL
on failure.  That is much more useful than either an uninitialized pointer
or a pointer that has already been freed.  Many uses won't have to check
for failure to ensure that the buffer won't be double freed or prevent an
attempt to free an uninitialized pointer.

* stasis.c: Fixed memory leak in multi_object_blob_to_ami() allocated by
ast_asprintf().

* ari/resource_bridges.c:ari_bridges_play_helper(): Remove assignment to
the wrong thing which is now not needed even if assigning to the right
thing.

Change-Id: Ib5252fb8850ecf0f78ed0ee2ca0796bda7e91c23
2017-11-06 12:47:30 -05:00
Joshua Colp 21d408a942 Merge "configure: Add autoconf check for libopusfile." 2017-11-06 10:38:18 -06:00
Joshua Colp 68b6ebd836 Merge "Prevent unload of modules which implement an Optional API." 2017-11-06 10:11:51 -06:00
Joshua Colp ac7ec5026c Merge "Add missing menuselect dependencies." 2017-11-06 09:26:18 -06:00
Sean Bright ca4e6b568f res_pjsip: Ignore empty TLS configuration
When using realtime, fields that are not explicitly set by an
administrator are still presented to sorcery as empty strings. Handle
this case explicitly.

In this particular case, if any of these fields are required for TLS
support, their existence should be validated in the 'apply' handler once
we have a complete transport definition.

ASTERISK-27032 #close
Reported by: seanchann.zhou

Change-Id: Ie3b5fb421977ccdb33e415d4ec52c3fd192601b7
2017-11-06 09:15:40 -05:00
Joshua Colp 3c6fe0545a Merge "Stasis/ARI: Fix off-nominal path json memory leaks." 2017-11-06 08:15:03 -06:00
Joshua Colp 036bbe2d3f Merge "AOC: Fix AOC-S json memory leak." 2017-11-06 07:51:36 -06:00
Joshua Colp 1ee2907a16 Merge "res_stasis_mailbox.c: Fix leak of mailbox container." 2017-11-06 07:17:22 -06:00
Sean Bright 04d3785a79 dtls: Add support for ephemeral DTLS certificates.
This mimics the behavior of Chrome and Firefox and creates an ephemeral
X.509 certificate for each DTLS session.

Currently, the only supported key type is ECDSA because of its faster
generation time, but other key types can be added in the future as
necessary.

ASTERISK-27395

Change-Id: I5122e5f4b83c6320cc17407a187fcf491daf30b4
2017-11-06 08:11:48 -05:00
Joshua Colp 052d26c169 Merge "Build System: Fix build failure caused by recent CLI improvements." 2017-11-06 06:31:28 -06:00
Corey Farrell 4013bfa52b configure: Add autoconf check for libopusfile.
This check is being added to make it easier for end-users of third party
open source Opus modules.  This was removed by ASTERISK-26426 but only
the module needed to be removed.

Change-Id: I62b9cd0c4fa8a77596ab0e042948a643a1152677
2017-11-06 04:34:34 -05:00
Alexander Traud 19332e6968 tcptls: Print notice when TLS is enabled but not configured.
Asterisk can be compiled without a SSL/TLS library, without the Development
Headers of OpenSSL. However, if TLS (SIP) or Secure-WebSockets (WebRTC) was
enabled in a configuration file, Asterisk did not notice the user. Asterisk
failed silently, only the corresponding TCP ports were not open.

ASTERISK-27394
Reported-by: mossley74

Change-Id: Ib8b7539a5b2af8154c22e5f7a40fc68f95d95b93
2017-11-06 10:18:24 +01:00
Alexander Traud 2ebea5aa03 install_prereq: Checkout of libSRTP 2.x.
Since Asterisk 13.17, libSRTP 2.x is supported. Therefore, its latest version
is installed again via the script install_prereq.

ASTERISK-27356

Change-Id: I13125839a79052356469e41edacbebff0a937d39
2017-11-04 12:05:36 +01:00
Richard Mudgett 79ddcdbc70 Stasis/ARI: Fix off-nominal path json memory leaks.
Change-Id: Id569c624c426e3b22a99936473c730592d8b83fb
2017-11-03 13:14:07 -05:00
Richard Mudgett 229790ea3d AOC: Fix AOC-S json memory leak.
Change-Id: I3a1d40a41a8a7d00fa4a187de6a343a79155d3ef
2017-11-03 12:58:49 -05:00
Richard Mudgett de4a4796d0 res_stasis_device_state.c: Optimize stasis_app_device_states_to_json()
* Eliminate RAII_VAR()
* Replace looped alloca with a char[] since that is how it is used anyway.

Change-Id: Ia27e64a884afa0f50b9ffdb1cf23da6bfa51ffdf
2017-11-03 12:43:11 -05:00
Richard Mudgett 103b05bb4b res_stasis_mailbox.c: Fix leak of mailbox container.
Change-Id: I7d33c1635713047e7d1597c9d882f7dc006d94b4
2017-11-03 12:18:08 -05:00