2
* $Id: otp.h,v 1.28.2.7 2006/06/01 19:02:19 fcusack Exp $
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18
* Copyright 2005,2006 TRI-D Systems, Inc.
25
#pragma sun ident "$Id: otp.h,v 1.28.2.7 2006/06/01 19:02:19 fcusack Exp $"
28
#include <sys/types.h>
31
* NOTE: This file must be synced between plugins and otpd.
34
#ifndef OTP_MAX_CHALLENGE_LEN
35
#define OTP_MAX_CHALLENGE_LEN 16
36
#elif OTP_MAX_CHALLENGE_LEN != 16
37
#error OTP_MAX_CHALLENGE_LEN
41
#define OTP_RC_USER_UNKNOWN 1
42
#define OTP_RC_AUTHINFO_UNAVAIL 2
43
#define OTP_RC_AUTH_ERR 3
44
#define OTP_RC_MAXTRIES 4
45
#define OTP_RC_SERVICE_ERR 5
47
#define OTP_MAX_USERNAME_LEN 31
48
#define OTP_MAX_PASSCODE_LEN 47
49
#define OTP_MAX_CHAP_CHALLENGE_LEN 16
50
#define OTP_MAX_CHAP_RESPONSE_LEN 50
52
typedef enum otp_pwe_t {
59
typedef struct otp_request_t {
61
char username[OTP_MAX_USERNAME_LEN + 1];
62
char challenge[OTP_MAX_CHALLENGE_LEN + 1]; /* USER challenge */
65
char passcode[OTP_MAX_PASSCODE_LEN + 1];
66
unsigned char challenge[OTP_MAX_CHAP_CHALLENGE_LEN]; /* CHAP challenge */
68
unsigned char response[OTP_MAX_CHAP_RESPONSE_LEN];
71
int allow_async; /* async auth allowed? */
72
int allow_sync; /* sync auth allowed? */
73
unsigned challenge_delay; /* min delay between async auths */
74
int resync; /* resync on async auth? */
77
typedef struct otp_reply_t {
80
char passcode[OTP_MAX_PASSCODE_LEN + 1];