Giter Site home page Giter Site logo

libmesode's Introduction

libmesode's People

Contributors

andrey-starodubtsev avatar arcriley avatar boothj5 avatar changeway avatar cicku avatar cwtitan avatar dlo avatar dustin avatar fabianfreyer avatar flosse avatar fpeterschmitt avatar ghimli avatar ingenthr avatar ittner avatar jubalh avatar kassak avatar luiscuriel avatar melo avatar metajack avatar mmuman avatar mwild1 avatar pasis avatar rillian avatar sizeofvoid avatar sjaeckel avatar stanson-ch avatar talisein avatar tdi avatar tleguern avatar tusharsb avatar

Stargazers

 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

libmesode's Issues

[windows] libmesode_la-sock.lo Error 1

I'm running Windows 10 with babun and the pact packet manager. I succefully installed all dependencies and followed the build instructions.

$ git clone https://github.com/boothj5/libmesode.git
$ cd libmesode
$ ./bootstrap.sh
$ ./bootstrap.sh
$ ./configure --prefix=/usr
$ make                                                                 /cygdrive/c/Users/tristank/Documents/code/git/github/profanity/libmesode
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DPACKAGE_NAME=\"libmesode\" -DPACKAGE_TARNAME=\"libmesode\" -DPACKAGE_VERSION=\"0.9.0\" -DPACKAGE_STRING=\"libmesode\ 0.9.0\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmesode\" -DVERSION=\"0.9.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.     -I.  -g -O2 -MT src/libmesode_la-sock.lo -MD -MP -MF src/.deps/libmesode_la-sock.Tpo -c -o src/libmesode_la-sock.lo `test -f 'src/sock.c' || echo './'`src/sock.c
libtool: compile:  gcc -DPACKAGE_NAME=\"libmesode\" -DPACKAGE_TARNAME=\"libmesode\" -DPACKAGE_VERSION=\"0.9.0\" "-DPACKAGE_STRING=\"libmesode 0.9.0\"" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libmesode\" -DVERSION=\"0.9.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I. -g -O2 -MT src/libmesode_la-sock.lo -MD -MP -MF src/.deps/libmesode_la-sock.Tpo -c src/sock.c  -DDLL_EXPORT -DPIC -o src/.libs/libmesode_la-sock.o
src/sock.c: In function ‘sock_set_keepalive’:
src/sock.c:98:45: error: ‘TCP_KEEPALIVE’ undeclared (first use in this function)
         ret = setsockopt(sock, IPPROTO_TCP, TCP_KEEPALIVE, &timeout, sizeof(timeout));
                                             ^
src/sock.c:98:45: note: each undeclared identifier is reported only once for each function it appears in
Makefile:1250: recipe for target 'src/libmesode_la-sock.lo' failed
make: *** [src/libmesode_la-sock.lo] Error 1

Tests fail without static libraries

When building libmesode (v0.10.1) from source, with --disable-static configure-flag, the build fails with following errors:

