# HG changeset patch # User Ethan Blanton # Date 1235940980 0 # Node ID 309f6dca369a273b7bae5f3faad339fa751f1d71 # Parent 6eff00e729ac4d115af7b7913686cf9122e8e487 Use _set_default_priority on gnutls versions lacking _priority_set_direct. Versions of gnutls prior to 2.2.0 do not have gnutls_priority_set_direct. This fixes a compilation issue in c84a41f40179331c218ac05005ce7805129049e5 on such systems. This should not represent a regression from 2.5.4 on systems without gnutls 2.2.0 or newer. Fixes #8526 diff -r 6eff00e729ac -r 309f6dca369a configure.ac --- a/configure.ac Sat Feb 21 23:26:22 2009 +0000 +++ b/configure.ac Sun Mar 01 20:56:20 2009 +0000 @@ -1702,6 +1702,22 @@ AC_SUBST(GNUTLS_CFLAGS) AC_SUBST(GNUTLS_LIBS) +if test "x$enable_gnutls" = "xyes"; then + AC_MSG_CHECKING(for gnutls_priority_set_direct) + LIBS_save="$LIBS" + LIBS="$LIBS $GNUTLS_LIBS" + CPPFLAGS_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [gnutls_session s; gnutls_priority_set_direct(s, NULL, NULL);])], + [AC_DEFINE([HAVE_GNUTLS_PRIORITY_FUNCS], 1, + [Define if your gnutls has gnutls_priority_set_direct and friends]) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + CPPFLAGS="$CPPFLAGS_save" + LIBS="$LIBS_save" +fi + AM_CONDITIONAL(USE_GNUTLS, test "x$enable_gnutls" = "xyes") diff -r 6eff00e729ac -r 309f6dca369a libpurple/plugins/ssl/ssl-gnutls.c --- a/libpurple/plugins/ssl/ssl-gnutls.c Sat Feb 21 23:26:22 2009 +0000 +++ b/libpurple/plugins/ssl/ssl-gnutls.c Sun Mar 01 20:56:20 2009 +0000 @@ -256,9 +256,13 @@ gsc->private_data = gnutls_data; gnutls_init(&gnutls_data->session, GNUTLS_CLIENT); +#ifdef HAVE_GNUTLS_PRIORITY_FUNCS if (gnutls_priority_set_direct(gnutls_data->session, "NORMAL:%SSL3_RECORD_VERSION", NULL)) gnutls_priority_set_direct(gnutls_data->session, "NORMAL", NULL); +#else + gnutls_set_default_priority(gnutls_data->session); +#endif gnutls_certificate_type_set_priority(gnutls_data->session, cert_type_priority);