2
* Copyright (c) 1999-2005, 2007, 2010-2011
3
* Todd C. Miller <Todd.Miller@courtesan.com>
5
* Permission to use, copy, modify, and distribute this software for any
6
* purpose with or without fee is hereby granted, provided that the above
7
* copyright notice and this permission notice appear in all copies.
9
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
17
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
18
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20
* Sponsored in part by the Defense Advanced Research Projects
21
* Agency (DARPA) and Air Force Research Laboratory, Air Force
22
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
27
#include <sys/types.h>
28
#include <sys/param.h>
37
#endif /* STDC_HEADERS */
40
#endif /* HAVE_STRING_H */
43
#endif /* HAVE_STRINGS_H */
46
#endif /* HAVE_UNISTD_H */
54
#include "sudo_auth.h"
56
union config_record configure;
59
securid_init(struct passwd *pw, sudo_auth *auth)
61
static struct SD_CLIENT sd_dat; /* SecurID data block */
63
auth->data = (void *) &sd_dat; /* For method-specific data */
72
securid_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
74
struct SD_CLIENT *sd = (struct SD_CLIENT *) auth->data;
76
/* Re-initialize SecurID every time. */
77
if (sd_init(sd) == 0) {
78
/* The programmer's guide says username is 32 bytes */
79
strlcpy(sd->username, pw->pw_name, 32);
82
warningx(_("unable to contact the SecurID server"));
88
securid_verify(struct passwd *pw, char *pass, sudo_auth *auth)
90
struct SD_CLIENT *sd = (struct SD_CLIENT *) auth->data;