Commit Graph

464 Commits

Author SHA1 Message Date
Dmitry Podgorny
d2efc85ce3 Makefile.am: refactoring
Put filenames to separated lines to simplify adding/removing new files.
Add missed files to EXTRA_DIST.
2017-06-23 17:00:26 +03:00
Dmitry Podgorny
940d76e9e2 rpm: update dependencies 2017-06-23 16:57:27 +03:00
Dmitry Podgorny
59eb8d67ed ChangeLog: mention significant changes since 0.9.1 2017-06-23 16:55:31 +03:00
Dmitry Podgorny
78592650e5 tls/schannel: reflect changes of the tls interface
tls_new() accepts xmpp_conn_t object now.
2017-06-23 15:37:09 +03:00
Alexander Krotov
92d006a41b Disable hostname verification for pre-1.0.2 OpenSSL 2017-06-23 13:45:24 +03:00
Alexander Krotov
0741820711 Verify certificate hostname when using OpenSSL (fixes #100) 2017-06-23 03:00:26 +03:00
Alexander Krotov
c9ddc2b7ef Make tls_new accept xmpp_conn_t 2017-06-23 02:59:05 +03:00
Alexander Krotov
f776b34d8c Fix tls_openssl.c indentation 2017-06-22 19:44:41 +03:00
Alexander Krotov
f47609c1f0 Disable insecure SSL/TLS versions 2017-06-20 22:44:39 +03:00
Alexander Krotov
443b4d3116 Use more variables in bot.c message_handler()
to avoid calling the same function twice.
2017-06-20 01:38:53 +03:00
Steffen Jaeckel
4cf7a0cb79 split travis build into multiple jobs 2017-04-04 18:25:27 +02:00
Dmitry Podgorny
9a5fe8b96d handler: allow to add same handler callback with different userdata
According to #97. A single callback can distinguish different cases
using the userdata. Current implementation doesn't allow to delete a
particular couple (handler, userdata), but rather deletes all handlers
regardless of the userdata.
2017-03-24 22:38:16 +02:00
Dmitry Podgorny
80a7ea0b7c Fix spacing in handler.c 2016-12-02 16:56:45 +02:00
Dmitry Podgorny
1092447edf Fix spacing in c++ files 2016-09-27 15:40:08 +03:00
Dmitry Podgorny
d2c1daf4d5 Fix spacing in ctx.c and common.h 2016-09-27 15:14:38 +03:00
Dariusz Dwornikowski
d1a41c9d7d Fixed occurred spelling error fixes: #96 2016-09-23 08:31:31 +02:00
Dmitry Podgorny
9931ad4fa2 Updated ChangeLog
- Fixed bug #95 (DNS lookup failing on Cygwin)
- Removed dependency on the check package
0.9.1
2016-09-16 01:10:25 +03:00
Dmitry Podgorny
5a1f282292 README: remove mention of the check dependency 2016-09-16 01:07:21 +03:00
Dmitry Podgorny
b360316b8b tests/resolver: added test case with pointers 2016-09-16 01:01:43 +03:00
Dmitry Podgorny
c6aaa96dcb resolver: fixed few bugs
Fixed a bug which caused resolver to return a wrong target name with a
missed ".". The bug was in the part of message_name_get() where a pointer
is handled.
Added checks for buffer overflow.
Added 2 test cases to check a corner case and error handling.
2016-09-15 19:26:10 +03:00
Dmitry Podgorny
f0706f56c4 tests: remove dependency on check package
Only check_parser depends on the check. Convert it. All tests will be
rewritten at once when new testsuite is implemented.
2016-09-15 12:46:11 +03:00
James Booth
4ef2740c36 Update version to 0.9.1 2016-09-14 19:53:25 +01:00
Dmitry Podgorny
5e0330f0ad libstrophe 0.9.0
See ChangeLog for significant changes or follow the link to see all the
changes:
  https://github.com/strophe/libstrophe/compare/0.8.8...strophe:0.9.0
0.9.0
2016-09-14 18:55:48 +03:00
Dmitry Podgorny
717a19859f doc: describe parameters to suppress doxygen warnings 2016-09-14 18:54:40 +03:00
Dmitry Podgorny
209f21905e Update Doxyfile
Updated Doxyfile with doxygen -u. Removed DOT_FONTNAME. Changed version
to 0.9.
2016-09-14 18:52:20 +03:00
Dmitry Podgorny
38aa05624d Add warning about disabled TLS in build-android.sh
OpenSSL or BoringSSL will be added to build-android.sh in the future.
But for now users need to build libstrophe with openssl manually if
they use ndk-build system.
2016-09-14 18:12:47 +03:00
Dmitry Podgorny
136055024e conn: update documentation for xmpp_connect_raw() 2016-09-14 17:49:10 +03:00
Michael Vetter
8d3f3d837a Remove trailing dots from changelog
Without the trailing dots it looks more coherent to me.
2016-09-14 14:21:18 +02:00
Dmitry Podgorny
151debf7ee stanza: remove inline keyword from _render_update()
Let compiler make decisions about static funcions. Also we don't need to
support workarounds for specific compilers.
2016-09-08 15:04:34 +03:00
Dmitry Podgorny
d8da993a73 Don't write outside a buffer boundary
When xmpp_vsnprintf() received count == 0 it still performs write to the
buffer. This leads to a write outside allocated memory, when
xmpp_stanza_to_text() parses a specific stanza. Because of error in
_render_update() writing exactly buflen+1 with xmpp_snprintf() is counted
as valid operation and next xmpp_snprintf will be performed to a buffer
with zero length. This leads to wrong rendering of 1024-length stanzas
and invalid write for specific larger stanzas:

==22436== Invalid write of size 1
==22436==    at 0x4E4B3A1: xmpp_vsnprintf (snprintf.c:709)
==22436==    by 0x4E4B479: xmpp_snprintf (snprintf.c:722)
==22436==    by 0x4E4C011: _render_stanza_recursive (stanza.c:328)
==22436==    by 0x4E4C3B3: _render_stanza_recursive (stanza.c:384)
==22436==    by 0x4E4C3B3: _render_stanza_recursive (stanza.c:384)
==22436==    by 0x4E4C3B3: _render_stanza_recursive (stanza.c:384)
==22436==    by 0x4E4C3B3: _render_stanza_recursive (stanza.c:384)
==22436==    by 0x4E4C3B3: _render_stanza_recursive (stanza.c:384)
==22436==    by 0x4E4C4E5: xmpp_stanza_to_text (stanza.c:435)
==22436==    by 0x4E407A8: _handle_stream_stanza (conn.c:1157)
==22436==    by 0x4E4EF2B: _end_element (parser_expat.c:157)
==22436==    by 0x571005A: doContent (in /usr/lib64/libexpat.so.1.6.2)
==22436==  Address 0x63b95b0 is 0 bytes after a block of size 1,024 alloc'd
==22436==    at 0x4C2BFE0: malloc (vg_replace_malloc.c:299)
==22436==    by 0x4E41947: _malloc (ctx.c:116)
==22436==    by 0x4E41A54: xmpp_alloc (ctx.c:204)
==22436==    by 0x4E4C4A3: xmpp_stanza_to_text (stanza.c:428)
==22436==    by 0x4E407A8: _handle_stream_stanza (conn.c:1157)
==22436==    by 0x4E4EF2B: _end_element (parser_expat.c:157)
==22436==    by 0x571005A: doContent (in /usr/lib64/libexpat.so.1.6.2)
==22436==    by 0x57109FB: contentProcessor (in ...
==22436==    by 0x5712A9F: XML_ParseBuffer (in ...
==22436==    by 0x4E4F1E7: parser_feed (parser_expat.c:247)
==22436==    by 0x4E42BBC: xmpp_run_once (event.c:284)
==22436==    by 0x4E42D62: xmpp_run (event.c:336)

Fix xmpp_vsnprintf() and _render_update() behaviour.
2016-09-08 14:52:36 +03:00
Dmitry Podgorny
72173087a9 conn: move _disconnect_cleanup() to other static functions
Also remove trailing spaces.
2016-09-06 22:17:24 +03:00
Dmitry Podgorny
229215b49c conn: xmpp_conn_open_stream() sends user-supplied tag
Default opening tag doesn't allow to implement XEP-0174. In this case
client needs to send specific attributes. As solution user passes
attributes that are sent inside opening tag. Previous variant of this
function is renamed to xmpp_conn_open_stream_default().

The way to pass attributes is not the best one, but it's used to conform
existent interface of xmpp_stanza_get_attributes().

Remove "raw" suffix from functions that work with a raw connection.
2016-09-06 22:06:29 +03:00
Fredrik Fornwall
dd7aeff5d2 Avoid trying to link against libresolv for Android
Android does not have a separate libresolv library.
2016-09-06 01:24:26 +02:00
Dmitry Podgorny
3e95806d2e conn: suppress gcc warning
gcc with -O3 flag reports that 'host' and 'port' can be uninitialised.
But this is not true. Suppress the message.
2016-09-05 11:51:24 +03:00
Tim Nieradzik
7ad42add73 test_string: Fix failing strdup test
`rc` may be initialised with -1.
2016-09-05 09:11:55 +03:00
Garick Hamlin
936ddb0d15 Compute correct send_queue_len.
Previously this was incremented, but not decremented.  I've corrected
the code to decrement it.  It doesn't appear to be used anywhere, but
it is helpful to implement xmpp_graceful_stop().
2016-09-04 03:37:56 +03:00
Dmitry Podgorny
233094af10 tests/parser: include string.h explicitly 2016-09-04 03:35:28 +03:00
Dmitry Podgorny
94e84f0643 README: add travis status icon 2016-09-04 02:17:03 +03:00
Dmitry Podgorny
8662611a34 travis-ci: remove make install 2016-09-04 02:16:19 +03:00
Dmitry Podgorny
60e6c191e9 README: mention about pkg-config dependency 2016-09-04 02:06:26 +03:00
Dmitry Podgorny
211170822f Integrate with Travis-CI 2016-09-04 02:05:00 +03:00
Dmitry Podgorny
c80f99bc68 tests: add tests for string functions 2016-09-04 00:53:24 +03:00
Dmitry Podgorny
53e44aa0e3 util: added strtok_r implementation for old compilers
Visual studios older than 2005 don't have strtok_s() and according to
MSDN vs2005 has NOT thread-safe strtok().
2016-09-04 00:34:26 +03:00
Dmitry Podgorny
2b249130c9 ChangeLog: mention that xmpp_conn_t is reusable 2016-09-03 17:10:26 +03:00
Dmitry Podgorny
84fa4466ee conn: clear authenticated flag on reset 2016-09-03 17:09:21 +03:00
Dmitry Podgorny
beaaab5742 tls_schannel: don't force RC4 for TLS handshake
Leave default configuration. A particular server closes tcp connection
during negotiation otherwise.

tls_schannel is still broken and tls_read() fails with
SEC_E_UNSUPPORTED_FUNCTION error.
2016-09-03 16:38:43 +03:00
Dmitry Podgorny
f351d62355 tests/jid: fixed crash on QNX
QNX version of printf() doesn't check whether a string is valid or not.
Passing NULL pointer leads to a crash inside strlen(). Fix this with a
wrapper _s() which returns "<NULL>" for instead of NULL pointer.
Add checks before strcmp() to avoid crash in case of unexpected result
of the jid functions.
2016-09-02 19:57:25 +03:00
Dmitry Podgorny
b6fcb7035d rand: replace time() with time_stamp() as entropy source
time_stamp() has bigger precision.
2016-09-02 17:38:42 +03:00
Dmitry Podgorny
c0a224cf84 Remove const in parser_free() declaration
To match the definitions.
2016-09-02 17:10:51 +03:00
Dmitry Podgorny
384ef8023e auth: coding style 2016-09-02 17:10:14 +03:00