version 1.16, 2002/01/12 13:10:29 |
version 1.17, 2002/03/18 17:50:31 |
|
|
|
|
#include "xmalloc.h" |
#include "xmalloc.h" |
#include "auth.h" |
#include "auth.h" |
|
#include "monitor_wrap.h" |
|
|
static void * |
static void * |
skey_init_ctx(Authctxt *authctxt) |
skey_init_ctx(Authctxt *authctxt) |
|
|
return authctxt; |
return authctxt; |
} |
} |
|
|
#define PROMPT "\nS/Key Password: " |
|
|
|
static int |
static int |
skey_query(void *ctx, char **name, char **infotxt, |
skey_query(void *ctx, char **name, char **infotxt, |
u_int* numprompts, char ***prompts, u_int **echo_on) |
u_int* numprompts, char ***prompts, u_int **echo_on) |
|
|
*echo_on = xmalloc(*numprompts * sizeof(u_int)); |
*echo_on = xmalloc(*numprompts * sizeof(u_int)); |
(*echo_on)[0] = 0; |
(*echo_on)[0] = 0; |
|
|
len = strlen(challenge) + strlen(PROMPT) + 1; |
len = strlen(challenge) + strlen(SKEY_PROMPT) + 1; |
p = xmalloc(len); |
p = xmalloc(len); |
strlcpy(p, challenge, len); |
strlcpy(p, challenge, len); |
strlcat(p, PROMPT, len); |
strlcat(p, SKEY_PROMPT, len); |
(*prompts)[0] = p; |
(*prompts)[0] = p; |
|
|
return 0; |
return 0; |
|
|
skey_init_ctx, |
skey_init_ctx, |
skey_query, |
skey_query, |
skey_respond, |
skey_respond, |
|
skey_free_ctx |
|
}; |
|
|
|
KbdintDevice mm_skey_device = { |
|
"skey", |
|
skey_init_ctx, |
|
mm_skey_query, |
|
mm_skey_respond, |
skey_free_ctx |
skey_free_ctx |
}; |
}; |
#endif /* SKEY */ |
#endif /* SKEY */ |