634 Commits

Author SHA1 Message Date
Dmitry Podgorny
2d5424bcff Release libstrophe-0.10.1 0.10.1 2020-12-24 16:04:21 +02:00
Dmitry Podgorny
5792d52461 doxygen: set correct version number 2020-12-19 02:33:14 +02:00
Dmitry Podgorny
09229e2cd5 conn: remove extra ; symbol 2020-10-07 20:18:20 +03:00
Dmitry Podgorny
c07ac0a68d conn: don't crash when user sets password to NULL
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.
2020-09-30 20:56:52 +03:00
Dmitry Podgorny
60ce94c267 auth: add missed space in log message 2020-09-30 20:43:32 +03:00
Dmitry Podgorny
99f2d4fe54 travis-ci: build libstrophe against LibreSSL 2020-09-24 15:07:15 +03:00
Dmitry Podgorny
acced31192 tls/openssl: Fix undefined error codes for LibreSSL
LibreSSL doesn't define all error codes which OpenSSL defines. Wrap them
with #ifndef.

Reference: https://bugs.gentoo.org/744127
2020-09-24 13:34:49 +03:00
Dmitry Podgorny
9ee08f8f2a Release libstrophe-0.10.0 0.10.0 2020-09-16 00:27:34 +03:00
Dmitry Podgorny
7c1061ccbb autotools: remove rpm files 2020-09-16 00:27:34 +03:00
Dmitry Podgorny
7eab7c3f5e Android: add missed files and -DHAVE_DECL_VA_COPY 2020-09-16 00:21:01 +03:00
Dmitry Podgorny
4d93b6c0d6 Check for va_copy declaration
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.
2020-09-16 00:07:41 +03:00
Dmitry Podgorny
65b3a0996f README: mention about license 2020-09-15 03:14:54 +03:00
Dmitry Podgorny
4dd78be10d tls/openssl: fix compilation with older openssl
Not all error codes are present in older versions of openssl.
2020-09-15 03:07:02 +03:00
Dmitry Podgorny
8c076ac969 stanza: remove attribute xmlns in xmpp_stanza_reply() 2020-09-15 02:21:18 +03:00
Dmitry Podgorny
7c68aced35 stanza: add xmpp_stanza_reply_error()
This function makes an error reply stanza as described in
https://tools.ietf.org/html/rfc6120#section-8.3
2020-09-15 02:19:20 +03:00
Dmitry Podgorny
197896ba1b tls/openssl: improve logging
Log error names and codes to increase verbosity in debug mode.
2020-06-18 22:18:59 +03:00
Dmitry Podgorny
bef411f319 sha1: fix zeroing storage
Compilers remove dead assignments in optimization phase. But SHA1 code
uses them for wiping of sensitive data.  Fix this with the trick used
by openssl.
2020-06-18 22:14:04 +03:00
Dmitry Podgorny
7f5ce7d2ae sha1: remove SHA1HANDSOFF
We don't support configuration when SHA1 functions overwrite user's
data. So remove this code not to confuse.
2020-06-19 00:51:33 +03:00
Dmitry Podgorny
47e27c837a examples/basic: add new conn flags
Add options:
  --trust-tls
  --legacy-auth
2020-06-07 20:43:41 +03:00
Dmitry Podgorny
50a4a983cd handler: add documentation for global timed handlers 2020-06-06 00:11:24 +03:00
Dmitry Podgorny
428681a185 stanza: add xmpp_stanza_new_from_string()
This function creates a stanza object from a string. The string must
contain a single complete stanza. Multiple stanzas will lead to memory
leak and this is not handled in the patch.
2020-06-04 03:44:21 +03:00
Dmitry Podgorny
3dcc5a60f2 Introduce global timed handlers
There are situations when applications need more predictable timed
handlers that don't depend on connection status. Other usecase of
the global handlers is to manage offline connections, for example,
reconnect after a disconnection.
2020-06-03 02:11:40 +03:00
Dmitry Podgorny
cba21b5598 examples/register: replace getline() with fgets()
getline(3) doesn't exist on all systems.
2020-05-31 22:05:21 +03:00
Dmitry Podgorny
a65dd1059d resolver: don't build legacy win32 code with c-ares
Fix ifdef macros to exclude legacy win32 code when it is not needed.
2020-05-31 21:43:09 +03:00
Dmitry Podgorny
7c83eb0efa windows: rewrite headers in lower case
Otherwise, compilation fails on systems that are case sensitive.

