aboutsummaryrefslogtreecommitdiffstats
path: root/net-im
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2007-08-27 17:38:27 +0800
committermm <mm@FreeBSD.org>2007-08-27 17:38:27 +0800
commit9dd254e84b632c7606a14ed18c9497d64fbfc078 (patch)
treefa02eda6354126039c22526a5c6e50a64b32a1fe /net-im
parent41cb869db3c568922cd22751a439b6b482104091 (diff)
downloadfreebsd-ports-gnome-9dd254e84b632c7606a14ed18c9497d64fbfc078.tar.gz
freebsd-ports-gnome-9dd254e84b632c7606a14ed18c9497d64fbfc078.tar.zst
freebsd-ports-gnome-9dd254e84b632c7606a14ed18c9497d64fbfc078.zip
- Add bugfix for SASL (SVN changesets 356 + 357)
- Bump PORTREVISION Tested by: miwi
Diffstat (limited to 'net-im')
-rw-r--r--net-im/jabberd/Makefile1
-rw-r--r--net-im/jabberd/files/patch-sasl78
2 files changed, 79 insertions, 0 deletions
diff --git a/net-im/jabberd/Makefile b/net-im/jabberd/Makefile
index 0e9aee3f2f7e..dd4a308d649d 100644
--- a/net-im/jabberd/Makefile
+++ b/net-im/jabberd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= jabberd
PORTVERSION= 2.1.14
+PORTREVISION= 1
CATEGORIES= net-im
MASTER_SITES= http://ftp.xiaoka.com/jabberd2/releases/
DIST_SUBDIR= jabber
diff --git a/net-im/jabberd/files/patch-sasl b/net-im/jabberd/files/patch-sasl
new file mode 100644
index 000000000000..f89776fccc0b
--- /dev/null
+++ b/net-im/jabberd/files/patch-sasl
@@ -0,0 +1,78 @@
+Index: sx/sasl_cyrus.c
+===================================================================
+--- sx/sasl_cyrus.c (revision 349)
++++ sx/sasl_cyrus.c (working copy)
+@@ -745,7 +745,7 @@
+ /** process handshake packets from the client */
+ static void _sx_sasl_client_process(sx_t s, sx_plugin_t p, char *mech, char *in, int inlen) {
+ _sx_sasl_data_t sd = (_sx_sasl_data_t) s->plugin_data[p->index];
+- char *buf, *out;
++ char *buf = NULL, *out = NULL;
+ int buflen, outlen, ret;
+
+ /* decode the response */
+@@ -760,8 +760,15 @@
+ /* process the data */
+ if(mech != NULL)
+ ret = sasl_server_start(sd->sasl, mech, buf, buflen, (const char **) &out, &outlen);
+- else
++ else {
++ if(!sd->sasl) {
++ _sx_debug(ZONE, "response send before auth request enabling mechanism (decoded: %.*s)", buflen, buf);
++ _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_MECH_TOO_WEAK), 0);
++ if(buf != NULL) free(buf);
++ return;
++ }
+ ret = sasl_server_step(sd->sasl, buf, buflen, (const char **) &out, &outlen);
++ }
+
+ if(buf != NULL) free(buf);
+
+Index: sx/sasl_gsasl.c
+===================================================================
+--- sx/sasl_gsasl.c (revision 351)
++++ sx/sasl_gsasl.c (working copy)
+@@ -349,16 +349,14 @@
+ else {
+ /* decode and process */
+ _sx_sasl_decode(in, inlen, &buf, &buflen);
+- _sx_debug(ZONE, "response from client (decoded: %.*s)", buflen, buf);
+- ret = gsasl_step(sd, buf, buflen, &out, (size_t *) &outlen);
+- if(ret != GSASL_OK && ret != GSASL_NEEDS_MORE) {
+- _sx_debug(ZONE, "gsasl_step failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret));
+- _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_MALFORMED_REQUEST), 0);
+- if(out != NULL) free(out);
++ if(!sd) {
++ _sx_debug(ZONE, "response send before auth request enabling mechanism (decoded: %.*s)", buflen, buf);
++ _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_MECH_TOO_WEAK), 0);
+ if(buf != NULL) free(buf);
+ return;
+ }
+-
++ _sx_debug(ZONE, "response from client (decoded: %.*s)", buflen, buf);
++ ret = gsasl_step(sd, buf, buflen, &out, (size_t *) &outlen);
+ }
+
+ if(buf != NULL) free(buf);
+Index: sx/sasl_scod.c
+===================================================================
+--- sx/sasl_scod.c (revision 349)
++++ sx/sasl_scod.c (working copy)
+@@ -258,10 +258,15 @@
+ }
+
+ else {
+- _sx_debug(ZONE, "response from client");
+-
+ /* decode and process */
+ _sx_sasl_decode(in, inlen, &buf, &buflen);
++ if(!sd) {
++ _sx_debug(ZONE, "response send before auth request enabling mechanism (decoded: %.*s)", buflen, buf);
++ _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_MECH_TOO_WEAK), 0);
++ if(buf != NULL) free(buf);
++ return;
++ }
++ _sx_debug(ZONE, "response from client (decoded: %.*s)", buflen, buf);
+ ret = scod_server_step(sd, buf, buflen, &out, &outlen);
+ }
+