Index | Thread | Search

From:
Klemens Nanni <kn@openbsd.org>
Subject:
mcabber: TLS does not work, libmouth update crashes
To:
ports@openbsd.org
Cc:
Markus Hennecke <markus-hennecke@markus-hennecke.de>
Date:
Tue, 2 Jan 2024 23:51:43 +0000

Download raw body.

Thread
Anyone successfully using mcabber?
Plain -current without config fails to connect via TLS:

	$ mcabber
	/set jid = user@example.com
	/set server = example.com
	/set password = secret
	/connect
	[00:41:16] No configuration file has been found.
	[00:41:41] Connecting to server: pimux.de
	[00:41:41]  with resource mcabber.ccd21665
	[00:41:42] Disconnected, reason: 3->'LM_DISCONNECT_REASON_ERROR'
[interleaved stderr]
	** (process:70988): WARNING **: 00:42:51.509: SSL_connect(): -1 / SSL_ERROR_SSL
	** (process:70988): WARNING **: 00:42:51.509:    error:1404E0BF:SSL routines:ST_BEFORE_CONNECT:no protocols available

'/set tls = 1' (default) makes no difference.

Updating outdated(/unmaintained/dead) loudmouth to 1.5.4 and rebuilding
mcabber only causes various different *-after-free errors, this is my
minimal reproducer

	$ mcabber
	/set jid = foo
	/set password = bar
	/connect

Do these two ports actually work still in a modern TLS world?
I looked at mcabber since it uses pledge(2), but never got a connection.
Even if now, with both PGP and OTR disabled, our port is no viable client
for end-to-end encryption these days.


Index: net/loudmouth/Makefile
===================================================================
RCS file: /cvs/ports/net/loudmouth/Makefile,v
diff -u -p -r1.31 Makefile
--- net/loudmouth/Makefile	27 Sep 2023 14:18:17 -0000	1.31
+++ net/loudmouth/Makefile	29 Dec 2023 11:30:48 -0000
@@ -1,9 +1,8 @@
 COMMENT=		lightweight Jabber client library
 
-V=			1.4.3
+V=			1.5.4
 DISTNAME=       	loudmouth-$V
-REVISION=		8
-SHARED_LIBS +=	loudmouth-1          3.0      # .1.0
+SHARED_LIBS =		loudmouth-1	3.1	# 1.0
 CATEGORIES=		net devel
 
 HOMEPAGE=       	http://groups.google.com/group/loudmouth-dev/
@@ -11,9 +10,10 @@ HOMEPAGE=       	http://groups.google.co
 # LGPLv2.1
 PERMIT_PACKAGE=	Yes
 
-WANTLIB =  crypto glib-2.0 iconv idn>=16 intl pcre2-8 pthread ssl
+WANTLIB =		crypto ffi glib-2.0 gobject-2.0 iconv idn intl pcre2-8
+WANTLIB +=		pthread ssl
 
-SITES=   	${SITE_GNOME:=sources/loudmouth/${V:C/^([0-9]+\.[0-9]+).*/\1/}/}
+SITES=			https://mcabber.com/files/loudmouth/
 EXTRACT_SUFX=   	.tar.bz2
 
 LIB_DEPENDS=		devel/glib2 \
@@ -24,6 +24,9 @@ TEST_DEPENDS=	devel/check
 CONFIGURE_STYLE=	gnu
 CONFIGURE_ARGS+=	--disable-mono \
 			--with-check=${LOCALBASE} \
+			--with-compile-warnings=yes \
 			--with-ssl=openssl
+
+SEPARATE_BUILD =	Yes
 
 .include <bsd.port.mk>
