summaryrefslogtreecommitdiffstats
path: root/ssl.c
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 /ssl.c
parent0bb41e58782ae9834a61491c5964bc9816b76bc8 (diff)
parent20a4c12783144d798c6b7446bae8920fdfea7adc (diff)
downloadopenvpn-8367889e8467ce73b051aa8db64b0336aea8ed4b.tar.gz
openvpn-8367889e8467ce73b051aa8db64b0336aea8ed4b.tar.xz
openvpn-8367889e8467ce73b051aa8db64b0336aea8ed4b.zip
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 'ssl.c')
-rw-r--r--ssl.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/ssl.c b/ssl.c
index e7cb46a..93eed18 100644
--- a/ssl.c
+++ b/ssl.c
@@ -290,6 +290,10 @@ pem_password_callback (char *buf, int size, int rwflag, void *u)
static bool auth_user_pass_enabled; /* GLOBAL */
static struct user_pass auth_user_pass; /* GLOBAL */
+#ifdef ENABLE_CLIENT_CR
+static char *auth_challenge; /* GLOBAL */
+#endif
+
void
auth_user_pass_setup (const char *auth_file)
{
@@ -298,6 +302,8 @@ auth_user_pass_setup (const char *auth_file)
{
#if AUTO_USERID
get_user_pass_auto_userid (&auth_user_pass, auth_file);
+#elif defined(ENABLE_CLIENT_CR)
+ get_user_pass_cr (&auth_user_pass, auth_file, UP_TYPE_AUTH, GET_USER_PASS_MANAGEMENT|GET_USER_PASS_SENSITIVE, auth_challenge);
#else
get_user_pass (&auth_user_pass, auth_file, UP_TYPE_AUTH, GET_USER_PASS_MANAGEMENT|GET_USER_PASS_SENSITIVE);
#endif
@@ -325,8 +331,29 @@ ssl_purge_auth (void)
#endif
purge_user_pass (&passbuf, true);
purge_user_pass (&auth_user_pass, true);
+#ifdef ENABLE_CLIENT_CR
+ ssl_purge_auth_challenge();
+#endif
+}
+
+#ifdef ENABLE_CLIENT_CR
+
+void
+ssl_purge_auth_challenge (void)
+{
+ free (auth_challenge);
+ auth_challenge = NULL;
}
+void
+ssl_put_auth_challenge (const char *cr_str)
+{
+ ssl_purge_auth_challenge();
+ auth_challenge = string_alloc(cr_str, NULL);
+}
+
+#endif
+
/*
* OpenSSL callback to get a temporary RSA key, mostly
* used for export ciphers.