aboutsummaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-11-13 00:48:28 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-11-13 00:48:28 +0100
commit8367889e8467ce73b051aa8db64b0336aea8ed4b (patch)
tree99578b1e6969d7eeb19b2578137c1c92de2fc49b /misc.h
parentPreparing for v2.2-beta3 (diff)
parentVersion 2.1.3b (diff)
downloadopenvpn-8367889e8467ce73b051aa8db64b0336aea8ed4b.tar.xz
Merge branch 'svn-BETA21' into beta2.2
Conflicts: version.m4 - Reset version.m4 to a more neutral version number Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h38
1 files changed, 34 insertions, 4 deletions
diff --git a/misc.h b/misc.h
index 7db9332..3f22ca0 100644
--- a/misc.h
+++ b/misc.h
@@ -261,6 +261,26 @@ struct user_pass
char password[USER_PASS_LEN];
};
+#ifdef ENABLE_CLIENT_CR
+/*
+ * Challenge response info on client as pushed by server.
+ */
+struct auth_challenge_info {
+# define CR_ECHO (1<<0) /* echo response when typed by user */
+# define CR_RESPONSE (1<<1) /* response needed */
+ unsigned int flags;
+
+ const char *user;
+ const char *state_id;
+ const char *challenge_text;
+};
+
+struct auth_challenge_info *get_auth_challenge (const char *auth_challenge, struct gc_arena *gc);
+
+#else
+struct auth_challenge_info {};
+#endif
+
bool get_console_input (const char *prompt, const bool echo, char *input, const int capacity);
/*
@@ -274,10 +294,20 @@ bool get_console_input (const char *prompt, const bool echo, char *input, const
#define GET_USER_PASS_NEED_STR (1<<5)
#define GET_USER_PASS_PREVIOUS_CREDS_FAILED (1<<6)
-bool get_user_pass (struct user_pass *up,
- const char *auth_file,
- const char *prefix,
- const unsigned int flags);
+bool get_user_pass_cr (struct user_pass *up,
+ const char *auth_file,
+ const char *prefix,
+ const unsigned int flags,
+ const char *auth_challenge);
+
+static inline bool
+get_user_pass (struct user_pass *up,
+ const char *auth_file,
+ const char *prefix,
+ const unsigned int flags)
+{
+ return get_user_pass_cr (up, auth_file, prefix, flags, NULL);
+}
void fail_user_pass (const char *prefix,
const unsigned int flags,