--- dynchap-0.22/src/pppd/dynchap.c 2004-12-04 21:42:34.000000000 +0100 +++ stripdomain/dynchap-0.22/src/pppd/dynchap.c 2006-03-26 18:51:19.000000000 +0200 @@ -25,19 +25,23 @@ #include char pppd_version[] = VERSION; -char dynchap_version[] = "DYNCHAP 0.2 (20041123)"; +char dynchap_version[] = "DYNCHAP 0.23 (20060321)"; const int dynchap_separator = '_'; const int dynchap_hashlength = 8; const int dynchap_seriallength = 32; +const int dynchap_domainseparator = '\\'; static int dynchap_deviation = 1; static int dynchap_debug = 1; +static int dynchap_stripdomain = 1; static option_t dynchap_options[] = { { "dynchap_deviation", o_int, &dynchap_deviation, "DynChap: Set maximum allowed deviation in minutes from local time (1=default)" }, { "dynchap_debug", o_int, &dynchap_debug, "DynChap: Set debug option (1=on, 0=off)" }, + { "dynchap_stripdomain", o_int, &dynchap_stripdomain, + "DynChap: Set stripdomain option (1=on, 0=off)" }, { NULL } }; @@ -49,6 +53,14 @@ char *sep_pos; int ok, secret_len; + sep_pos=index(name, dynchap_domainseparator); + if (NULL!=sep_pos) { + name=sep_pos+1; + if (0==strlen(name)) { + error("DynChap: No valid username found"); + return 0; + } + } sep_pos=index(name, dynchap_separator); if (NULL==sep_pos) { // regular CHAP account, proceed to normal authentication