Fix connection to jabber by using openssl instead of gnutls.

Tighten dependencies, set a proper CA certificate file path and don't
pass socket options we don't support.
This commit is contained in:
ajacoutot 2010-09-24 10:06:19 +00:00
parent 4ed50bf5c1
commit 8e28f707cf
3 changed files with 41 additions and 19 deletions

View File

@ -1,32 +1,36 @@
# $OpenBSD: Makefile,v 1.22 2010/09/23 14:24:22 jasper Exp $
# $OpenBSD: Makefile,v 1.23 2010/09/24 10:06:19 ajacoutot Exp $
COMMENT= flexible communications framework, xmpp component
DISTNAME= telepathy-gabble-0.10.0
REVISION= 0
MASTER_SITES= ${MASTER_SITES_TELEPATHY:=telepathy-gabble/}
WANTLIB += c dbus-1 dbus-glib-1 gcrypt gio-2.0 glib-2.0 gmodule-2.0
WANTLIB += gnutls gobject-2.0 gthread-2.0 m pcre pthread tasn1
WANTLIB += xml2 z sqlite3 e2fs-uuid gpg-error telepathy-glib
WANTLIB += nice.>=1 soup-2.4
WANTLIB += nice.>=1 soup-2.4 crypto ssl
MODULES= devel/gettext \
lang/python
BUILD_DEPENDS= ${RUN_DEPENDS} \
BUILD_DEPENDS= ::textproc/libxslt \
::devel/py-twisted/words \
::net/py-xmpp
RUN_DEPENDS= ::textproc/libxslt
LIB_DEPENDS= ::devel/libsoup \
::net/libnice \
:libnice->=0.0.13:net/libnice \
::net/telepathy/telepathy-glib \
::security/libgpg-error \
::sysutils/e2fsprogs
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --with-ca-certificates=/etc/ssl/cert.pem \
--with-tls=openssl \
--disable-gtk-doc
CONFIGURE_ENV= UUID_LIBS="`pkg-config --libs e2fs-uuid`" \
UUID_CFLAGS="`pkg-config --cflags e2fs-uuid`"
UUID_CFLAGS="`pkg-config --cflags e2fs-uuid`" \
TLS_CFLAGS="-I/usr/include" \
TLS_LIBS="-L/usr/lib -lssl -lcrypto"
pre-configure:
${SUBST_CMD} ${WRKSRC}/configure

View File

@ -1,7 +1,4 @@
$OpenBSD: patch-configure,v 1.8 2010/09/23 13:37:12 jasper Exp $
Don't try to pickup e2fs' uuid, it doesn't properly work yet.
$OpenBSD: patch-configure,v 1.9 2010/09/24 10:06:19 ajacoutot Exp $
--- configure.orig Tue Sep 21 20:01:15 2010
+++ configure Tue Sep 21 20:02:11 2010
@@ -2590,14 +2590,6 @@ echo timestamp > conftest.file

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-lib_gibber_gibber-unix-transport_c,v 1.1 2010/04/23 12:41:16 jasper Exp $
$OpenBSD: patch-lib_gibber_gibber-unix-transport_c,v 1.2 2010/09/24 10:06:19 ajacoutot Exp $
- OpenBSD lacks two defines (should they move to sys/socket.h ?)
- OpenBSD's struct ucred doesn't have a pid member.
--- lib/gibber/gibber-unix-transport.c.orig Fri Apr 23 00:23:11 2010
+++ lib/gibber/gibber-unix-transport.c Fri Apr 23 00:25:15 2010
--- lib/gibber/gibber-unix-transport.c.orig Wed Jun 9 18:09:58 2010
+++ lib/gibber/gibber-unix-transport.c Fri Sep 24 11:43:56 2010
@@ -35,7 +35,10 @@
#include <string.h>
#include <errno.h>
@ -16,19 +16,18 @@ $OpenBSD: patch-lib_gibber_gibber-unix-transport_c,v 1.1 2010/04/23 12:41:16 jas
#include <sys/un.h>
#include "gibber-unix-transport.h"
@@ -44,6 +47,11 @@
@@ -44,6 +47,10 @@
#define DEBUG_FLAG DEBUG_NET
#include "gibber-debug.h"
+#if defined(__OpenBSD__)
+#define SCM_CREDENTIALS 0x9001
+#define SO_PASSCRED 0x9002
+#define SCM_CREDENTIALS SM_CREDS
+#endif
+
G_DEFINE_TYPE(GibberUnixTransport, gibber_unix_transport, \
GIBBER_TYPE_FD_TRANSPORT)
@@ -245,9 +253,8 @@ gibber_unix_transport_send_credentials (GibberUnixTran
@@ -245,9 +252,8 @@ gibber_unix_transport_send_credentials (GibberUnixTran
ch->cmsg_type = SCM_CREDENTIALS;
cred = (struct ucred *) CMSG_DATA (ch);
@ -40,7 +39,29 @@ $OpenBSD: patch-lib_gibber_gibber-unix-transport_c,v 1.1 2010/04/23 12:41:16 jas
ret = sendmsg (fd, &msg, 0);
if (ret == -1)
@@ -344,9 +351,9 @@ gibber_unix_transport_read (GibberFdTransport *transpo
@@ -286,8 +292,10 @@ gibber_unix_transport_read (GibberFdTransport *transpo
fd = transport->fd;
/* set SO_PASSCRED flag */
+#ifndef __OpenBSD__
opt = 1;
setsockopt (fd, SOL_SOCKET, SO_PASSCRED, &opt, sizeof (opt));
+#endif
memset (buffer, 0, sizeof (buffer));
memset (&iov, 0, sizeof (iov));
@@ -318,8 +326,10 @@ gibber_unix_transport_read (GibberFdTransport *transpo
}
/* unset SO_PASSCRED flag */
+#ifndef __OpenBSD__
opt = 0;
setsockopt (fd, SOL_SOCKET, SO_PASSCRED, &opt, sizeof (opt));
+#endif
buf.data = buffer;
buf.length = bytes_read;
@@ -344,9 +354,9 @@ gibber_unix_transport_read (GibberFdTransport *transpo
GibberCredentials credentials;
cred = (struct ucred *) CMSG_DATA (ch);