Index: net/loudmouth/distinfo
===================================================================
RCS file: /cvs/ports/net/loudmouth/distinfo,v
diff -u -p -r1.6 distinfo
--- net/loudmouth/distinfo	18 Jan 2015 03:14:42 -0000	1.6
+++ net/loudmouth/distinfo	29 Dec 2023 11:02:43 -0000
@@ -1,2 +1,2 @@
-SHA256 (loudmouth-1.4.3.tar.bz2) = lak/XQCbceqBk9mUqhHzEbwzCj7+G3zXTcSPEcf5KeM=
-SIZE (loudmouth-1.4.3.tar.bz2) = 366818
+SHA256 (loudmouth-1.5.4.tar.bz2) = McvJHB/dzFNGszc7j7RVlOnqnMf+NtBZXokSxHrZTQ0=
+SIZE (loudmouth-1.5.4.tar.bz2) = 361323
Index: net/loudmouth/patches/patch-configure
===================================================================
RCS file: /cvs/ports/net/loudmouth/patches/patch-configure,v
diff -u -p -r1.4 patch-configure
--- net/loudmouth/patches/patch-configure	11 Mar 2022 19:46:18 -0000	1.4
+++ net/loudmouth/patches/patch-configure	29 Dec 2023 11:31:35 -0000
@@ -1,18 +1,11 @@
---- configure.orig	Wed Oct 29 21:25:57 2008
-+++ configure	Tue Nov 18 12:33:20 2008
-@@ -21423,6 +21423,7 @@ cat >>conftest.$ac_ext <<_ACEOF
- 
- #include <stdio.h>
- #include <stdlib.h>
-+#include <string.h>
- 
- #include <check.h>
- 
-@@ -21532,6 +21533,7 @@ cat >>conftest.$ac_ext <<_ACEOF
- 
+Index: configure
+--- configure.orig
++++ configure
+@@ -12912,6 +12912,7 @@ else
+ #include <glib.h>
  #include <stdio.h>
  #include <stdlib.h>
 +#include <string.h>
  
