Coder Social home page Coder Social logo

libstrophe's People

Contributors

andrey-starodubtsev avatar boothj5 avatar botovq avatar changeway avatar cwtitan avatar cybertailor avatar dustin avatar fabianfreyer avatar flosse avatar fpeterschmitt avatar hoelzro avatar ingenthr avatar jubalh avatar kassak avatar luiscuriel avatar madprogrammer avatar melo avatar metajack avatar mmuman avatar mwild1 avatar nosnilmot avatar pasis avatar rillian avatar sharjeelaziz avatar sizeofvoid avatar sjaeckel avatar stanson-ch avatar tdi avatar tleguern avatar tusharsb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libstrophe's Issues

Installation on beaglebone Black fails

I tried to install libstrophe on a Beaglebone Black (Debian GNU/Linux 8.6 (jessie) Release: 8.6). Openssl was installed:
OpenSSL> version
OpenSSL 1.0.1t 3 May 2016
(error?? I tried to install 1.0.2g)
but ./Configure fails. It gives :
Checking for openssl/ssl.h... no
configure: error: openssl not found; openssl required
What to do?

C++ example

As its not trivial to see which functions are encapsulated into the classes and which ones are not, please provide an example for C++

DNS lookup failing on Cygwin

$ ./examples/basic.exe [email protected] <password>
xmpp DEBUG sock_connect() to hermes2jabber.org:5222 returned -1
xmpp DEBUG sock_connect() to hermes2v6jabber.org:5222 returned -1

It seems the . is missing in between the host name and domain. Manually passing the server hermes2.jabber.org connects successfully.

0.8.7 release

I'd like to do a 0.8.7 release tag since latest development now contains the SCRAM-SHA-1 support, which would be very useful for my client.

If there are no objections in the next week or so, I'll add the tag.

Schannel tls implementation doesn't work

TLSS DEBUG QuerySecurityPackageInfo() success
TLSS DEBUG AcquireCredentialsHandle() success
conn DEBUG SENT: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG handle proceedtls called for proceed
xmpp DEBUG proceeding with TLS
TLSS DEBUG QuerySecurityPackageInfo() success
TLSS DEBUG AcquireCredentialsHandle() success
conn DEBUG Couldn't start TLS! error -3 tls_error -2146893032

-2146893032 (0x80090318) is SEC_E_INCOMPLETE_MESSAGE and returned by the second call of InitializeSecurityContextA():

