aboutsummaryrefslogtreecommitdiff
path: root/ssl.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-07-19 00:29:31 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-07-19 00:29:31 +0000
commit7621883663b7948faccc610e12e017cd8f0b16df (patch)
tree304a23d3a68569ad287734b9dff71751d029f9ca /ssl.c
parentAdded a warning when plugins are specified without (diff)
downloadopenvpn-7621883663b7948faccc610e12e017cd8f0b16df.tar.xz
Replace leading dash ('-') characters in an X509 name with underbars ('_')
before calling user-defined scripts, to preclude the chance of a leading dash being interpreted as an option prefix. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3083 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'ssl.c')
-rw-r--r--ssl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ssl.c b/ssl.c
index bbb998b..9f7aa9d 100644
--- a/ssl.c
+++ b/ssl.c
@@ -554,6 +554,9 @@ verify_callback (int preverify_ok, X509_STORE_CTX * ctx)
/* enforce character class restrictions in X509 name */
string_mod (subject, X509_NAME_CHAR_CLASS, 0, '_');
+ string_replace_leading (subject, '-', '_');
+
+ msg (M_INFO, "X509: '%s'", subject); // JYFIXME
/* extract the common name */
#ifdef USE_OLD_EXTRACT_X509_FIELD