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>
Based on the differences to libmesode this functionality has been added.
It allows a library-user to set a callback for cases where the TLS stack
can't verify a received certificate and let the end-user decide what to
do.
examples/basic implements an example handler of said functionality.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This adds a new API function xmpp_ctx_set_verbosity() to set increased
verbosity levels.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
While reading through the code this seemed logical to do.
I haven't seen this occuring in the wild!
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This returns early in case
1. no log handler is set
2. the default log handler is set and the log level would result in nothing
being printed.
No need to snprintf() and whatnot if there's no consumer.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Put sending of data into its own function which takes ownership of the
data and therefor minimizes the number of allocations and frees.
This also slightly improves error handling and printing of debug
information.
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
If parser has an unfinished stanza with depth > 1, it can happen that
parser->stanza points to a child. Releasing the child doesn't free the
parent stanza.
Instead of releasing parser->stanza in parser_reset() and parser_free(),
find the top most parent and release the whole tree. Also add a test
case for this memory leak.
- add gnutls option
- fix style stage: 'matrix' and 'jobs' don't work together
- switch to Ubuntu 20.04 (focal), because there is issue with
gnutls-3.4.10 from Ubuntu 16.04 (see #177)