[sr-dev] where is s proxy_challenge function?

Jan Janak jan at ryngle.com
Thu Jul 1 19:52:18 CEST 2010


Juha,

On Thu, Jul 1, 2010 at 12:19 PM, Juha Heinanen <jh at tutpro.com> wrote:
> since people seemed to agree that s auth module is superior to k one, i
> decided to try porting k auth_radius module to use s auth api and was
> able to compile and build it against s auth api.
>
> when testing the result, i get errors about "unknown command, missing
> loadmodule" when script has proxy_challenge() call.
>
> i then went and checked s auth module and found this in README:
>
> 1.4.2. proxy_challenge(realm, qop)
>
>   The function challenges a user agent. ...
>
> however, auth_mod.c does not include such function:
>
> /*
>  * Exported functions
>  */
> static cmd_export_t cmds[] = {
>    {"consume_credentials", consume_credentials,     0, 0, REQUEST_ROUTE},
>    {"bind_auth_s",           (cmd_function)bind_auth_s, 0, 0, 0        },
>    {0, 0, 0, 0, 0}
> };
>
> i don't find it even with grep on s modules.  where is it?

It has been obsoleted because all the function did was to send a reply
with digest challenge included. We achieve the same in the
configuration file with a combination of append_to_reply and sl_reply:

if (!proxy_authenticate("$fd.digest_realm", "credentials")) {
  if ($? == -2) {
    sl_reply("500", "Internal Server Error");
  } else if ($? == -3) {
    sl_reply("400", "Bad Request");
  } else {
    if (defined $digest_challenge && $digest_challenge != "") {
      append_to_reply("%$digest_challenge");
    }
    sl_reply("407", "Proxy Authentication Required");
  }
  drop;
}

-Jan



More information about the sr-dev mailing list