--- a/libpurple/protocols/jabber/jutil.c Mon Dec 30 07:08:44 2019 +0000
+++ b/libpurple/protocols/jabber/jutil.c Fri Jan 31 08:43:03 2020 -0600
@@ -32,13 +32,10 @@
static char idn_buffer[1024];
static gboolean jabber_nodeprep(char *str, size_t buflen)
return stringprep_xmpp_nodeprep(str, buflen) == STRINGPREP_OK;
@@ -169,15 +166,9 @@
gboolean jabber_nodeprep_validate(const char *str)
@@ -185,24 +176,10 @@
strncpy(idn_buffer, str, sizeof(idn_buffer) - 1);
idn_buffer[sizeof(idn_buffer) - 1] = '\0';
result = jabber_nodeprep(idn_buffer, sizeof(idn_buffer));
- gunichar ch = g_utf8_get_char(c);
- if(ch == '\"' || ch == '&' || ch == '\'' || ch == '/' || ch == ':' ||
- ch == '<' || ch == '>' || ch == '@' || !g_unichar_isgraph(ch)) {
- c = g_utf8_next_char(c);
gboolean jabber_domain_validate(const char *str)
@@ -258,11 +235,7 @@
gboolean jabber_resourceprep_validate(const char *str)
@@ -270,28 +243,14 @@
strncpy(idn_buffer, str, sizeof(idn_buffer) - 1);
idn_buffer[sizeof(idn_buffer) - 1] = '\0';
result = jabber_resourceprep(idn_buffer, sizeof(idn_buffer));
- gunichar ch = g_utf8_get_char(c);
- if(!g_unichar_isgraph(ch) && ch != ' ')
- c = g_utf8_next_char(c);
char *jabber_saslprep(const char *in)
g_return_val_if_fail(in != NULL, NULL);
@@ -309,22 +268,6 @@
out = g_strdup(idn_buffer);
memset(idn_buffer, 0, sizeof(idn_buffer));
- /* TODO: Something better than disallowing all non-ASCII characters */
- /* TODO: Is this even correct? */
- c = (const guchar *)in;
- if (*c > 0x7f || /* Non-ASCII characters */
- *c == 0x7f || /* ASCII Delete character */
- (*c < 0x20 && *c != '\t' && *c != '\n' && *c != '\r'))
- /* ASCII control characters */
@@ -334,10 +277,6 @@
const char *slash = NULL;
gboolean needs_validation = FALSE;
@@ -431,52 +370,7 @@
if (!g_utf8_validate(str, -1, NULL))
return jabber_idn_validate(str, at, slash, c /* points to the null */);
- jid = g_new0(JabberID, 1);
- node = g_utf8_casefold(str, at-str);
- domain = g_utf8_casefold(at+1, slash-(at+1));
- jid->resource = g_utf8_normalize(slash+1, -1, G_NORMALIZE_NFKC);
- domain = g_utf8_casefold(at+1, -1);
- domain = g_utf8_casefold(str, slash-str);
- jid->resource = g_utf8_normalize(slash+1, -1, G_NORMALIZE_NFKC);
- domain = g_utf8_casefold(str, -1);
- jid->node = g_utf8_normalize(node, -1, G_NORMALIZE_NFKC);
- jid->domain = g_utf8_normalize(domain, -1, G_NORMALIZE_NFKC);
- /* and finally the jabber nodeprep */
- if(!jabber_nodeprep_validate(jid->node) ||
- !jabber_domain_validate(jid->domain) ||
- !jabber_resourceprep_validate(jid->resource)) {
--- a/libpurple/protocols/jabber/meson.build Mon Dec 30 07:08:44 2019 +0000
+++ b/libpurple/protocols/jabber/meson.build Fri Jan 31 08:43:03 2020 -0600
@@ -2,13 +2,6 @@
# Check for Internationalized Domain Name support
#######################################################################
-idn = dependency('libidn', version : '>= 0.0.0', required : get_option('idn'))
- use_idn = [ '-DUSE_IDN' ]
@@ -115,7 +108,6 @@
jabber_prpl = shared_library('jabber', JABBERSOURCES,
link_args : jabber_link_args,
dependencies : [gstreamer, idn, libxml, sasl, libpurple_dep, libsoup, glib, gio, math, ws2_32],
install : true, install_dir : PURPLE_PLUGINDIR)
--- a/meson.build Mon Dec 30 07:08:44 2019 +0000
+++ b/meson.build Fri Jan 31 08:43:03 2020 -0600
@@ -349,6 +349,12 @@
#######################################################################
+# Check for libidn (required) +####################################################################### +idn = dependency('libidn', version : '>= 0.0.0') +####################################################################### # Check for JSON-GLib (required)
#######################################################################
@@ -796,7 +802,6 @@
message('Build with GStreamer support.. : ' + gstreamer.found().to_string())
message('Build with voice and video.... : ' + enable_vv.to_string())
-message('Build with GNU Libidn......... : ' + idn.found().to_string())
message('Build with Nettle support..... : ' + nettle.found().to_string())
message('Build with Cyrus SASL support. : ' + sasl.found().to_string())
message('Use external libzephyr........ : ' + EXTERNAL_LIBZEPHYR.to_string())
--- a/meson_options.txt Mon Dec 30 07:08:44 2019 +0000
+++ b/meson_options.txt Fri Jan 31 08:43:03 2020 -0600
@@ -58,9 +58,6 @@
option('cyrus-sasl', type : 'feature',
description : 'enable Cyrus SASL support for XMPP/IRC')
-option('idn', type : 'feature',
- description : 'compile with IDN support')
option('krb4', type : 'boolean', value : false,
description : 'compile Zephyr plugin with Kerberos 4 support')