Changeset 177
- Timestamp:
- 28/04/07 16:11:05 (19 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
c2s/authreg.c (modified) (9 diffs)
-
c2s/main.c (modified) (2 diffs)
-
configure.in (modified) (1 diff)
-
sm/main.c (modified) (2 diffs)
-
sm/mod_amp.c (modified) (1 diff)
-
util/jid.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/c2s/authreg.c
r156 r177 21 21 #include "c2s.h" 22 22 23 #ifdef HAVE_IDN24 23 #include <stringprep.h> 25 #endif26 24 27 25 /* authreg module manager */ … … 200 198 201 199 snprintf(username, 1024, "%.*s", NAD_CDATA_L(nad, elem), NAD_CDATA(nad, elem)); 202 #ifdef HAVE_IDN203 200 if(stringprep_xmpp_nodeprep(username, 1024) != 0) { 204 201 log_debug(ZONE, "auth get username failed nodeprep, bouncing it"); … … 206 203 return; 207 204 } 208 #endif209 205 210 206 ar_mechs = c2s->ar_mechanisms; … … 300 296 301 297 snprintf(username, 1024, "%.*s", NAD_CDATA_L(nad, elem), NAD_CDATA(nad, elem)); 302 #ifdef HAVE_IDN303 298 if(stringprep_xmpp_nodeprep(username, 1024) != 0) { 304 299 log_debug(ZONE, "auth set username failed nodeprep, bouncing it"); … … 306 301 return; 307 302 } 308 #endif309 303 310 304 /* make sure we have the resource */ … … 320 314 321 315 snprintf(resource, 1024, "%.*s", NAD_CDATA_L(nad, elem), NAD_CDATA(nad, elem)); 322 #ifdef HAVE_IDN323 316 if(stringprep_xmpp_resourceprep(resource, 1024) != 0) { 324 317 log_debug(ZONE, "auth set resource failed resourceprep, bouncing it"); … … 326 319 return; 327 320 } 328 #endif329 321 330 322 ar_mechs = c2s->ar_mechanisms; … … 580 572 581 573 snprintf(username, 1024, "%.*s", NAD_CDATA_L(nad, elem), NAD_CDATA(nad, elem)); 582 #ifdef HAVE_IDN583 574 if(stringprep_xmpp_nodeprep(username, 1024) != 0) { 584 575 log_debug(ZONE, "register set username failed nodeprep, bouncing it"); … … 586 577 return; 587 578 } 588 #endif589 579 590 580 elem = nad_find_elem(nad, 1, ns, "password", 1); -
trunk/c2s/main.c
r176 r177 21 21 #include "c2s.h" 22 22 23 #ifdef HAVE_IDN24 23 #include <stringprep.h> 25 #endif26 24 27 25 static sig_atomic_t c2s_shutdown = 0; … … 592 590 strncpy(id, elem->values[i], 1024); 593 591 id[1023] = '\0'; 594 #ifdef HAVE_IDN595 592 if (stringprep_nameprep(id, 1024) != 0) { 596 593 log_write(c2s->log, LOG_ERR, "cannot stringprep id %s, aborting", id); 597 594 exit(1); 598 595 } 599 #endif600 596 601 597 host->realm = (realm != NULL) ? realm : pstrdup(xhash_pool(c2s->hosts), id); -
trunk/configure.in
r175 r177 274 274 AC_MSG_ERROR([Libidn >= 0.3.0 not found]) 275 275 fi 276 277 AC_DEFINE(HAVE_IDN,1,[Define to 1 if Libidn is available.])278 276 fi 279 277 -
trunk/sm/main.c
r162 r177 20 20 21 21 #include "sm.h" 22 23 #ifdef HAVE_IDN 24 #include <stringprep.h> 25 #endif 22 #include <stringprep.h> 26 23 27 24 /** @file sm/main.c … … 252 249 strncpy(id, sm->id, 1024); 253 250 id[sizeof(id)-1] = '\0'; 254 #ifdef HAVE_IDN255 251 if (stringprep_nameprep(id, 1024) != 0) { 256 252 log_write(sm->log, LOG_ERR, "cannot stringprep id %s, aborting", sm->id); 257 253 exit(1); 258 254 } 259 #endif260 255 sm->id = id; 261 256 -
trunk/sm/mod_amp.c
r141 r177 23 23 #include "sm.h" 24 24 #include "util/util.h" 25 #ifdef HAVE_IDN26 25 #include <stringprep.h> 27 #endif28 26 29 27 /** @file sm/mod_amp.c -
trunk/util/jid.c
r159 r177 20 20 21 21 #include "util.h" 22 23 #ifdef HAVE_IDN24 22 #include <stringprep.h> 25 #endif26 23 27 24 /** Forward declaration **/ … … 30 27 /** preparation cache */ 31 28 prep_cache_t prep_cache_new(void) { 32 #ifdef HAVE_IDN33 29 prep_cache_t pc; 34 30 … … 41 37 42 38 return pc; 43 #else44 return NULL;45 #endif46 39 } 47 40 48 41 void prep_cache_free(prep_cache_t pc) { 49 #ifdef HAVE_IDN50 42 xhash_free(pc->node); 51 43 xhash_free(pc->domain); 52 44 xhash_free(pc->resource); 53 45 free(pc); 54 #endif55 46 } 56 47 … … 81 72 /** do stringprep on the pieces */ 82 73 static int jid_prep_pieces(prep_cache_t pc, char *node, char *domain, char *resource) { 83 #ifdef HAVE_IDN84 74 char str[1024], *prep; 85 75 … … 138 128 } 139 129 140 #endif141 130 return 0; 142 131 }
