mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Merge pull request #1608 from sjaeckel/deprecate-libmesode
Deprecate libmesode
This commit is contained in:
commit
cad934b9a0
@ -23,7 +23,7 @@ packages:
|
|||||||
- sqlite3
|
- sqlite3
|
||||||
|
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/profanity-im/libmesode.git#0.10.1
|
- https://github.com/strophe/libstrophe.git#0.11.0
|
||||||
- https://github.com/profanity-im/profanity
|
- https://github.com/profanity-im/profanity
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
@ -38,7 +38,7 @@ tasks:
|
|||||||
export AUTOCONF_VERSION=2.69
|
export AUTOCONF_VERSION=2.69
|
||||||
export AUTOMAKE_VERSION=1.16
|
export AUTOMAKE_VERSION=1.16
|
||||||
|
|
||||||
cd ~/libmesode
|
cd ~/libstrophe
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
./configure
|
./configure
|
||||||
make
|
make
|
||||||
|
24
.github/workflows/main.yml
vendored
24
.github/workflows/main.yml
vendored
@ -22,15 +22,15 @@ jobs:
|
|||||||
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
||||||
docker run profanity ./ci-build.sh
|
docker run profanity ./ci-build.sh
|
||||||
|
|
||||||
macos:
|
# macos:
|
||||||
runs-on: macos-latest
|
# runs-on: macos-latest
|
||||||
name: macOS
|
# name: macOS
|
||||||
steps:
|
# steps:
|
||||||
- uses: actions/checkout@v2
|
# - uses: actions/checkout@v2
|
||||||
- name: Run brew bundle
|
# - name: Run brew bundle
|
||||||
run: brew bundle
|
# run: brew bundle
|
||||||
- name: Run tests
|
# - name: Run tests
|
||||||
env:
|
# env:
|
||||||
# Ensure that "keg-only" Homebrew versions are used.
|
# # Ensure that "keg-only" Homebrew versions are used.
|
||||||
PKG_CONFIG_PATH: "/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig:/usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig:$PKG_CONFIG_PATH"
|
# PKG_CONFIG_PATH: "/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig:/usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
run: ./ci-build.sh
|
# run: ./ci-build.sh
|
||||||
|
@ -29,11 +29,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
python-dev-is-python3 \
|
python-dev-is-python3 \
|
||||||
libsqlite3-dev
|
libsqlite3-dev
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/{stabber,libmesode,profanity}
|
RUN mkdir -p /usr/src/{stabber,libstrophe,profanity}
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
|
|
||||||
RUN git clone git://github.com/boothj5/stabber.git
|
RUN git clone git://github.com/boothj5/stabber.git
|
||||||
RUN git clone git://github.com/profanity-im/libmesode.git
|
RUN git clone git://github.com/strophe/libstrophe.git
|
||||||
|
|
||||||
WORKDIR /usr/src/stabber
|
WORKDIR /usr/src/stabber
|
||||||
RUN ./bootstrap.sh
|
RUN ./bootstrap.sh
|
||||||
@ -41,7 +41,7 @@ RUN ./configure --prefix=/usr --disable-dependency-tracking
|
|||||||
RUN make
|
RUN make
|
||||||
RUN make install
|
RUN make install
|
||||||
|
|
||||||
WORKDIR /usr/src/libmesode
|
WORKDIR /usr/src/libstrophe
|
||||||
RUN ./bootstrap.sh
|
RUN ./bootstrap.sh
|
||||||
RUN ./configure --prefix=/usr
|
RUN ./configure --prefix=/usr
|
||||||
RUN make
|
RUN make
|
||||||
|
@ -53,9 +53,9 @@ RUN make
|
|||||||
RUN make install
|
RUN make install
|
||||||
|
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
RUN mkdir -p /usr/src/libmesode
|
RUN mkdir -p /usr/src/libstrophe
|
||||||
RUN git clone git://github.com/profanity-im/libmesode.git
|
RUN git clone git://github.com/strophe/libstrophe.git
|
||||||
WORKDIR /usr/src/libmesode
|
WORKDIR /usr/src/libstrophe
|
||||||
RUN ./bootstrap.sh
|
RUN ./bootstrap.sh
|
||||||
RUN ./configure --prefix=/usr
|
RUN ./configure --prefix=/usr
|
||||||
RUN make
|
RUN make
|
||||||
|
@ -20,7 +20,6 @@ RUN zypper --non-interactive in --no-recommends \
|
|||||||
libexpat-devel \
|
libexpat-devel \
|
||||||
libgcrypt-devel \
|
libgcrypt-devel \
|
||||||
libgpgme-devel \
|
libgpgme-devel \
|
||||||
libmesode-devel \
|
|
||||||
libstrophe-devel \
|
libstrophe-devel \
|
||||||
libmicrohttpd-devel \
|
libmicrohttpd-devel \
|
||||||
libnotify-devel \
|
libnotify-devel \
|
||||||
|
@ -29,11 +29,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
python-dev \
|
python-dev \
|
||||||
libsqlite3-dev
|
libsqlite3-dev
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/{stabber,libmesode,profanity}
|
RUN mkdir -p /usr/src/{stabber,libstrophe,profanity}
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
|
|
||||||
RUN git clone git://github.com/boothj5/stabber.git
|
RUN git clone git://github.com/boothj5/stabber.git
|
||||||
RUN git clone git://github.com/profanity-im/libmesode.git
|
RUN git clone git://github.com/strophe/libstrophe.git
|
||||||
|
|
||||||
# TODO: Re-enable once libmicrohttpd-dev has been updated.
|
# TODO: Re-enable once libmicrohttpd-dev has been updated.
|
||||||
#WORKDIR /usr/src/stabber
|
#WORKDIR /usr/src/stabber
|
||||||
@ -42,7 +42,7 @@ RUN git clone git://github.com/profanity-im/libmesode.git
|
|||||||
#RUN make
|
#RUN make
|
||||||
#RUN make install
|
#RUN make install
|
||||||
|
|
||||||
WORKDIR /usr/src/libmesode
|
WORKDIR /usr/src/libstrophe
|
||||||
RUN ./bootstrap.sh
|
RUN ./bootstrap.sh
|
||||||
RUN ./configure --prefix=/usr
|
RUN ./configure --prefix=/usr
|
||||||
RUN make
|
RUN make
|
||||||
|
15
configure.ac
15
configure.ac
@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE([foreign subdir-objects])
|
|||||||
|
|
||||||
### Checks for programs.
|
### Checks for programs.
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_LIBTOOL
|
LT_INIT
|
||||||
|
|
||||||
## Check for LFS
|
## Check for LFS
|
||||||
AC_SYS_LARGEFILE
|
AC_SYS_LARGEFILE
|
||||||
@ -134,21 +134,14 @@ LIBS="$PTHREAD_LIBS $LIBS"
|
|||||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
AS_IF([test "x$PTHREAD_CC" != x], [ CC="$PTHREAD_CC" ])
|
AS_IF([test "x$PTHREAD_CC" != x], [ CC="$PTHREAD_CC" ])
|
||||||
|
|
||||||
### Check for libmesode, fall back to libstrophe
|
### Check for libstrophe
|
||||||
### TODO libmesode support will be removed in the future, rewrite this section
|
PKG_CHECK_MODULES([libstrophe], [libstrophe >= 0.11.0],
|
||||||
PKG_CHECK_MODULES([libmesode], [libmesode >= 0.10.0],
|
|
||||||
[LIBS="$libmesode_LIBS $LIBS" CFLAGS="$CFLAGS $libmesode_CFLAGS" XMPP_LIB="libmesode" AC_DEFINE([HAVE_LIBMESODE], [1], [libmesode])],
|
|
||||||
[PKG_CHECK_MODULES([libstrophe], [libstrophe >= 0.10.0],
|
|
||||||
[LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" XMPP_LIB="libstrophe" AC_DEFINE([HAVE_LIBSTROPHE], [1], [libstrophe])],
|
[LIBS="$libstrophe_LIBS $LIBS" CFLAGS="$CFLAGS $libstrophe_CFLAGS" XMPP_LIB="libstrophe" AC_DEFINE([HAVE_LIBSTROPHE], [1], [libstrophe])],
|
||||||
[XMPP_LIB=""])])
|
[XMPP_LIB=""])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether ${XMPP_LIB} works])
|
AC_MSG_CHECKING([whether ${XMPP_LIB} works])
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#else
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
xmpp_initialize();
|
xmpp_initialize();
|
||||||
|
@ -177,7 +177,6 @@ cmd_execute_connect(ProfWin* window, const char* const account)
|
|||||||
gboolean
|
gboolean
|
||||||
cmd_tls_certpath(ProfWin* window, const char* const command, gchar** args)
|
cmd_tls_certpath(ProfWin* window, const char* const command, gchar** args)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
if (g_strcmp0(args[1], "set") == 0) {
|
if (g_strcmp0(args[1], "set") == 0) {
|
||||||
if (args[2] == NULL) {
|
if (args[2] == NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
@ -212,16 +211,11 @@ cmd_tls_certpath(ProfWin* window, const char* const command, gchar** args)
|
|||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
cons_show("Certificate path setting only supported when built with libmesode.");
|
|
||||||
return TRUE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cmd_tls_trust(ProfWin* window, const char* const command, gchar** args)
|
cmd_tls_trust(ProfWin* window, const char* const command, gchar** args)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
jabber_conn_status_t conn_status = connection_get_status();
|
jabber_conn_status_t conn_status = connection_get_status();
|
||||||
if (conn_status != JABBER_CONNECTED) {
|
if (conn_status != JABBER_CONNECTED) {
|
||||||
cons_show("You are currently not connected.");
|
cons_show("You are currently not connected.");
|
||||||
@ -245,16 +239,11 @@ cmd_tls_trust(ProfWin* window, const char* const command, gchar** args)
|
|||||||
tlscerts_add(cert);
|
tlscerts_add(cert);
|
||||||
tlscerts_free(cert);
|
tlscerts_free(cert);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
|
||||||
cons_show("Manual certificate trust only supported when built with libmesode.");
|
|
||||||
return TRUE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cmd_tls_trusted(ProfWin* window, const char* const command, gchar** args)
|
cmd_tls_trusted(ProfWin* window, const char* const command, gchar** args)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
GList* certs = tlscerts_list();
|
GList* certs = tlscerts_list();
|
||||||
GList* curr = certs;
|
GList* curr = certs;
|
||||||
|
|
||||||
@ -272,16 +261,11 @@ cmd_tls_trusted(ProfWin* window, const char* const command, gchar** args)
|
|||||||
}
|
}
|
||||||
g_list_free_full(certs, (GDestroyNotify)tlscerts_free);
|
g_list_free_full(certs, (GDestroyNotify)tlscerts_free);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
|
||||||
cons_show("Manual certificate trust only supported when built with libmesode.");
|
|
||||||
return TRUE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cmd_tls_revoke(ProfWin* window, const char* const command, gchar** args)
|
cmd_tls_revoke(ProfWin* window, const char* const command, gchar** args)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
if (args[1] == NULL) {
|
if (args[1] == NULL) {
|
||||||
cons_bad_cmd_usage(command);
|
cons_bad_cmd_usage(command);
|
||||||
} else {
|
} else {
|
||||||
@ -293,16 +277,11 @@ cmd_tls_revoke(ProfWin* window, const char* const command, gchar** args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
|
||||||
cons_show("Manual certificate trust only supported when built with libmesode.");
|
|
||||||
return TRUE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cmd_tls_cert(ProfWin* window, const char* const command, gchar** args)
|
cmd_tls_cert(ProfWin* window, const char* const command, gchar** args)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
TLSCertificate* cert = tlscerts_get_trusted(args[1]);
|
TLSCertificate* cert = tlscerts_get_trusted(args[1]);
|
||||||
if (!cert) {
|
if (!cert) {
|
||||||
@ -332,10 +311,6 @@ cmd_tls_cert(ProfWin* window, const char* const command, gchar** args)
|
|||||||
tlscerts_free(cert);
|
tlscerts_free(cert);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
cons_show("Certificate fetching not supported.");
|
|
||||||
return TRUE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -1088,7 +1088,6 @@ prefs_set_roster_header_char(char* ch)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
prefs_clear_roster_header_char(void)
|
prefs_clear_roster_header_char(void)
|
||||||
{
|
{
|
||||||
|
@ -125,12 +125,7 @@ main(int argc, char** argv)
|
|||||||
|
|
||||||
g_print("Build information:\n");
|
g_print("Build information:\n");
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
g_print("XMPP library: libmesode\n");
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
g_print("XMPP library: libstrophe\n");
|
g_print("XMPP library: libstrophe\n");
|
||||||
#endif
|
|
||||||
|
|
||||||
if (is_notify_enabled()) {
|
if (is_notify_enabled()) {
|
||||||
g_print("Desktop notification support: Enabled\n");
|
g_print("Desktop notification support: Enabled\n");
|
||||||
|
@ -38,13 +38,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
@ -41,13 +41,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
@ -45,13 +45,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
@ -38,13 +38,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "xmpp/xmpp.h"
|
#include "xmpp/xmpp.h"
|
||||||
|
|
||||||
|
@ -43,13 +43,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@ -94,10 +88,8 @@ static void _xmpp_file_logger(void* const userdata, const xmpp_log_level_t level
|
|||||||
static void _connection_handler(xmpp_conn_t* const xmpp_conn, const xmpp_conn_event_t status, const int error,
|
static void _connection_handler(xmpp_conn_t* const xmpp_conn, const xmpp_conn_event_t status, const int error,
|
||||||
xmpp_stream_error_t* const stream_error, void* const userdata);
|
xmpp_stream_error_t* const stream_error, void* const userdata);
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
TLSCertificate* _xmppcert_to_profcert(const xmpp_tlscert_t* xmpptlscert);
|
||||||
TLSCertificate* _xmppcert_to_profcert(xmpp_tlscert_t* xmpptlscert);
|
static int _connection_certfail_cb(const xmpp_tlscert_t* xmpptlscert, const char* errormsg);
|
||||||
static int _connection_certfail_cb(xmpp_tlscert_t* xmpptlscert, const char* const errormsg);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void _random_bytes_init(void);
|
static void _random_bytes_init(void);
|
||||||
static void _random_bytes_close(void);
|
static void _random_bytes_close(void);
|
||||||
@ -220,28 +212,20 @@ connection_connect(const char* const jid, const char* const passwd, const char*
|
|||||||
#undef LOG_FLAG_IF_SET
|
#undef LOG_FLAG_IF_SET
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
char* cert_path = prefs_get_tls_certpath();
|
char* cert_path = prefs_get_tls_certpath();
|
||||||
if (cert_path) {
|
if (cert_path) {
|
||||||
xmpp_conn_tlscert_path(conn.xmpp_conn, cert_path);
|
xmpp_conn_set_capath(conn.xmpp_conn, cert_path);
|
||||||
free(cert_path);
|
free(cert_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xmpp_conn_set_certfail_handler(conn.xmpp_conn, _connection_certfail_cb);
|
||||||
|
|
||||||
int connect_status = xmpp_connect_client(
|
int connect_status = xmpp_connect_client(
|
||||||
conn.xmpp_conn,
|
conn.xmpp_conn,
|
||||||
altdomain,
|
altdomain,
|
||||||
port,
|
port,
|
||||||
_connection_certfail_cb,
|
|
||||||
_connection_handler,
|
_connection_handler,
|
||||||
conn.xmpp_ctx);
|
conn.xmpp_ctx);
|
||||||
#else
|
|
||||||
int connect_status = xmpp_connect_client(
|
|
||||||
conn.xmpp_conn,
|
|
||||||
altdomain,
|
|
||||||
port,
|
|
||||||
_connection_handler,
|
|
||||||
conn.xmpp_ctx);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (connect_status == 0) {
|
if (connect_status == 0) {
|
||||||
conn.conn_status = JABBER_CONNECTING;
|
conn.conn_status = JABBER_CONNECTING;
|
||||||
@ -555,28 +539,20 @@ connection_register(const char* const altdomain, int port, const char* const tls
|
|||||||
reg->username = strdup(username);
|
reg->username = strdup(username);
|
||||||
reg->password = strdup(password);
|
reg->password = strdup(password);
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
char* cert_path = prefs_get_tls_certpath();
|
char* cert_path = prefs_get_tls_certpath();
|
||||||
if (cert_path) {
|
if (cert_path) {
|
||||||
xmpp_conn_tlscert_path(conn.xmpp_conn, cert_path);
|
xmpp_conn_set_capath(conn.xmpp_conn, cert_path);
|
||||||
free(cert_path);
|
free(cert_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xmpp_conn_set_certfail_handler(conn.xmpp_conn, _connection_certfail_cb);
|
||||||
|
|
||||||
int connect_status = xmpp_connect_raw(
|
int connect_status = xmpp_connect_raw(
|
||||||
conn.xmpp_conn,
|
conn.xmpp_conn,
|
||||||
altdomain,
|
altdomain,
|
||||||
port,
|
port,
|
||||||
_connection_certfail_cb,
|
|
||||||
_register_handler,
|
_register_handler,
|
||||||
reg);
|
reg);
|
||||||
#else
|
|
||||||
int connect_status = xmpp_connect_raw(
|
|
||||||
conn.xmpp_conn,
|
|
||||||
altdomain,
|
|
||||||
port,
|
|
||||||
_register_handler,
|
|
||||||
reg);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (connect_status == 0) {
|
if (connect_status == 0) {
|
||||||
conn.conn_status = JABBER_RAW_CONNECTING;
|
conn.conn_status = JABBER_RAW_CONNECTING;
|
||||||
@ -645,17 +621,15 @@ connection_clear_data(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
TLSCertificate*
|
TLSCertificate*
|
||||||
connection_get_tls_peer_cert(void)
|
connection_get_tls_peer_cert(void)
|
||||||
{
|
{
|
||||||
xmpp_tlscert_t* xmpptlscert = xmpp_conn_tls_peer_cert(conn.xmpp_conn);
|
xmpp_tlscert_t* xmpptlscert = xmpp_conn_get_peer_cert(conn.xmpp_conn);
|
||||||
TLSCertificate* cert = _xmppcert_to_profcert(xmpptlscert);
|
TLSCertificate* cert = _xmppcert_to_profcert(xmpptlscert);
|
||||||
xmpp_conn_free_tlscert(conn.xmpp_ctx, xmpptlscert);
|
xmpp_tlscert_free(xmpptlscert);
|
||||||
|
|
||||||
return cert;
|
return cert;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
connection_is_secured(void)
|
connection_is_secured(void)
|
||||||
@ -971,9 +945,8 @@ _connection_handler(xmpp_conn_t* const xmpp_conn, const xmpp_conn_event_t status
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
static int
|
static int
|
||||||
_connection_certfail_cb(xmpp_tlscert_t* xmpptlscert, const char* const errormsg)
|
_connection_certfail_cb(const xmpp_tlscert_t* xmpptlscert, const char* errormsg)
|
||||||
{
|
{
|
||||||
TLSCertificate* cert = _xmppcert_to_profcert(xmpptlscert);
|
TLSCertificate* cert = _xmppcert_to_profcert(xmpptlscert);
|
||||||
|
|
||||||
@ -984,20 +957,21 @@ _connection_certfail_cb(xmpp_tlscert_t* xmpptlscert, const char* const errormsg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TLSCertificate*
|
TLSCertificate*
|
||||||
_xmppcert_to_profcert(xmpp_tlscert_t* xmpptlscert)
|
_xmppcert_to_profcert(const xmpp_tlscert_t* xmpptlscert)
|
||||||
{
|
{
|
||||||
|
int version = (int)strtol(
|
||||||
|
xmpp_tlscert_get_string(xmpptlscert, XMPP_CERT_VERSION), NULL, 10);
|
||||||
return tlscerts_new(
|
return tlscerts_new(
|
||||||
xmpp_conn_tlscert_fingerprint(xmpptlscert),
|
xmpp_tlscert_get_string(xmpptlscert, XMPP_CERT_FINGERPRINT_SHA1),
|
||||||
xmpp_conn_tlscert_version(xmpptlscert),
|
version,
|
||||||
xmpp_conn_tlscert_serialnumber(xmpptlscert),
|
xmpp_tlscert_get_string(xmpptlscert, XMPP_CERT_SERIALNUMBER),
|
||||||
xmpp_conn_tlscert_subjectname(xmpptlscert),
|
xmpp_tlscert_get_string(xmpptlscert, XMPP_CERT_SUBJECT),
|
||||||
xmpp_conn_tlscert_issuername(xmpptlscert),
|
xmpp_tlscert_get_string(xmpptlscert, XMPP_CERT_ISSUER),
|
||||||
xmpp_conn_tlscert_notbefore(xmpptlscert),
|
xmpp_tlscert_get_string(xmpptlscert, XMPP_CERT_NOTBEFORE),
|
||||||
xmpp_conn_tlscert_notafter(xmpptlscert),
|
xmpp_tlscert_get_string(xmpptlscert, XMPP_CERT_NOTAFTER),
|
||||||
xmpp_conn_tlscert_key_algorithm(xmpptlscert),
|
xmpp_tlscert_get_string(xmpptlscert, XMPP_CERT_KEYALG),
|
||||||
xmpp_conn_tlscert_signature_algorithm(xmpptlscert));
|
xmpp_tlscert_get_string(xmpptlscert, XMPP_CERT_SIGALG));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static xmpp_log_t*
|
static xmpp_log_t*
|
||||||
_xmpp_get_file_logger(void)
|
_xmpp_get_file_logger(void)
|
||||||
|
@ -38,13 +38,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
@ -36,13 +36,7 @@
|
|||||||
#ifndef XMPP_FORM_H
|
#ifndef XMPP_FORM_H
|
||||||
#define XMPP_FORM_H
|
#define XMPP_FORM_H
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "xmpp/xmpp.h"
|
#include "xmpp/xmpp.h"
|
||||||
|
|
||||||
|
@ -44,13 +44,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "profanity.h"
|
#include "profanity.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
@ -39,13 +39,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "profanity.h"
|
#include "profanity.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
@ -42,13 +42,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gprintf.h>
|
#include <glib/gprintf.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "profanity.h"
|
#include "profanity.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
@ -41,13 +41,7 @@
|
|||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "profanity.h"
|
#include "profanity.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
@ -48,13 +48,7 @@
|
|||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
@ -38,13 +38,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <xmpp/xmpp.h>
|
#include <xmpp/xmpp.h>
|
||||||
|
|
||||||
|
@ -40,13 +40,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
#include <mesode.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBSTROPHE
|
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "config/accounts.h"
|
#include "config/accounts.h"
|
||||||
#include "config/tlscerts.h"
|
#include "config/tlscerts.h"
|
||||||
@ -199,9 +193,7 @@ char* connection_get_barejid(void);
|
|||||||
char* connection_get_user(void);
|
char* connection_get_user(void);
|
||||||
char* connection_create_uuid(void);
|
char* connection_create_uuid(void);
|
||||||
void connection_free_uuid(char* uuid);
|
void connection_free_uuid(char* uuid);
|
||||||
#ifdef HAVE_LIBMESODE
|
|
||||||
TLSCertificate* connection_get_tls_peer_cert(void);
|
TLSCertificate* connection_get_tls_peer_cert(void);
|
||||||
#endif
|
|
||||||
gboolean connection_is_secured(void);
|
gboolean connection_is_secured(void);
|
||||||
gboolean connection_send_stanza(const char* const stanza);
|
gboolean connection_send_stanza(const char* const stanza);
|
||||||
GList* connection_get_available_resources(void);
|
GList* connection_get_available_resources(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user