448 Commits

Author SHA1 Message Date
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
Dmitry Podgorny
f44232762e tls/schannel: remove unused variable 2016-09-02 17:09:47 +03:00
Dmitry Podgorny
111659cc91 ctx: add workaround for ms compilers without va_copy support 2016-09-02 15:22:31 +03:00
Dmitry Podgorny
4ae4b8c94b event: suppress warning about type overflow 2016-09-02 15:22:14 +03:00
Dmitry Podgorny
2b2de142ef tests/resolver: fix the test and add new testcase
It was broken because of changed API.
2016-09-02 12:45:28 +03:00
Dmitry Podgorny
a45af3a929 resolver: srv_rr_list can be uninitialised
Resolver assumes that srv_rr_list is empty at the beginning. Make it so
explicitly and let user pass uninitialised list as argument.
2016-09-02 12:39:10 +03:00
Dmitry Podgorny
3e77afb27e Fix type mismatch
Backported from NetXMS project.
2016-09-02 11:59:54 +03:00
Dmitry Podgorny
0c60e8d384 tls_openssl: coding style 2016-09-02 00:49:32 +03:00
Dmitry Podgorny
2bff3f8722 conn: unify error codes for API functions
Return error code from strophe.h instead of -1.
2016-09-02 00:49:32 +03:00
Dmitry Podgorny
dc56737b71 conn: implemented xmpp_connect_raw()
This function is similar to xmpp_connect_client(), but doesn't perform
authentication. Instead, it calls user's connection handler immediately
after establishing the connection. Hence, user can implement own
authendication or registration procedures.

Such a "raw" connection can be useful when user interaction is required
(e.g. Data Forms in XEP-0077, OAuth2).
2016-09-02 00:47:58 +03:00
Dmitry Podgorny
3869906357 Fixed spacing in event.c 2016-08-30 23:35:17 +03:00
Dmitry Podgorny
75b19be572 unify _sleep() macro in event.c 2016-08-30 19:43:05 +03:00
Dmitry Podgorny
b0a1842a53 examples/bot: fix memory leaks and use stanza helpers 2016-08-30 15:32:10 +03:00
Dmitry Podgorny
14066d0bff resolver: fix commit 171b285 2016-08-29 20:09:45 +03:00
Chih-Wei Chen
171b285cbe sock : Add DNS-SRV list sorted by priority and weight, check result connection. 2016-08-29 11:32:20 +03:00
Dmitry Podgorny
f46cf669a3 Android: added make files 2016-08-22 15:52:31 +03:00
James Booth
09e5103eee Update ChangeLog 2016-08-22 13:10:23 +01:00