dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

27 Commits

Author SHA1 Message Date
mmichelson c3c2e5edfd Add IPv6 to Asterisk.
This adds a generic API for accommodating IPv6 and IPv4 addresses
within Asterisk. While many files have been updated to make use of the
API, chan_sip and the RTP code are the files which actually support
IPv6 addresses at the time of this commit. The way has been paved for
easier upgrading for other files in the near future, though.

Big thanks go to Simon Perrault, Marc Blanchet, and Jean-Philippe Dionne
for their hard work on this.

(closes issue #17565)
Reported by: russell
Patches: 
      asteriskv6-test-report.pdf uploaded by russell (license 2)

Review: https://reviewboard.asterisk.org/r/743



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@274783 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-08 22:08:07 +00:00
russell 4349aaed67 Resolve more compiler warnings on FreeBSD.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253540 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-20 12:03:07 +00:00
dvossel 397755f1ce swap openssl with OpenSSL in warning message.
(issue #16673)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246981 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-16 21:03:34 +00:00
dvossel f7c1c60e23 warning message if openssl support is missing while attempting tls connection
(closes issue #16673)
Reported by: michaesc
Patches:
      tls_error_msg.diff uploaded by dvossel (license 671)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246980 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-16 20:54:48 +00:00
dvossel 226347511b SIP TCP/TLS: move client connection setup/write into tcp helper thread, various related locking/memory fixes.
What this patch fixes
1.Moves sip TCP/TLS connection setup into the TCP helper thread:
  Connection setup takes awhile and before this it was being
  done while holding the monitor lock.
2.Moves TCP/TLS writing to the TCP helper thread:  Through the
  use of a packet queue and an alert pipe, the TCP helper thread
  can now be woken up to write data as well as read data.
3.Locking error: sip_xmit returned an XMIT_ERROR without giving
  up the tcptls_session lock.  This lock has been completely removed
  from sip_xmit and placed in the new sip_tcptls_write() function.
4.Memory leak:  When creating a tcptls_client the tls_cfg was alloced
  but never freed unless the tcptls_session failed to start.  Now the
  session_args for a sip client are an ao2 object which frees the
  tls_cfg on destruction.
5.Pointer to stack variable: During sip_prepare_socket the creation
  of a client's ast_tcptls_session_args was done on the stack and
  stored as a pointer in the newly created tcptls_session.  Depending
  on the events that followed, there was a slight possibility that
  pointer could have been accessed after the stack returned.  Given
  the new changes, it is always accessed after the stack returns
  which is why I found it.

Notable code changes
1.I broke tcptls.c's ast_tcptls_client_start() function into two
  functions.  One for creating and allocating the new tcptls_session,
  and a separate one for starting and handling the new connection.
  This allowed me to create the tcptls_session, launch the helper
  thread, and then establish the connection within the helper thread.
2.Writes to a tcptls_session are now done within the helper thread.
  This is done by using an alert pipe to wake up the thread if new
  data needs to be sent.  The thread's sip_threadinfo object contains
  the alert pipe as well as the packet queue.
3.Since the threadinfo object contains the alert pipe, it must now be
  accessed outside of the helper thread for every write (queuing of a
  packet).  For easy lookup, I moved the threadinfo objects from a
  linked list to an ao2_container.

(closes issue #13136)
Reported by: pabelanger
Tested by: dvossel, whys

(closes issue #15894)
Reported by: dvossel
Tested by: dvossel

Review: https://reviewboard.asterisk.org/r/380/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225445 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 19:55:51 +00:00
dvossel 3f2a26dd7b fixes tcptls_session memory leak caused by ref count error
(closes issue #15939)
Reported by: dvossel

Review: https://reviewboard.asterisk.org/r/375/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220365 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-24 20:37:20 +00:00
dvossel 0f6a1e66b9 SIP option to specify outbound TLS/SSL client protocol.
chan_sip allows for outbound TLS connections, but does not allow the user to specify what protocol to use (default was SSLv2, and still is if this new option is not specified).  This patch lets the user pick the SSL/TLS client method for outbound connections in sip.

(closes issue #14770)
Reported by: TheOldSaint

(closes issue #14768)
Reported by: TheOldSaint

Review: http://reviewboard.digium.com/r/240/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191177 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 21:13:43 +00:00
dvossel cfa021cb17 Consistent SSL/TLS options across conf files
ast_tls_read_conf() is a new api call for handling SSL/TLS options across all conf files.  Before this change, SSL/TLS options were not consistent.  http.conf and manager.conf required the 'ssl' prefix while sip.conf used options with the 'tls' prefix.  While the options had different names in different conf files, they all did the exact same thing.  Now, instead of mixing 'ssl' or 'tls' prefixes to do the same thing depending on what conf file you're in, all SSL/TLS options use the 'tls' prefix.  For example.  'sslenable' in http.conf and manager.conf is now 'tlsenable' which matches what already existed in sip.conf. Since this has the potential to break backwards compatibility, previous options containing the 'ssl' prefix still work, but they are no longer documented in the sample.conf files.  The change is noted in the CHANGES file though.

Review: http://reviewboard.digium.com/r/237/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191028 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 14:39:48 +00:00
dvossel 1d52218463 TLS/SSL private key option
Adds option to specify a private key .pem file when configuring TLS or SSL in AMI, HTTP, and SIP.  Before this, the certificate file was used for both the public and private key.  It is possible for this file to hold both, but most configurations allow for a separate private key file to be specified.  Clarified in .conf files how these options are to be used.  The current conf files do not explain how the private key is handled at all, so without knowledge of Asterisk's TLS implementation, it would be hard to know for sure what was going on or how to set it up.

Review: http://reviewboard.digium.com/r/234/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190545 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-24 21:22:31 +00:00
jpeeler 5a0a55b7a4 Add Doxygen documentation for API changes from 1.6.0 to 1.6.1
Copied from my review board description:
This is a continuation of the API changes documentation started for describing
changes between releases. Most of the API changes were pretty simple needing
only to be brought to attention via the new "Asterisk API Changes" list.
However, if you see anything that needs further explanation feel free to
supplement what is there. The current method of documenting is to add (in the
header file): \version <ver number> <description of changes> and then to add
the function to the change list in doxyref.h on the AstAPIChanges page. I also
made sure all the functions that were newly added were tagged with \since
1.6.1. I think this is a good habit to start both for the historical aspect as
well as for the future ability to easily add a "New Asterisk API" page.

Review: http://reviewboard.digium.com/r/190/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180719 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-09 20:58:17 +00:00
tilghman 82c1e379ca When using a socket as a FILE *, the stdio functions will sometimes try to do
an fseek() on the stream, which is an invalid operation for a socket.  Turning
off buffering explicitly lets the stdio functions know they cannot do this,
thus avoiding a potential error.
(closes issue #14400)
 Reported by: fnordian
 Patches: 
       tcptls.patch uploaded by fnordian (license 110)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173458 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-04 18:48:06 +00:00
russell d5caf2765c Fix a regression in TCP support.
This patch fixes a problem that caused chan_sip to think that every open TCP session
was to a remote address of 0.0.0.0:0.

(closes issue #14287)
Reported by: jamesgolovich
Patches:
      bug-14287.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@169620 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-21 10:26:07 +00:00
twilson d2601c379a Fix qualify for TCP peer
(closes issue #14192)
Reported by: pabelanger
Patches: 
      asterisk-bug14192.diff.txt uploaded by jamesgolovich (license 176)
Tested by: jamesgolovich


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@169080 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-17 01:56:36 +00:00
tilghman a41b34a63c Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13 08:36:35 +00:00
russell be5e3b45ae Rename a number of tcptls_session variables. There are no functional changes here.
The name "ser" was used in a lot of places.  However, it is a relic from when
the struct was a server_instance, not a session_instance.  It was renamed since
it represents both a server or client connection.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163670 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-12 18:45:03 +00:00
kpfleming 2b799006a1 cleaup of the TCP/TLS socket API:
1) rename 'struct server_args' to 'struct ast_tcptls_session_args', to follow coding guidelines

2) make ast_make_file_from_fd() static and rename it to something that indicates what it really is for (again coding guidelines)

3) rename address variables inside 'struct ast_tcptls_session_args' to be more descriptive (dare i say it... coding guidelines)

4) change ast_tcptls_client_start() to use the new 'remote_address' field of the session args for the destination of the connection, and use the 'local_address' field to bind() the socket to the proper source address, if one is supplied

5) in chan_sip, ensure that we pass in the PP address we are bound to when creating outbound (client) connections, so that our connections will appear from the correct address



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@151101 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-19 19:11:28 +00:00
oej b8439e4fb9 Highlightning even more bugs in the current tcp/tls implementation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@148473 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-13 15:49:01 +00:00
bbryant 83c055874a Fix a crash in tcp and tls connections related to reference counts.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@123692 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-18 20:07:56 +00:00
bbryant 720a492e88 Updates all usages of ast_tcptls_session_instance to be managed by reference counts so that they only get destroyed when all threads are done using
them, and memory does not get free'd causing strange issues with SIP. 

This code was originally written by russellb in the team/group/issue_11972/ branch.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@123546 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-17 21:46:57 +00:00
russell f5ce5710ec Rename ast_tcptls_server_instance to session_instance, since this pertains to
server and client usage.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@108295 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-12 22:13:18 +00:00
russell de432dde0b add a destroy API call for a server instance
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105804 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04 22:28:03 +00:00
russell c2841b668a More public API name changes to use an appropriate ast_ prefix
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105785 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04 22:23:21 +00:00
russell 8ef91aad9e Rename public object server_instance to ast_tcptls_server_instance
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105773 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04 22:15:18 +00:00
mmichelson 8ceb053cff Get rid of any remaining ast_verbose calls in the code in favor of
ast_verb

(closes issue #11934)
Reported by: mvanbaak
Patches:
      20080205_astverb-2.diff.txt uploaded by mvanbaak (license 7)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@102525 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-05 23:00:15 +00:00
russell bcbed075d0 Fix tcptls build when openssl isn't installed
(closes issue #11813)
Reported by: tzafrir
Patches:
      asterisk-tcptls.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@99922 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-23 17:35:54 +00:00
oej 21363e1a63 Doxygen updates
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@99464 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-22 08:58:46 +00:00
russell d6e19bdc91 Merge changes from team/group/sip-tcptls
This set of changes introduces TCP and TLS support for chan_sip.  There are various
new options in configs/sip.conf.sample that are used to enable these features.  Also,
there is a document, doc/siptls.txt that describes some things in more detail.

This code was implemented by Brett Bryant and James Golovich.  It was reviewed
by Joshua Colp and myself.  A number of other people participated in the testing
of this code, but since it was done outside of the bug tracker, I do not have their
names.  If you were one of them, thanks a lot for the help!

(closes issue #4903, but with completely different code that what exists there.)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@99085 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-18 22:04:33 +00:00