test_hash.c:(.text+0x7e): undefined reference to `hash_new'
ld: test_hash.c:(.text+0xe2): undefined reference to `hash_add'
ld: test_hash.c:(.text+0x10d): undefined reference to `hash_num_keys'
ld: test_hash.c:(.text+0x168): undefined reference to `hash_add'
ld: test_hash.c:(.text+0x185): undefined reference to `hash_num_keys'
ld: test_hash.c:(.text+0x1b1): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x23b): undefined reference to `hash_add'
ld: test_hash.c:(.text+0x247): undefined reference to `hash_clone'
ld: test_hash.c:(.text+0x274): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x2d1): undefined reference to `hash_iter_new'
ld: test_hash.c:(.text+0x2fb): undefined reference to `hash_iter_next'
ld: test_hash.c:(.text+0x331): undefined reference to `hash_iter_next'
ld: test_hash.c:(.text+0x352): undefined reference to `hash_iter_next'
ld: test_hash.c:(.text+0x373): undefined reference to `hash_iter_release'
ld: test_hash.c:(.text+0x37f): undefined reference to `hash_release'
ld: test_hash.c:(.text+0x399): undefined reference to `hash_drop'
ld: test_hash.c:(.text+0x3b3): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x3dc): undefined reference to `hash_drop'
ld: test_hash.c:(.text+0x3f6): undefined reference to `hash_drop'
ld: test_hash.c:(.text+0x410): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x439): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x45e): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x484): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x49c): undefined reference to `hash_release'
collect2: error: ld returned 1 exit status

OpenSSL has removed access to X509 struct members

This causes breakage when compiling against the latest OpenSSL.

src/tls_openssl.c: In function ‘_x509_to_tlscert’:
src/tls_openssl.c:180:2: error: ‘alg_nid’ undeclared (first use in this function)
  alg_nid = OBJ_obj2nid(cert->sig_alg->algorithm);
  ^~~~~~~
src/tls_openssl.c:180:2: note: each undeclared identifier is reported only once for each function it appears in
src/tls_openssl.c:180:28: error: dereferencing pointer to incomplete type ‘X509 {aka struct x509_st}’
  alg_nid = OBJ_obj2nid(cert->sig_alg->algorithm);

release clarification

Hi,

I understood it like libmesode will always be at the same stage as libstrophe, just without the windows stuff.
I saw that libstrophe has a release 0.9.2 out since a while. Any plans about libmesode?

Switch to 0.10.0 version

Hi,
In the configure.ac file, the version number is still AC_INIT([libmesode], [0.9.3], [[email protected]]), instead of I suppose AC_INIT([libmesode], [0.10.0], [[email protected]]) according to the tag number of the master branch. Is it correct to switch to this version number, which seems to be required by profanity?
Thanks for your job on both pieces of software!

./configure failing - cannot find openssl (despite it being installed)

Running configure results in these last few lines before failing:

checking for openssl... no
checking openssl/ssl.h usability... no
checking openssl/ssl.h presence... no
checking for openssl/ssl.h... no
configure: error: openssl not found; openssl required

I did check and openssl is installed on the system.
openssl: /usr/bin/openssl /usr/share/man/man1/openssl.1ssl.gz

Are there any other packages it would depend on? On Debian Testing.
4.17.0-3-amd64 #1 SMP Debian 4.17.17-1 (2018-08-18) x86_64 GNU/Linux

Logging xmpp_send_raw

When the following function is called, the stanza is not logged as with xmpp_send() and xmpp_send_raw_string()

void xmpp_send_raw(xmpp_conn_t * const conn, const char * const data, const size_t len);

Add this to upstream (libstrophe) and merge to libmesode.

Not building with openssl 1.1

Getting the following errors when building with openssl 1.1:

[   68s] src/tls_openssl.c: In function '_x509_to_tlscert':
[   68s] src/tls_openssl.c:171:32: error: dereferencing pointer to incomplete type 'X509 {aka struct x509_st}'
[   68s]   int alg_nid = OBJ_obj2nid(cert->cert_info->key->algor->algorithm);
[   68s]                                 ^~
[   68s] src/tls_openssl.c: In function 'verify_callback':
[   68s] src/tls_openssl.c:206:26: warning: passing argument 1 of 'sk_X509_pop_free' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
[   68s]          sk_X509_pop_free(sk, X509_free);
[   68s]                           ^~
[   68s] In file included from /usr/include/openssl/crypto.h:29:0,
[   68s]                  from /usr/include/openssl/comp.h:16,
[   68s]                  from /usr/include/openssl/ssl.h:47,
[   68s]                  from src/tls_openssl.c:21:
[   68s] /usr/include/openssl/x509.h:97:1: note: expected 'struct stack_st_X509 *' but argument is of type 'const struct stack_st_X509 *'
[   68s]  DEFINE_STACK_OF(X509)
[   68s]  ^
[   68s] src/tls_openssl.c:212:26: warning: passing argument 1 of 'sk_X509_pop_free' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
[   68s]          sk_X509_pop_free(sk, X509_free);
[   68s]                           ^~
[   68s] In file included from /usr/include/openssl/crypto.h:29:0,
[   68s]                  from /usr/include/openssl/comp.h:16,
[   68s]                  from /usr/include/openssl/ssl.h:47,
[   68s]                  from src/tls_openssl.c:21:
[   68s] /usr/include/openssl/x509.h:97:1: note: expected 'struct stack_st_X509 *' but argument is of type 'const struct stack_st_X509 *'
[   68s]  DEFINE_STACK_OF(X509)
[   68s]  ^
[   68s] src/tls_openssl.c:234:26: warning: passing argument 1 of 'sk_X509_pop_free' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
[   68s]          sk_X509_pop_free(sk, X509_free);
[   68s]                           ^~
[   68s] In file included from /usr/include/openssl/crypto.h:29:0,
[   68s]                  from /usr/include/openssl/comp.h:16,
[   68s]                  from /usr/include/openssl/ssl.h:47,
[   68s]                  from src/tls_openssl.c:21:
[   68s] /usr/include/openssl/x509.h:97:1: note: expected 'struct stack_st_X509 *' but argument is of type 'const struct stack_st_X509 *'
[   68s]  DEFINE_STACK_OF(X509)

Building libstrophe on the other hand works fine.

example/basic segfaults during tls_start()

xmpp DEBUG sock_connect to jabber.kiev.ua:5222 returned 3
xmpp DEBUG attempting to connect to jabber.kiev.ua
xmpp DEBUG connection successful
conn DEBUG SENT: <?xml version="1.0"?><stream:stream to="jabber.kiev.ua" xml:lang="en" version="1.0" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
xmpp DEBUG RECV: <stream:stream id='4220094456' from='jabber.kiev.ua' version='1.0' lang='en'>
xmpp DEBUG RECV: <features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><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="myyYuD7G/jr9pzEG08BbJNWU3ug=" 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
TLS DEBUG STACK
TLS DEBUG SUBJECT : /CN=jabber.kiev.ua
TLS DEBUG ISSUER  : /O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/[email protected]
TLS DEBUG ENDSTACK
TLS DEBUG ERROR: unable to get local issuer certificate
Segmentation fault (core dumped)
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007f25250118d5 in verify_callback (preverify_ok=0, x509_ctx=0x7ffc030ebf70) at src/tls_openssl.c:205
#2  0x00007f2524a9983e in X509_verify_cert () from /usr/lib64/libcrypto.so.1.0.0
#3  0x00007f2524dd1eb8 in ssl_verify_cert_chain () from /usr/lib64/libssl.so.1.0.0
#4  0x00007f2524dad7cb in ssl3_get_server_certificate () from /usr/lib64/libssl.so.1.0.0
#5  0x00007f2524db250e in ssl3_connect () from /usr/lib64/libssl.so.1.0.0
#6  0x00007f2524dbbce7 in ssl23_connect () from /usr/lib64/libssl.so.1.0.0
#7  0x00007f2525011b9c in tls_start (tls=0x25a1cd0) at src/tls_openssl.c:288
#8  0x00007f252500437a in conn_tls_start (conn=0x259dbf0) at src/conn.c:777
#9  0x00007f2525000a0f in _handle_proceedtls_default (conn=0x259dbf0, stanza=0x25a1c80, userdata=0x0) at src/auth.c:290
#10 0x00007f25250063fe in handler_fire_stanza (conn=0x259dbf0, stanza=0x25a1c80) at src/handler.c:101
#11 0x00007f2525004c1d in _handle_stream_stanza (stanza=0x25a1c80, userdata=0x259dbf0) at src/conn.c:1031
#12 0x00007f2525013289 in _end_element (userdata=0x259dd40, name=0x25a1e20 "urn:ietf:params:xml:ns:xmpp-tls\037proceed") at src/parser_expat.c:157
#13 0x00007f2524731994 in doContent () from /usr/lib64/libexpat.so.1
#14 0x00007f2524732951 in contentProcessor () from /usr/lib64/libexpat.so.1
#15 0x00007f25247348df in XML_ParseBuffer () from /usr/lib64/libexpat.so.1
#16 0x00007f2525013542 in parser_feed (parser=0x259dd40, 
    chunk=0x7ffc030ec6f0 "<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>xml:ns:xmpp-tls'/><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><mechanisms xmlns='urn:ietf:params:xml:n"..., 
    len=50) at src/parser_expat.c:247
#17 0x00007f2525005eea in xmpp_run_once (ctx=0x259db30, timeout=1) at src/event.c:287
#18 0x00007f252500608e in xmpp_run (ctx=0x259db30) at src/event.c:339
#19 0x0000000000400f72 in main (argc=3, argv=0x7ffc030ed868) at examples/basic.c:102

The problem is that a callback is NULL somewhere. Application must not crash even if there is an error with certificate.

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.