Reference: #159.
2020-05-31 21:03:44 +03:00
Steffen Jaeckel
f2c658723f clean-up 2020-04-30 12:03:57 +02:00
Dmitry Podgorny
7ac4b1cc12 Update ChangeLog 2020-04-29 00:24:42 +03:00
Dmitry Podgorny
1c4cb66f5a conn: remove ternary operator
Remove ternary operator where it is redundant.
2020-04-28 23:40:46 +03:00
Dmitry Podgorny
6a50c9cea6 ChangeLog: mention about fixed IPv6 issue 2020-04-02 22:14:15 +03:00
Dmitry Podgorny
37b12ad788 configure: enable check for snprintf()
b2e64587 adds the check but it is commented for unknown reason. Enable
it to use advantage of system snprintf() implementation.
2020-04-02 22:12:30 +03:00
Dmitry Podgorny
5530ac690f rpm: remove libstrophe.spec
Major Linux distributions have added libstrophe to their repositories.
We don't have to support our own spec file. If someone needs spec to
build rpm manually, refer to Linux distributions, for example:

https://build.opensuse.org/package/show/network/libstrophe
https://copr-dist-git.fedorainfracloud.org/cgit/linkdupont/fedora-link-extras/libstrophe.git
2020-04-02 19:38:52 +03:00
Dmitry Podgorny
3063d886bd sasl: remove unused argument
_add_key() is a static function which is used only for DIGEST_MD5. Its
argument 'len' is not used and remains 0. Remove it.
2020-03-31 18:58:36 +03:00
Oleg Synelnykov
198bdd77d0 Remove -Wno-unused-parameter
Introduced UNUSED macro with cast to void in commoh.h for internal
use. Used cast to void directly in those files which do not
include common.h. Although this change doesn't fix semantic issues
with unused function parameters, it does explicitly mark all those
places, which might require attention in future.
2020-03-31 17:37:12 +03:00
Dmitry Podgorny
20c039fdb8 sock: replace sockaddr with sockaddr_storage
sockaddr structure may be insufficient to hold IPv6 address. Replace it
with sockaddr_storage structure.

Fixes #153.
2020-03-31 16:29:09 +03:00
Dmitry Podgorny
c92fc849e7 Remove C++ files
Libstrophe used to provide incomplete C++ API which missed connection
class and wasn't supported for a long time. Remove this API.
2020-02-22 23:19:40 +02:00
Dmitry Podgorny
6fdac3ae72 tests/sha512: add test case for a million of a 2020-01-31 01:59:42 +02:00
Dmitry Podgorny
623ff164de tests/scram: add HMAC test vector
Add test for HMAC and make other tests independent from SHA1.
2020-01-31 01:59:42 +02:00
Dmitry Podgorny
faa46d28a5 scram: fix HMAC-SHA-512
HMAC was originally implemented for SHA1 digest according to RFC2104.
The RFC defined blocksize for all digests as 64 bytes. But RFC4868
requires blocksize for SHA384/SHA512 to be 128 bytes.

Extend HMAC implementation to support variable blocksize and fix it for
SHA384/SHA512.
2020-01-31 01:59:42 +02:00
Dmitry Podgorny
1ca10fd167 Fix SASL SCRAM implementation
* Add SCRAM_DIGEST_SIZE macro for maximum possible digest size. It will
  avoid new buffer overflow errors when new digests are added.
* Fix buffer overflow in sasl_scram(). Buffers were allocated for SHA1
  digest size.
* Fix bug with handler re-registration when a SASL SCRAM mechanism
  fails.
2020-01-31 01:59:42 +02:00
Steffen Jaeckel
709e41fd10 add SHA256&SHA512 tests 2020-01-31 01:59:42 +02:00
Steffen Jaeckel
771d5865ae add SCRAM-SHA-256 and SCRAM-SHA-512 support 2020-01-31 01:59:42 +02:00
Steffen Jaeckel
fc064bc883 re-factor SCRAM to be independent of the hash 2020-01-31 01:34:23 +02:00
Steffen Jaeckel
2ca2fcfedd add stripped-down & slightly-modified version of LibTomCrypt SHA512 2020-01-31 01:34:09 +02:00
Steffen Jaeckel
d78b02ee24 add stripped-down & slightly-modified version of LibTomCrypt SHA256 2020-01-31 01:33:51 +02:00
Steffen Jaeckel
2a94a49cef add required LibTomCrypt load/store functions 2020-01-31 01:32:45 +02:00
Dmitry Podgorny
562a06425b Unify coding style
@sjaeckel integrated clang-format with formal coding style. Run his
script and commit changes.

There are pros and cons of this commit.

Mixed coding style is a "broken window". A good single style simplifies
reading and writing code.

On the other hand, this is a big change which will lead to conflicts.
2020-01-31 01:16:50 +02:00
Steffen Jaeckel
eef07cef36 add code style check to travis 2020-01-31 01:14:32 +02:00
Steffen Jaeckel
2e21d5a021 add new format make target 2020-01-31 01:14:32 +02:00
Steffen Jaeckel
abd1b08a97 trim trailing spaces 2020-01-31 01:14:32 +02:00
Steffen Jaeckel
3feed16e2e ignore eclipse related stuff 2020-01-31 01:14:32 +02:00