The cache is stored per connection object and is cleared on
* entry of wrong password
* release of connection object
* successful connection
It can be configured that libstrophe retries the password entry in case
the user entered a wrong password.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
In order to be able to load password-protected key files a password
callback was added.
This also adds support for PKCS#12 containers instead of certificate+key.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
The registered callback function will be called before connect() is
called on the socket, allowing tweaking of much more than just keepalive
settings.
This deprecates xmpp_conn_set_keepalive().
Includes helper/example callback function to set default keepalive
parameters that some library users may find useful.
In order to do proper deprecation of those API's we re-introduce them
so they can be removed in the next release. This will then also lead to
an ABI bump.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
In case a pointer to itself was received, the resolver looped inifinitely
until the stack overflows.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
In case this ifdef-elseif-chain falls back to the else path, the macro
to `clock()` wasn't defined.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
examples/perf.c: In function ‘perf_rand’:
examples/perf.c:42:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (size_t sz = 2; sz <= alloc_sz; sz <<= 1) {
src/handler.c: In function 'handler_system_delete_all':
src/handler.c:706:25: warning: 'key2' may be used uninitialized in this function [-Wmaybe-uninitialized]
hash_add(conn->id_handlers, key2, head);
This also re-defines that `make release` does the release of all tarballs
and will run the tests against them.
Latest LibreSSL test is also marked non-essential, as it tends to fail
from time to time ...
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Removal of `rand.h` is a fixup of
118087f2a1
Somehow autotools manages to know that all those files must be
included in a release, no need to track them manually.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Instead of using the internal DRBG-based RNG, use the `getrandom()` system
call where available.
Keep the existing version as fall-back for other systems that don't provide
that system call.
... and for cases where auto-detection fails or the user simply wants to
use the internal RNG a new configure-switch is provided.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* `release` creates the tarballs
* `test-release` takes the tarballs, extracts them, builds the library
and tests and runs the tests
* `docs` run doxygen
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
... to provide an easier way to find long paths.
After looking at some code in profanity-im/profanity#1605 I thought this
could help to make libstrophe-user code easier to write (and read).
Initially it started off as `xmpp_stanza_get_child_by_xpath()` but then
I was annoyed when it came to handling all those potential corner cases
like e.g. escaping URL's in the ns ... so here we go with a
vararg approach :)
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
`hash_iter_next()` returns a pointer to an element of the data structure
which is persistent and not altered while calling `hash_iter_next()`.
Therefor we don't have to dup the string, but simply can remember the
pointer.
In the case where the element would be `hash_drop()`'ped which contains
the key, the key is not accessed after it has been free'd.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>