summaryrefslogtreecommitdiff
path: root/auth-skey.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth-skey.c')
-rw-r--r--auth-skey.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/auth-skey.c b/auth-skey.c
index df19f7507..e897d1875 100644
--- a/auth-skey.c
+++ b/auth-skey.c
@@ -22,7 +22,7 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24#include "includes.h" 24#include "includes.h"
25RCSID("$OpenBSD: auth-skey.c,v 1.16 2002/01/12 13:10:29 markus Exp $"); 25RCSID("$OpenBSD: auth-skey.c,v 1.17 2002/03/18 17:50:31 provos Exp $");
26 26
27#ifdef SKEY 27#ifdef SKEY
28 28
@@ -30,6 +30,7 @@ RCSID("$OpenBSD: auth-skey.c,v 1.16 2002/01/12 13:10:29 markus Exp $");
30 30
31#include "xmalloc.h" 31#include "xmalloc.h"
32#include "auth.h" 32#include "auth.h"
33#include "monitor_wrap.h"
33 34
34static void * 35static void *
35skey_init_ctx(Authctxt *authctxt) 36skey_init_ctx(Authctxt *authctxt)
@@ -37,8 +38,6 @@ skey_init_ctx(Authctxt *authctxt)
37 return authctxt; 38 return authctxt;
38} 39}
39 40
40#define PROMPT "\nS/Key Password: "
41
42static int 41static int
43skey_query(void *ctx, char **name, char **infotxt, 42skey_query(void *ctx, char **name, char **infotxt,
44 u_int* numprompts, char ***prompts, u_int **echo_on) 43 u_int* numprompts, char ***prompts, u_int **echo_on)
@@ -58,10 +57,10 @@ skey_query(void *ctx, char **name, char **infotxt,
58 *echo_on = xmalloc(*numprompts * sizeof(u_int)); 57 *echo_on = xmalloc(*numprompts * sizeof(u_int));
59 (*echo_on)[0] = 0; 58 (*echo_on)[0] = 0;
60 59
61 len = strlen(challenge) + strlen(PROMPT) + 1; 60 len = strlen(challenge) + strlen(SKEY_PROMPT) + 1;
62 p = xmalloc(len); 61 p = xmalloc(len);
63 strlcpy(p, challenge, len); 62 strlcpy(p, challenge, len);
64 strlcat(p, PROMPT, len); 63 strlcat(p, SKEY_PROMPT, len);
65 (*prompts)[0] = p; 64 (*prompts)[0] = p;
66 65
67 return 0; 66 return 0;
@@ -93,4 +92,12 @@ KbdintDevice skey_device = {
93 skey_respond, 92 skey_respond,
94 skey_free_ctx 93 skey_free_ctx
95}; 94};
95
96KbdintDevice mm_skey_device = {
97 "skey",
98 skey_init_ctx,
99 mm_skey_query,
100 mm_skey_respond,
101 skey_free_ctx
102};
96#endif /* SKEY */ 103#endif /* SKEY */