X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Frlm_otp%2Fotp_rlm.c;fp=src%2Fmodules%2Frlm_otp%2Fotp_rlm.c;h=457400472f2592cb4896b30aeeb3d271721898ed;hb=8a30e2a06e505ca6fbad1b53e2b686ebfc85abe2;hp=60d2c7820ea264f47e5fb9917a12a81d8fccf925;hpb=16763157f684ad99459c7f775e841e31dbb77413;p=freeradius.git diff --git a/src/modules/rlm_otp/otp_rlm.c b/src/modules/rlm_otp/otp_rlm.c index 60d2c78..4574004 100644 --- a/src/modules/rlm_otp/otp_rlm.c +++ b/src/modules/rlm_otp/otp_rlm.c @@ -20,12 +20,11 @@ * Copyright 2005,2006 TRI-D Systems, Inc. */ -#include "ident.h" -RCSID("$Id$") +static const char rcsid[] = "$Id$"; -#include -#include -#include +#include +#include +#include #include "extern.h" #include "otp.h" @@ -192,7 +191,7 @@ otp_authorize(void *instance, REQUEST *request) auth_type_found = 0; if ((vp = pairfind(request->config_items, PW_AUTHTYPE)) != NULL) { auth_type_found = 1; - if (strcmp(vp->vp_strvalue, inst->name)) + if (strcmp(vp->strvalue, inst->name)) return RLM_MODULE_NOOP; } } @@ -306,7 +305,7 @@ otp_authenticate(void *instance, REQUEST *request) __func__); return RLM_MODULE_INVALID; } - username = request->username->vp_strvalue; + username = request->username->strvalue; if ((pwe = otp_pwe_present(request)) == 0) { (void) radlog(L_AUTH, "rlm_otp: %s: Attribute \"User-Password\" " @@ -343,7 +342,7 @@ otp_authenticate(void *instance, REQUEST *request) */ /* ASCII decode; this is why OTP_MAX_RADSTATE_LEN has +1 */ - (void) memcpy(rad_state, vp->vp_strvalue, vp->length); + (void) memcpy(rad_state, vp->strvalue, vp->length); rad_state[e_length] = '\0'; if (otp_a2x(rad_state, raw_state) == -1) { (void) radlog(L_AUTH, "rlm_otp: %s: bad radstate for [%s]: not hex", @@ -364,7 +363,7 @@ otp_authenticate(void *instance, REQUEST *request) return RLM_MODULE_FAIL; } /* compare generated state against returned state to verify hmac */ - if (memcmp(state, vp->vp_strvalue, vp->length)) { + if (memcmp(state, vp->strvalue, vp->length)) { (void) radlog(L_AUTH, "rlm_otp: %s: bad radstate for [%s]: hmac", __func__, username); return RLM_MODULE_REJECT; @@ -417,11 +416,10 @@ otp_detach(void *instance) * is single-threaded. */ module_t rlm_otp = { - RLM_MODULE_INIT, "otp", RLM_TYPE_THREAD_SAFE, /* type */ + NULL, otp_instantiate, /* instantiation */ - otp_detach, /* detach */ { otp_authenticate, /* authentication */ otp_authorize, /* authorization */ @@ -432,4 +430,6 @@ module_t rlm_otp = { NULL, /* post-proxy */ NULL /* post-auth */ }, + otp_detach, /* detach */ + NULL, };