Description:
authorfcusack <fcusack>
Sat, 5 Nov 2005 00:52:40 +0000 (00:52 +0000)
committerfcusack <fcusack>
Sat, 5 Nov 2005 00:52:40 +0000 (00:52 +0000)
update cardops challenge() method: change order of 'challenge' and
'when' args, change 'twin' and 'ewin' args to type int

src/modules/rlm_otp/cardops/cryptocard.c
src/modules/rlm_otp/cardops/cryptocard.h
src/modules/rlm_otp/otp_cardops.c
src/modules/rlm_otp/otp_cardops.h

index acbe58e..9dcbfd7 100644 (file)
@@ -124,19 +124,19 @@ cryptocard_challenge(const otp_user_info_t *user_info,
 __attribute__ ((unused))
 #endif
                      const char csd[OTP_MAX_CSD_LEN + 1],
+                     char challenge[OTP_MAX_CHALLENGE_LEN + 1],
 #ifdef __GNUC__
 __attribute__ ((unused))
 #endif
                      time_t when,
-                     char challenge[OTP_MAX_CHALLENGE_LEN + 1],
 #ifdef __GNUC__
 __attribute__ ((unused))
 #endif
-                     unsigned twin,
+                     int twin,
 #ifdef __GNUC__
 __attribute__ ((unused))
 #endif
-                     unsigned ewin,
+                     int ewin,
                      const char *log_prefix)
 {
   unsigned char output[8];
index 4f8b35d..674eabd 100644 (file)
@@ -45,9 +45,9 @@ static int cryptocard_keystring2keyblock(const char *,
 static int cryptocard_nullstate(const otp_option_t *, const otp_user_info_t *,
                                 otp_user_state_t *, time_t, const char *);
 static int cryptocard_challenge(const otp_user_info_t *,
-                                const char [OTP_MAX_CSD_LEN + 1], time_t,
-                                char [OTP_MAX_CHALLENGE_LEN + 1],
-                                unsigned, unsigned, const char *);
+                                const char [OTP_MAX_CSD_LEN + 1],
+                                char [OTP_MAX_CHALLENGE_LEN + 1], time_t,
+                                int, int, const char *);
 static int cryptocard_response(otp_user_info_t *,
                                const char [OTP_MAX_CSD_LEN + 1],
                                const char [OTP_MAX_CHALLENGE_LEN + 1],
index efa9fe2..78eb723 100644 (file)
@@ -356,8 +356,8 @@ sync_response:
     for (t = 0; t <= tend; ++t) {
       for (e = 0; e <= end; ++e) {
         /* Get next challenge. */
-        if (user_info.cardops->challenge(&user_info, user_state.csd, now,
-                                         challenge, t, e, log_prefix) != 0) {
+        if (user_info.cardops->challenge(&user_info, user_state.csd, challenge,
+                                         now, t, e, log_prefix) != 0) {
           otp_log(OTP_LOG_ERR,
                   "%s: unable to get sync challenge t:%d e:%d for [%s]",
                   log_prefix, t, e, username);
index 83f65e0..6dea8e6 100644 (file)
@@ -72,8 +72,8 @@ typedef struct cardops_t {
   int (*nullstate)(const otp_option_t *, const otp_user_info_t *,
                    otp_user_state_t *, time_t, const char *);
   int (*challenge)(const otp_user_info_t *, const char [OTP_MAX_CSD_LEN + 1],
-                   time_t, char [OTP_MAX_CHALLENGE_LEN + 1], unsigned,
-                   unsigned, const char *);
+                   char [OTP_MAX_CHALLENGE_LEN + 1], time_t, int, int,
+                   const char *);
   int (*response)(otp_user_info_t *, const char [OTP_MAX_CSD_LEN + 1],
                   const char [OTP_MAX_CHALLENGE_LEN + 1],
                   char [OTP_MAX_RESPONSE_LEN + 1], const char *);