- #include <check.h>
- 
+ int
+ main (void)
Index: net/loudmouth/patches/patch-loudmouth_Makefile_in
===================================================================
RCS file: net/loudmouth/patches/patch-loudmouth_Makefile_in
diff -N net/loudmouth/patches/patch-loudmouth_Makefile_in
--- net/loudmouth/patches/patch-loudmouth_Makefile_in	11 Mar 2022 19:46:18 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
---- loudmouth/Makefile.in.orig	Mon Aug  4 13:37:02 2008
-+++ loudmouth/Makefile.in	Mon Aug  4 13:37:12 2008
-@@ -306,8 +306,7 @@ libloudmouthinclude_HEADERS = \
- 
- libloudmouth_1_la_LIBADD = \
- 	$(LOUDMOUTH_LIBS)		\
--	$(LIBIDN_LIBS) \
--	-lresolv
-+	$(LIBIDN_LIBS)
- 
- libloudmouth_1_la_LDFLAGS = \
- 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
Index: net/loudmouth/patches/patch-loudmouth_lm-error_c
===================================================================
RCS file: net/loudmouth/patches/patch-loudmouth_lm-error_c
diff -N net/loudmouth/patches/patch-loudmouth_lm-error_c
--- net/loudmouth/patches/patch-loudmouth_lm-error_c	11 Mar 2022 19:46:18 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-error: #error "Only <glib.h> can be included directly."
-
---- loudmouth/lm-error.c.orig	Sun Mar 18 07:26:55 2012
-+++ loudmouth/lm-error.c	Sun Mar 18 07:27:04 2012
-@@ -19,7 +19,7 @@
-  */
- 
- #include <config.h>
--#include <glib/gerror.h>
-+#include <glib.h>
- #include "lm-error.h"
- 
- /**
Index: net/loudmouth/patches/patch-loudmouth_lm-sock_c
===================================================================
RCS file: /cvs/ports/net/loudmouth/patches/patch-loudmouth_lm-sock_c,v
diff -u -p -r1.3 patch-loudmouth_lm-sock_c
--- net/loudmouth/patches/patch-loudmouth_lm-sock_c	11 Mar 2022 19:46:18 -0000	1.3
+++ net/loudmouth/patches/patch-loudmouth_lm-sock_c	29 Dec 2023 11:09:18 -0000
@@ -1,6 +1,7 @@
---- loudmouth/lm-sock.c.orig	Sun Aug 31 13:42:29 2008
-+++ loudmouth/lm-sock.c	Sun Aug 31 13:43:08 2008
-@@ -29,7 +29,9 @@
+Index: loudmouth/lm-sock.c
+--- loudmouth/lm-sock.c.orig
++++ loudmouth/lm-sock.c
+@@ -27,7 +27,9 @@
  #include <string.h>
  #include <unistd.h>
  #include <sys/socket.h>
Index: net/loudmouth/patches/patch-loudmouth_lm-ssl-openssl_c
===================================================================
RCS file: net/loudmouth/patches/patch-loudmouth_lm-ssl-openssl_c
diff -N net/loudmouth/patches/patch-loudmouth_lm-ssl-openssl_c
--- net/loudmouth/patches/patch-loudmouth_lm-ssl-openssl_c	11 Mar 2022 19:46:18 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
---- loudmouth/lm-ssl-openssl.c.orig	Mon Jan 19 11:50:51 2009
-+++ loudmouth/lm-ssl-openssl.c	Mon Jan 19 11:51:45 2009
-@@ -305,6 +305,14 @@ _lm_ssl_initialize (LmSSL *ssl) 
- 		g_warning ("SSL_CTX_new() == NULL");
- 		abort();
- 	}
-+	/* Set the NO_TICKET option on the context to allow for talk to Google Talk 
-+	 * which apparently seems to be having a problem handling empty session 
-+	 * tickets due to a bug in Java.
-+	 *
-+	 * See http://twistedmatrix.com/trac/ticket/3463 and
-+	 * Loudmouth [#28].
-+	 */
-+	SSL_CTX_set_options (ssl->ssl_ctx, SSL_OP_NO_TICKET);
- 	/*if (access("/etc/ssl/cert.pem", R_OK) == 0)
- 		cert_file = "/etc/ssl/cert.pem";
- 	if (!SSL_CTX_load_verify_locations(ssl->ssl_ctx,
Index: net/loudmouth/patches/patch-tests-Makefile_in
===================================================================
RCS file: /cvs/ports/net/loudmouth/patches/patch-tests-Makefile_in,v
diff -u -p -r1.3 patch-tests-Makefile_in
--- net/loudmouth/patches/patch-tests-Makefile_in	11 Mar 2022 19:46:18 -0000	1.3
+++ net/loudmouth/patches/patch-tests-Makefile_in	29 Dec 2023 11:09:18 -0000
@@ -1,20 +1,21 @@
---- tests/Makefile.in.orig	Mon Aug  4 13:23:35 2008
-+++ tests/Makefile.in	Mon Aug  4 13:24:03 2008
-@@ -52,7 +52,7 @@ test_objects_LDADD = $(LDADD)
- am_test_parser_OBJECTS = test-parser.$(OBJEXT)
- test_parser_OBJECTS = $(am_test_parser_OBJECTS)
- test_parser_LDADD = $(LDADD)
+Index: tests/Makefile.in
+--- tests/Makefile.in.orig
++++ tests/Makefile.in
+@@ -130,7 +130,7 @@ AM_V_at = $(am__v_at_@AM_V@)
+ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+ am__v_at_0 = @
+ am__v_at_1 = 
 -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
 +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I${TRUEPREFIX}/include
- depcomp = $(SHELL) $(top_srcdir)/depcomp
- am__depfiles_maybe = depfiles
- COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-@@ -127,7 +127,7 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ depcomp = $(SHELL) $(top_srcdir)/build/depcomp
+ am__maybe_remake_depfiles = depfiles
+ am__depfiles_remade = ../loudmouth/$(DEPDIR)/lm-data-objects.Po \
+@@ -280,7 +280,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
  INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ KRB5CONFIG = @KRB5CONFIG@
+ LD = @LD@
 -LDFLAGS = @LDFLAGS@
 +LDFLAGS = @LDFLAGS@ -lcheck
  LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
- LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@
  LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
+ LIBIDN_CFLAGS = @LIBIDN_CFLAGS@
Index: net/loudmouth/pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/loudmouth/pkg/PLIST,v
diff -u -p -r1.3 PLIST
--- net/loudmouth/pkg/PLIST	11 Mar 2022 19:46:18 -0000	1.3
+++ net/loudmouth/pkg/PLIST	29 Dec 2023 11:20:38 -0000
@@ -9,28 +9,7 @@ include/loudmouth-1.0/loudmouth/lm-proxy
 include/loudmouth-1.0/loudmouth/lm-ssl.h
 include/loudmouth-1.0/loudmouth/lm-utils.h
 include/loudmouth-1.0/loudmouth/loudmouth.h
-lib/libloudmouth-1.a
+@static-lib lib/libloudmouth-1.a
 lib/libloudmouth-1.la
 @lib lib/libloudmouth-1.so.${LIBloudmouth-1_VERSION}
 lib/pkgconfig/loudmouth-1.0.pc
-share/gtk-doc/
-share/gtk-doc/html/
-share/gtk-doc/html/loudmouth/
-share/gtk-doc/html/loudmouth/ch01.html
-share/gtk-doc/html/loudmouth/home.png
-share/gtk-doc/html/loudmouth/index.html
-share/gtk-doc/html/loudmouth/index.sgml
-share/gtk-doc/html/loudmouth/left.png
-share/gtk-doc/html/loudmouth/loudmouth-lm-connection.html
-share/gtk-doc/html/loudmouth/loudmouth-lm-error.html
-share/gtk-doc/html/loudmouth/loudmouth-lm-message-handler.html
-share/gtk-doc/html/loudmouth/loudmouth-lm-message-node.html
-share/gtk-doc/html/loudmouth/loudmouth-lm-message.html
-share/gtk-doc/html/loudmouth/loudmouth-lm-proxy.html
-share/gtk-doc/html/loudmouth/loudmouth-lm-ssl.html
-share/gtk-doc/html/loudmouth/loudmouth-lm-utils.html
-share/gtk-doc/html/loudmouth/loudmouth.devhelp
-share/gtk-doc/html/loudmouth/loudmouth.devhelp2
-share/gtk-doc/html/loudmouth/right.png
-share/gtk-doc/html/loudmouth/style.css
-share/gtk-doc/html/loudmouth/up.png
Index: net/mcabber/Makefile
===================================================================
RCS file: /cvs/ports/net/mcabber/Makefile,v
diff -u -p -r1.42 Makefile
--- net/mcabber/Makefile	27 Sep 2023 14:18:18 -0000	1.42
+++ net/mcabber/Makefile	2 Jan 2024 23:29:49 -0000
@@ -1,7 +1,7 @@
 COMMENT=		console jabber client
 DISTNAME=		mcabber-1.1.2
 CATEGORIES=		net
-REVISION=		0
+REVISION=		1
 
 HOMEPAGE=		https://mcabber.com/
 
@@ -10,17 +10,16 @@ MAINTAINER=		Markus Hennecke <markus-hen
 # GPLv2+ with SSL exemption
 PERMIT_PACKAGE=	Yes
 
+# uses pledge()
 WANTLIB += assuan c crypto curses gcrypt glib-2.0 gpg-error gpgme iconv
 WANTLIB += idn intl loudmouth-1>=3 otr panel pcre2-8 pthread ssl
 
 SITES=			${HOMEPAGE}/files/
 EXTRACT_SUFX=		.tar.bz2
 
-# uses pledge()
-
 LIB_DEPENDS=		devel/glib2 \
 			security/gpgme \
-			net/loudmouth \
+			net/loudmouth>=1.5.4 \
 			devel/libidn \
 			security/libotr \
 			devel/gettext,-runtime