Changeset 1374

Show
Ignore:
Timestamp:
09/30/08 05:30:55 (4 years ago)
Author:
wichert
Message:

URL encode the token when sending to auth server

When logging in something the wifidog gateway unescaped the token, but the
token was never escaped when send out again for an auth request. Fixes #473

Location:
trunk/wifidog
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/ChangeLog

    r1373 r1374  
    22 
    332008-09-30 Wichert Akkerman <wichert@wiggy.net> 
    4         * Clean up compiler warnings (mostly signed/unsigned comparisons) 
     4        * URL encode the token before transmitting (it was already decoded). 
     5          Fixes ticket #473 
     6        * Clean up compiler warnings. 
    57        * Security: strncpy may not NUL-terminate strings, so enforce this 
    6           ourselves. 
    7         * Make it possible to protect the status page 
     8          ourselves. Fixes ticket #464 
     9        * Make it possible to protect the status page. Fixes ticket #463. 
    810 
    9112008-07-20 Alexandre Carmel-Veilleux <acv@miniguru.ca> 
  • trunk/wifidog/src/centralserver.c

    r1373 r1374  
    7070        char buf[MAX_BUF]; 
    7171        char *tmp; 
     72        char *safe_token; 
    7273        int done, nfds; 
    7374        fd_set                  readfds; 
     
    9091         */ 
    9192        memset(buf, 0, sizeof(buf)); 
     93        safe_token=httpdUrlEncode(token); 
    9294        snprintf(buf, (sizeof(buf) - 1), 
    9395                "GET %s%sstage=%s&ip=%s&mac=%s&token=%s&incoming=%llu&outgoing=%llu HTTP/1.0\r\n" 
     
    100102                ip, 
    101103                mac, 
    102                 token, 
     104                safe_token, 
    103105                incoming, 
    104106                outgoing, 
     
    106108                auth_server->authserv_hostname 
    107109        ); 
     110 
     111        free(safe_token); 
    108112 
    109113        debug(LOG_DEBUG, "Sending HTTP request to auth server: [%s]\n", buf);