xmpp_conn_set_flags() and xmpp_conn_get_flags() unify interface of
connection configuration.
This interface allows compile-time check of supported features or even
run-time check. Therefore, applications can be built with older
libstrophe which doesn't support some optional flags.
* Exit from tls_start() on fatal errors. If SSL_connect() fails and
returns -1 this leads to endless loop in case of fatal error.
* Don't set writefds on SSL_ERROR_WANT_READ. Otherwise, this makes
select(2) exit immediately what leads to CPU usage.
* Clear conn->secured and conn->tls_failed. These values could be
saved after re-connect.
* conn is not secured if conn->tls is NULL. This condition handles
disconnected connections.
sha1.c contains symbols that overlap with libcrypto. This patch
fixes linking with libstrophe as static library.
Prefix crypto_ will help to group other crypto API in the future.
The arguments of AC_ARG_WITH are (package, help-string, [action-if-given], [action-if-not-given]).
action-if-given takes effect when the flag is given in **either** form (--with or --without).
The proper code for action-if-given would thus be with_libxml2=$withval, which is already the default.
Thus leaving this argument empty is the proper course of action.
cf. https://autotools.io/autoconf/arguments.html
This pseudo-random number generator solves problem with
platform-independent generation of randomized nonces.
Current implementation uses weak entropy, especially when
kernel.randomize_va_space = 0. But it can be improved by
adding new sources to xmpp_rand_reseed().
New internal API introduced:
xmpp_rand_new
xmpp_rand_free
xmpp_rand
xmpp_rand_bytes
xmpp_rand_nonce
The use of 0xff as a separator for libexpat only works on arch where
char is defined as an unsigned char. This is an unportable behaviour.
Before this patch this is what I experienced:
xmpp DEBUG sock_connect to im.bouledef.eu:5222 returned 3
xmpp DEBUG attempting to connect to im.bouledef.eu
xmpp DEBUG connection successful
conn DEBUG SENT: <?xml version="1.0"?><stream:stream to="bouledef.eu" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
conn ERROR Server did not open valid stream.
xmpp DEBUG Closing socket.
DEBUG: disconnected
event DEBUG Stopping event loop.
xmpp DEBUG RECV: <http://etherx.jabber.org/streamsÿfeatures><urn:ietf:params:xml:ns:xmpp-tlsÿstarttls><urn:ietf:params:xml:ns:xmpp-tlsÿrequired/></urn:ietf:params:xml:ns:xmpp-tlsÿstarttls></http://etherx.jabber.org/streamsÿfeatures>
event DEBUG Event loop completed.
name = http://etherx.jabber.org/streamsÿstream