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)
RFC6120 states that client SHOULD send the "from" attribute in <stream>.
Because of privacy concerns attribute "from" should be sent only after
TLS negotiation. This step ensures that the server is verified by its
certificate and protects JID from MITM attack.
Fixes#163.
Also should be helpful for #162.
Const variables in prototypes don't add much value, but make the code
larger and redundant. Remove these const keywords.
Note, this doesn't apply to pointers to const memory.
Make it possible to reset password to NULL. It is not required for
ANONYMOUS authentication. Also, report an error and disconnect if
password is not set and libstrophe should try authentication mechanisms
other than ANONYMOUS.
ctx.c contains a workaround for systems without va_copy() support.
Improve this workaround in the way which is described in the autoconf
manual.
Also check for va_copy declaration in configure time.
Fixes#160.