import from HEAD:
[freeradius.git] / src / modules / rlm_otp / otp_pw_valid.c
index a33fefd..6ce6713 100644 (file)
  * Copyright 2006,2007 TRI-D Systems, Inc.
  */
 
-#include <freeradius-devel/ident.h>
+#include "ident.h"
 RCSID("$Id$")
 
-#include <freeradius-devel/radiusd.h>
-#include <freeradius-devel/modules.h>
+#include "autoconf.h"
+#include "radiusd.h"
+#include "modules.h"
 
 #include "extern.h"
 #include "otp.h"
 #include "otp_pw_valid.h"
 
-#ifdef HAVE_PTHREAD_H
+#include <errno.h>
 #include <pthread.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
 #include <sys/un.h>
+#include <unistd.h>
 
 
 /* transform otpd return codes into rlm return codes */
@@ -77,7 +82,7 @@ otp_pw_valid(REQUEST *request, int pwe, const char *challenge,
   otp_request_t        otp_request;
   otp_reply_t  otp_reply;
   VALUE_PAIR   *cvp, *rvp;
-  char         *username = request->username->vp_strvalue;
+  char         *username = request->username->strvalue;
   int          rc;
 
   if (request->username->length > OTP_MAX_USERNAME_LEN) {
@@ -108,7 +113,7 @@ otp_pw_valid(REQUEST *request, int pwe, const char *challenge,
       (void) radlog(L_AUTH, "rlm_otp: passcode for [%s] too long", username);
       return RLM_MODULE_REJECT;
     }
-    (void) strcpy(otp_request.pwe.u.pap.passcode, rvp->vp_strvalue);
+    (void) strcpy(otp_request.pwe.u.pap.passcode, rvp->strvalue);
     break;
 
   case PWE_CHAP:
@@ -122,10 +127,10 @@ otp_pw_valid(REQUEST *request, int pwe, const char *challenge,
                     username);
       return RLM_MODULE_INVALID;
     }
-    (void) memcpy(otp_request.pwe.u.chap.challenge, cvp->vp_strvalue,
+    (void) memcpy(otp_request.pwe.u.chap.challenge, cvp->strvalue,
                   cvp->length);
     otp_request.pwe.u.chap.clen = cvp->length;
-    (void) memcpy(otp_request.pwe.u.chap.response, rvp->vp_strvalue,
+    (void) memcpy(otp_request.pwe.u.chap.response, rvp->strvalue,
                   rvp->length);
     otp_request.pwe.u.chap.rlen = rvp->length;
     break;
@@ -141,10 +146,10 @@ otp_pw_valid(REQUEST *request, int pwe, const char *challenge,
                     username);
       return RLM_MODULE_INVALID;
     }
-    (void) memcpy(otp_request.pwe.u.chap.challenge, cvp->vp_strvalue,
+    (void) memcpy(otp_request.pwe.u.chap.challenge, cvp->strvalue,
                   cvp->length);
     otp_request.pwe.u.chap.clen = cvp->length;
-    (void) memcpy(otp_request.pwe.u.chap.response, rvp->vp_strvalue,
+    (void) memcpy(otp_request.pwe.u.chap.response, rvp->strvalue,
                   rvp->length);
     otp_request.pwe.u.chap.rlen = rvp->length;
     break;
@@ -160,10 +165,10 @@ otp_pw_valid(REQUEST *request, int pwe, const char *challenge,
                     username);
       return RLM_MODULE_INVALID;
     }
-    (void) memcpy(otp_request.pwe.u.chap.challenge, cvp->vp_strvalue,
+    (void) memcpy(otp_request.pwe.u.chap.challenge, cvp->strvalue,
                   cvp->length);
     otp_request.pwe.u.chap.clen = cvp->length;
-    (void) memcpy(otp_request.pwe.u.chap.response, rvp->vp_strvalue,
+    (void) memcpy(otp_request.pwe.u.chap.response, rvp->strvalue,
                   rvp->length);
     otp_request.pwe.u.chap.rlen = rvp->length;
     break;