ret = tls->sft->InitializeSecurityContextA(&(tls->hcred), &(tls->hctxt), name,

Build fails when running parallel make

When running a parallel make (in my case make -j8), the build fails with the following message:

    /bin/sh ./libtool  --tag=CC   --mode=link gcc -I. -I/usr/local/Cellar/expat/2.1.0/include  -g -O2 -lssl -lcrypto -lz  -L/usr/local/Cellar/expat/2.1.0/lib -lexpat   -o libstrophe.la -rpath /usr/local/lib src/libstrophe_la-auth.lo src/libstrophe_la-conn.lo src/libstrophe_la-ctx.lo src/libstrophe_la-event.lo src/libstrophe_la-handler.lo src/libstrophe_la-hash.lo src/libstrophe_la-jid.lo src/libstrophe_la-md5.lo src/libstrophe_la-sasl.lo src/libstrophe_la-sha1.lo src/libstrophe_la-snprintf.lo src/libstrophe_la-sock.lo src/libstrophe_la-stanza.lo src/libstrophe_la-thread.lo src/libstrophe_la-tls_openssl.lo src/libstrophe_la-util.lo src/libstrophe_la-parser_expat.lo   -lresolv
    /bin/sh ./libtool  --tag=CC   --mode=link gcc -I. -g -O2   -o examples/active examples/examples_active-active.o -lstrophe -L/usr/local/Cellar/expat/2.1.0/lib -lexpat  -lssl -lcrypto -lz   -lresolv
    /bin/sh ./libtool  --tag=CC   --mode=link gcc -I. -g -O2   -o examples/roster examples/examples_roster-roster.o -lstrophe -L/usr/local/Cellar/expat/2.1.0/lib -lexpat  -lssl -lcrypto -lz   -lresolv
    /bin/sh ./libtool  --tag=CC   --mode=link gcc -I. -g -O2   -o examples/basic examples/examples_basic-basic.o -lstrophe -L/usr/local/Cellar/expat/2.1.0/lib -lexpat  -lssl -lcrypto -lz   -lresolv
    /bin/sh ./libtool  --tag=CC   --mode=link gcc -I. -g -O2   -o examples/bot examples/examples_bot-bot.o -lstrophe -L/usr/local/Cellar/expat/2.1.0/lib -lexpat  -lssl -lcrypto -lz   -lresolv
    libtool: link: gcc -I. -g -O2 -o examples/active examples/examples_active-active.o  -lstrophe -L/usr/local/Cellar/expat/2.1.0/lib -lexpat -lssl -lcrypto -lz -lresolv
    libtool: link: gcc -I. -g -O2 -o examples/basic examples/examples_basic-basic.o  -lstrophe -L/usr/local/Cellar/expat/2.1.0/lib -lexpat -lssl -lcrypto -lz -lresolv
    libtool: link: gcc -I. -g -O2 -o examples/roster examples/examples_roster-roster.o  -lstrophe -L/usr/local/Cellar/expat/2.1.0/lib -lexpat -lssl -lcrypto -lz -lresolv
    libtool: link: gcc -I. -g -O2 -o examples/bot examples/examples_bot-bot.o  -lstrophe -L/usr/local/Cellar/expat/2.1.0/lib -lexpat -lssl -lcrypto -lz -lresolv
    ld: library not found for -lstrophe
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    libtool: link: gcc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libstrophe.0.dylib  src/.libs/libstrophe_la-auth.o src/.libs/libstrophe_la-conn.o src/.libs/libstrophe_la-ctx.o src/.libs/libstrophe_la-event.o src/.libs/libstrophe_la-handler.o src/.libs/libstrophe_la-hash.o src/.libs/libstrophe_la-jid.o src/.libs/libstrophe_la-md5.o src/.libs/libstrophe_la-sasl.o src/.libs/libstrophe_la-sha1.o src/.libs/libstrophe_la-snprintf.o src/.libs/libstrophe_la-sock.o src/.libs/libstrophe_la-stanza.o src/.libs/libstrophe_la-thread.o src/.libs/libstrophe_la-tls_openssl.o src/.libs/libstrophe_la-util.o src/.libs/libstrophe_la-parser_expat.o   -lssl -lcrypto -lz -L/usr/local/Cellar/expat/2.1.0/lib -lexpat -lresolv  -O2   -install_name  /usr/local/lib/libstrophe.0.dylib -compatibility_version 1 -current_version 1.0 -Wl,-single_module
    make: *** [examples/active] Error 1
    make: *** Waiting for unfinished jobs....
    ld: library not found for -lstrophe
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ld: library not found for -lstrophe
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ld: library not found for -lstrophe
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [examples/roster] Error 1
    make: *** [examples/basic] Error 1
    make: *** [examples/bot] Error 1
    libtool: link: (cd ".libs" && rm -f "libstrophe.dylib" && ln -s "libstrophe.0.dylib" "libstrophe.dylib")
    libtool: link: ar cru .libs/libstrophe.a  src/libstrophe_la-auth.o src/libstrophe_la-conn.o src/libstrophe_la-ctx.o src/libstrophe_la-event.o src/libstrophe_la-handler.o src/libstrophe_la-hash.o src/libstrophe_la-jid.o src/libstrophe_la-md5.o src/libstrophe_la-sasl.o src/libstrophe_la-sha1.o src/libstrophe_la-snprintf.o src/libstrophe_la-sock.o src/libstrophe_la-stanza.o src/libstrophe_la-thread.o src/libstrophe_la-tls_openssl.o src/libstrophe_la-util.o src/libstrophe_la-parser_expat.o
    libtool: link: ranlib .libs/libstrophe.a
    libtool: link: ( cd ".libs" && rm -f "libstrophe.la" && ln -s "../libstrophe.la" "libstrophe.la" )

The problem here seems to be that the examples are already being built when the libstrophe library build hasn't finished yet.

ooconnection.cpp missing

blocking #24
the C++ API is defining 3 classes in the strohepp.h
2 of them are implemented: Context and Stanza, but Connection is missing.
Did you just forget to git add the file?

Update source file headers not to point to LICENSE.txt

Now, every source file points to license in LICENSE.txt. This prevents using files from libstrophe outside the libstrophe. My suggestion is to change this to put there a whole LICENSE.txt text in every file.

Example (was):

 /* handler.c
 ** strophe XMPP client library -- event handler management
 **
 ** Copyright (C) 2005-2009 Collecta, Inc. 
 **
 **  This software is provided AS-IS with no warranty, either express
 **  or implied.
 **
 **  This software is distributed under license and may not be copied,
 **  modified or distributed except as expressly authorized under the
 **  terms of the license contained in the file LICENSE.txt in this
 **  distribution.
 */

To:

 /* handler.c
 ** strophe XMPP client library -- event handler management
 **
 ** Copyright (C) 2005-2009 Collecta, Inc. 
 **
 **  This software is provided AS-IS with no warranty, either express
 **  or implied.
 **
 ** This program is dual licensed under the MIT and GPLv3 licenses.
 */

Debian Stretch compilation error (OpenSSL 1.1.0)

Master branch can't compile:

src/tls_openssl.c:66:5: error: ‘ERR_remove_state’ is deprecated [-Werror=deprecated-declarations]
ERR_remove_state(0);

make: *** [src/libstrophe_la-tls_openssl.lo] Error 1

Release 0.9.0

Proposing to do the 0.8.9 release, mainly so I can release Profanity against the new version.

@pasis is there anything else you'd like to add, or would you be happy for me to tag?

TLS error, 6

I get this error:
xmpp DEBUG Unrecoverable TLS error, 6.
xmpp DEBUG Closing socket.

Can't compile with OpenSSL in a staged directory

I'm trying to build Strophe in isolation on my build server and need to build all dependencies as part of my build process. This includes OpenSSL. When I try to compile strophe, it's detecting that OpenSSL is available, but it isn't updating the CFLAGS to handle the includes. Patch is below

--- libstrophe-0.8.7/Makefile.am 2014-10-30 22:13:49.000000000 -0400
+++ libstrophe-0.8.7_new/Makefile.am 2015-05-15 10:40:39.739164777 -0400
@@ -6,6 +6,7 @@
PARSER_CFLAGS=@PARSER_CFLAGS@
PARSER_LIBS=@PARSER_LIBS@

+SSL_CFLAGS = @openssl_CFLAGS@
SSL_LIBS = @openssl_LIBS@

STROPHE_FLAGS = -I$(top_srcdir)
@@ -14,7 +15,7 @@

Main build targets

lib_LTLIBRARIES = libstrophe.la

-libstrophe_la_CFLAGS = $(STROPHE_FLAGS) $(PARSER_CFLAGS)
+libstrophe_la_CFLAGS = $(STROPHE_FLAGS) $(SSL_CFLAGS) $(PARSER_CFLAGS)
libstrophe_la_LDFLAGS = $(SSL_LIBS) $(PARSER_LIBS)

Export only public API

libstrophe_la_LDFLAGS += -export-symbols-regex '^xmpp_'

How about moving to cmake?

I wrote cmake build script for my fork of libstrophe.
Would you like to have it here?
It would make vs2008 directory obsolette, will add support of other targets.

Libstrophe segfaults when mechanisms not supported

I update the bug as suggested by @pasis . On my system with libssl 1.0.1i-2, everything compiled with -fstack-protector (Debian jessie amd64) and gcc 4.9, libstrophe segfaults in this place as mentioned. I tested it with gtalk, as well as dukgo.com accounts, so it is not the fault of unsupported mechanisms (X-OUATH2, and so on).

I tested it with profanity, as well as basic.c from examples/ in libstrophe's src. gdb's bt gives just this:

   (gdb) bt
   #0  uw_frame_state_for (context=context@entry=0x7fffffffb8e0, fs=fs@entry=0x7fffffffb9d0) at   ../../../src/libgcc/unwind-dw2.c:1253
   #1  0x00007ffff63636f8 in _Unwind_Backtrace (trace=0x7ffff790bdc0 <backtrace_helper>, trace_argument=0x7fffffffbb90) at ../../../src/libgcc/unwind.inc:290
    #2  0x00007ffff790bf36 in __GI___backtrace (array=<optimized out>, size=64) at ../sysdeps/x86_64/backtrace.c:109
    #3  0x00007ffff7838d62 in backtrace_and_maps (do_abort=-134227568, do_abort@entry=2, written=6, fd=8) at ../sysdeps/unix/sysv/linux/libc_fatal.c:47
   #4  0x00007ffff788c38f in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ffff797ca55 "*** %s ***: %s terminated\n") at ../sysdeps/posix/libc_fatal.c:172
     #5  0x00007ffff790f4b7 in __GI___fortify_fail (msg=msg@entry=0x7ffff797ca3d "stack smashing detected") at fortify_fail.c:31
  #6  0x00007ffff790f480 in __stack_chk_fail () at stack_chk_fail.c:28
    #7  0x00007ffff72bd70f in ssleay_rand_add (buf=0x7fffffffc6f0, num=32, add=32) at md_rand.c:329
     #8  0x00007fff00000000 in ?? ()
    #9  0x00007fffffffc600 in ?? ()
      #10 0x00007fffffffc6d0 in ?? ()
     #11 0x00007fffffffc520 in ?? ()
    12 0x00003c5bf7fce150 in ?? ()
     #13 0x0001000100000008 in ?? ()
        #14 0x00007ffff71e4bf0 in ?? () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
      #15 0x0000000000000005 in ?? ()
      #16 0x0000000000000409 in ?? ()
       #17 0x0000000000000001 in ?? ()
       #18 0x00000000000021b6 in ?? ()
          #19 0x0000000000000000 in ?? ()

But I pinpointed that libssl crashes in ssleay_rand_add. Maintainers of libssl claim that this must be libstrophe's fault, not libssl, and I tend to agree on that.

Naming conflict with FreeRDP (tls_read, ...)

My project links to both freerdp libraries as well as libstrophe, and both define the following calls:

tls_read
tls_write
tls_new
tls_free

The files in question are:

libstrophe/src/tls.h
freerdp/include/freerdp/crypto/tls.h

It would be great if we could resolve this between the two projects.

Sent data handler, or socket/tls write error handling

Seems that there is one thing missed in xmpp_run_once.

xmpp_send just put data into send queue and immidiately returns, so it can't return the result of actual socket/tls write.

If connection error occur while xmpp_run_once sends queued data, there are no way to find out what data from the queue was sent and what was not. Also, there are no way for queue with unsent data to survive reconnect, since connection queue uses the same queue for authorisation etc, so, you have to release connection and connect again loosing send queue without possibility to save it somehow.

There must be some notification about error with possibility to save unsent data, or, in better case allow a callback (handler) for "queued data item sent successfully" event with a pointer to sent data, just before xmpp_free(ctx, sq->data);. In latter case application can mark data as sent/unsent and try to resend something in case of reconnect.

I can try to write some patch for this, but not shure what is the right solution.

No "forwarding" of memory handler functions to libexpat

When creating the parser context, the memory functions set when creating the xmpp-context is not forwarded to libexpat. This causes libexpat to use regular malloc/realloc/free instead, which is a issue in projects where you must use custom allocators.

I realize problematic to solve, as memory functions are xmpp-context dependent. But maybe implementing a way to set a global memory functions (more or less a configurable default xmpp_mem_t) could solve this (which would then be forwarded to libexpat via calling XML_ParserCreate_MM instead of XML_ParserCreateNS)

Tests are broken due to hiding symbols in dynamic library

make check can't build a test because linker doesn't see internal symbols in libstrophe.so. As solution we can build tests with all sources instead of using library:

tests_check_parser_SOURCES = tests/check_parser.c tests/test.h $(STROPHE_SRC)
tests_check_parser_CFLAGS = @check_CFLAGS@ $(STROPHE_FLAGS) $(STROPHE_DEP_FLAGS) \
        -I$(top_srcdir)/src
tests_check_parser_LDADD = @check_LIBS@ $(STROPHE_DEP_LIBS)

Also make check builds only tests/check_parser.c. Maybe we should enable all other tests.

Increased memory problems

When I use xmpp disconnect server then connect server, and repeat This operation for more then 3 times,I found that memory increased ,anybody know why,please tell,thanks a lot。

xmpp_run() Unrecoverable TLS error, 5.

--
one time : success
reconnect : xmpp_run() crash

[DEBUG] XMPP: Unrecoverable TLS error, 5.
[DEBUG] XMPP: Closing socket.

break point :
xmpp_run(ctx)
crash

gcc 5
ubuntu 16.04
FCM(google cloud push)
pthread

XMPP_CONN_FLAG_LEGACY_SSL

Vala support

Is there a possibility to add vala support? It should be enough providing a *.vapi file.

xml parsing uses a lot of memory.(expat)

Xml parsing uses a lot of memory.
For example, feed parser to 300 bytes of text, xml parsing uses more than 10k bytes.
This behavior caused by character detection mechanism of expat.
Expat don't detects character at once. Characters are detected little by little(1 character~) so a group of text has meny stanza information.
Stanza information is sufficient if one for a group of text.

Compile Error (GCC 7, implicit-fallthrough)

Hi, I get some compile errors with gcc. Maybe disable 'implicit-fallthrough' by default for the build or fix this proper.

gcc (GCC) 7.1.1 20170528
Copyright (C) 2017 Free Software Foundation, Inc.

src/snprintf.c: In Funktion »dopr«:
src/snprintf.c:288:8: Fehler: diese Anweisung könnte durchfallen [-Werror=implicit-fallthrough=]
flags |= DP_F_UP;
^
src/snprintf.c:289:7: Anmerkung: hier
case 'x':
^~~~
src/snprintf.c:308:8: Fehler: diese Anweisung könnte durchfallen [-Werror=implicit-fallthrough=]
flags |= DP_F_UP;
^
src/snprintf.c:309:7: Anmerkung: hier
case 'e':
^~~~
src/snprintf.c:316:8: Fehler: diese Anweisung könnte durchfallen [-Werror=implicit-fallthrough=]
flags |= DP_F_UP;
^
src/snprintf.c:317:7: Anmerkung: hier
case 'g':
^~~~

Cross Compile Cannot find ssl.h

I've tried to set the library paths and even modify src/tls.openssl.c to point to the ssl.h file with no joy. Any hints?

src/tls_openssl.c:24:25: error: openssl/ssl.h: No such file or directory

Thanks,

-R

Disabled SSL certificate verify

Hi developers:
Nowadays we made a large scale security static analysis on several open source projects, and found some mistakes in libstrophe-0.8.8. In the @src/Tls_openssl.c:68:
tls_t *tls_new(xmpp_ctx_t *ctx, sock_t sock)
{
tls_t *tls = xmpp_alloc(ctx, sizeof(*tls));

if (tls) {
    int ret;
    memset(tls, 0, sizeof(*tls));

    tls->ctx = ctx;
    tls->sock = sock;
    tls->ssl_ctx = SSL_CTX_new(SSLv23_client_method());

   SSL_CTX_set_client_cert_cb(tls->ssl_ctx, NULL);
   SSL_CTX_set_mode (tls->ssl_ctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
   SSL_CTX_set_verify (tls->ssl_ctx, SSL_VERIFY_NONE, NULL);

  tls->ssl = SSL_new(tls->ssl_ctx);

[..]
}

The parameter SSL_VERIFY_NONE here can not configure this built-in certificate validation,so the handshake can continue even the cert is invalid.We recommand you use SSL_VERIFY_PEER to guarantee the security.We have send the bug report to Ubuntu launchpad,and also inform you of such news.Here are the link:
https://bugs.launchpad.net/ubuntu/+source/libstrophe/+bug/1677511

Is libstrophe thread safe

Maybe not very appropriate to post here, sorry.

After reading the examples, it seems kind of impossible to use libstrophe to maintain multiple connections at the same time, or do I miss something?

Authentication fails when password > 127 bytes

When the user's password is larger than 127 bytes authentication fails, reported at: profanity-im/profanity#686

The following log is from the basic.c example using a password of 128 bytes (all a characters). The same test with a 127 byte password (also all a characters) succeeds.

$ ./basic [email protected]/profanity aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa localhost
xmpp DEBUG Connecting via altdomain.
xmpp DEBUG sock_connect to localhost:5242 returned 3
xmpp DEBUG attempting to connect to localhost
xmpp DEBUG connection successful
conn DEBUG SENT: <?xml version="1.0"?><stream:stream to="ejabberd.local" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
xmpp DEBUG RECV: <stream:stream id='2567527740' from='ejabberd.local' version='1.0' lang='en'>
xmpp DEBUG RECV: <features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c hash="sha-1" xmlns="http://jabber.org/protocol/caps" ver="/nWL9StXSXhEsL2wg0+s4xo/UdA=" node="http://www.process-one.net/en/ejabberd/"/><register xmlns="http://jabber.org/features/iq-register"/></features>
conn DEBUG SENT: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG handle proceedtls called for proceed
xmpp DEBUG proceeding with TLS
conn DEBUG SENT: <?xml version="1.0"?><stream:stream to="ejabberd.local" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
xmpp DEBUG RECV: <stream:stream id='1764280542' from='ejabberd.local' version='1.0' lang='en'>
xmpp DEBUG RECV: <features xmlns="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c hash="sha-1" xmlns="http://jabber.org/protocol/caps" ver="/nWL9StXSXhEsL2wg0+s4xo/UdA=" node="http://www.process-one.net/en/ejabberd/"/><register xmlns="http://jabber.org/features/iq-register"/></features>
conn DEBUG SENT: <auth mechanism="SCRAM-SHA-1" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">biwsbj1sb25ncGFzc3dvcmQscj0yNmJkOTU2MDMwZDBjMzFkOWY5ZDE1OGM5OGUyNjZi</auth>
xmpp DEBUG RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cj0yNmJkOTU2MDMwZDBjMzFkOWY5ZDE1OGM5OGUyNjZiaEtwRmplZDBGRHlaZUV4SDdHUXVvZz09LHM9ekNrTUZUanBxd1RjYlZKUFp3blViZz09LGk9NDA5Ng==</challenge>
xmpp DEBUG handle SCRAM-SHA-1 (challenge) called for challenge
conn DEBUG SENT: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">Yz1iaXdzLHI9MjZiZDk1NjAzMGQwYzMxZDlmOWQxNThjOThlMjY2YmhLcEZqZWQwRkR5WmVFeEg3R1F1b2c9PSxwPXAwaHE2UHpyRlpBSmxtbEo4VzArV2MrN004az0=</response>
xmpp DEBUG RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><bad-auth/></failure>
xmpp DEBUG handle SCRAM-SHA-1 (challenge) called for failure
xmpp DEBUG SASL SCRAM-SHA-1 auth failed
conn DEBUG SENT: <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
xmpp DEBUG RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">bm9uY2U9IjI1MDU1MDY1MDgiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
xmpp DEBUG handle digest-md5 (challenge) called for challenge
conn DEBUG SENT: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9ImxvbmdwYXNzd29yZCIscmVhbG09ImVqYWJiZXJkLmxvY2FsIixub25jZT0iMjUwNTUwNjUwOCIsY25vbmNlPSJlYzE2NTk0MmM0NmQiLG5jPTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvZWphYmJlcmQubG9jYWwiLHJlc3BvbnNlPTFkZmJlM2U1OGY5MDIxZDRmMzY2ZGVhNzliNDRlYjA4LGNoYXJzZXQ9dXRmLTg=</response>
xmpp DEBUG RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
xmpp DEBUG handle digest-md5 (rspauth) called for failure
xmpp DEBUG SASL DIGEST-MD5 auth failed
conn DEBUG SENT: <auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">AGxvbmdwYXNzd29yZABhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhj4+Pj4+Pj4+Pj4+PUlJSUlJSUlK8vLy8BwcHBwcHBwcHBwcHERERERERERFEREREaGhoaA==</auth>
xmpp DEBUG RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>
xmpp DEBUG SASL PLAIN auth failed
conn DEBUG SENT: <iq id="_xmpp_auth1" type="set"><query xmlns="jabber:iq:auth"><username>longpassword</username><password>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaRRRRRRRR������������DDDDhhhh</password><resource>profanity</resource></query></iq>
xmpp DEBUG RECV: <error xmlns="http://etherx.jabber.org/streams"><xml-not-well-formed xmlns="urn:ietf:params:xml:ns:xmpp-streams"/></error>
xmpp DEBUG RECV: </stream:stream>
xmpp DEBUG Closing socket.
DEBUG: disconnected
event DEBUG Stopping event loop.
event DEBUG Event loop completed.

The final authentication attempt using jabber:iq:auth shows a corrupted password:

conn DEBUG SENT: <iq id="_xmpp_auth1" type="set"><query xmlns="jabber:iq:auth"><username>longpassword</username><password>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaRRRRRRRR������������DDDDhhhh</password><resource>profanity</resource></query></iq>

Send PUSH notification to Google Firebase server

Hi, I'm new to XMPP, I would like to use libstrophe to send the PUSH notification to google firebase server,
I'm using C++, in the C++ wrapper strophepp.h I didn't find any TLS options, it's possible use connect to server over TLS by C++ wrapper ?

Thanks

IPv6 support

Hi All,

I am working on a cross platform project which is using the libstrophe library.
The Apple just announced that starting from June 1 only apps that support IPv6 will be allowed to upload to the store. (https://developer.apple.com/news/?id=05042016a)
You can read more information here: https://developer.apple.com/library/mac/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1
I followed the DNS64/NAT64 workflow and I created an only IPv6 network.
Using this network I tried to connect to a server with the strophe, but the connection failed.
Strophe log messages:

Libstrophe Log - [xmpp], msg [Connecting via altdomain.]
Libstrophe Log - [xmpp], msg [sock_connect to <server_address> returned 6]
Libstrophe Log - [xmpp], msg [attempting to connect to <server_address>]

Strophe can't create/open the socket and the connection went to timeout.
In a normal IPv4 network everything works fine :)

I have the following questions:

  1. Does the libstrophe support IPv6?
  2. Do you have any proposal or solution how to patch the strophe to handle this situation?

I am open for suggestions.
Thanks in advance.
Szilard

Cannot add the same handler twice

Calling xmpp_handler_add twice with the same handler but different userdata doesn't work. The second call is ignored.

I need it because I'm writing a C++ wrapper for libstrophe and handlers are implemented as pure virtual classes with a static member function as xmpp_handler, which means every handler callback function has the same memory address, only the userdata changes.

XEPs and RFCs support page with version

64-bit support?

Hello libstrophe team -

Thank you for your awesome work all!

I'm a software performance tester and trying to use this library inside my loadrunner script. But my script fails compilation probably due to this library being written for 32-bit machines. Can this be true? Would it be possible to make this library work on 64-bit machines? It might be entirely possible that I'm not understanding the problem correctly, in which case please call me out.

Memory allocation error on login

Since commit 2ffb278 some logins are successfull, but some are failing with a memory allocation error.

Recreated with the basic example:

xmpp DEBUG sock_connect() to hermes2.jabber.org:5222 returned 3
xmpp DEBUG Attempting to connect to hermes2.jabber.org
xmpp DEBUG connection successful
conn DEBUG SENT: <?xml version="1.0"?><stream:stream to="jabber.org" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
xmpp DEBUG RECV: <stream:stream from='jabber.org' id='4e1aac4666044ca8' version='1.0'>
xmpp DEBUG RECV: <features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required/></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism></mechanisms></features>
conn DEBUG SENT: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
xmpp DEBUG handle proceedtls called for proceed
xmpp DEBUG proceeding with TLS
conn DEBUG SENT: <?xml version="1.0"?><stream:stream to="jabber.org" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
xmpp DEBUG RECV: <stream:stream from='jabber.org' id='041da916edabd468' version='1.0'>
xmpp DEBUG RECV: <features xmlns="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>SCRAM-SHA-1-PLUS</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>CRAM-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>LOGIN</mechanism></mechanisms></features>
conn DEBUG SENT: <auth mechanism="SCRAM-SHA-1" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">[removed]</auth>
xmpp DEBUG RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">[removed]</challenge>
xmpp DEBUG handle SCRAM-SHA-1 (challenge) called for challenge
xmpp ERROR Memory allocation error
conn DEBUG SENT: </stream:stream>
xmpp DEBUG RECV: </stream:stream>
xmpp DEBUG Closing socket.
DEBUG: disconnected
event DEBUG Stopping event loop.
event DEBUG Event loop completed.

XML namespaces not properly supported

libstrophe currently only supports using the "stream" prefix for stream namespace elements, and does not support prefixes for any other namespaces. While most XMPP software uses prefix-free canonicalization, this is not required by the XMPP spec and any software which uses prefixed namespaces will not trigger the correct handlers.

For example, the following stanza is valid XML and conforms to the XMPP spec:

<iq type='get' id='id123' to='[email protected]/balcony'>
    <v:query xmlns:v='jabber:iq:version'/>
</iq>

However, the example bot.c will not respond to the iq as libstrophe considers the v:query element to have an xmlns:v attribute, so the default handling of looking for "xmlns" to determine the namespace fails.

It is also legal according to sections 4.8.2 and 4.8.5 to use a prefix other than "stream" for the stream namespace (i.e. <s:stream xmlns:s="...">) or even prefix-free canonicalization for both the stream and the "jabber:client" namespaces. libstrophe applications fail to connect to a server that uses either of these styles.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.