From 3fa86d237721ca113fa020b7e888a1e10374a560 Mon Sep 17 00:00:00 2001 From: Markus Koetter Date: Fri, 10 Dec 2010 20:30:09 +0100 Subject: Add extv3 X509 field support to --x509-username-field This allows using other X509 certificate fields for the certificate authentication. To use altSubjectName, use --x509-username-field ext:altSubjectName This feature requires OpenVPN to be built with --enable-x509-alt-username This patch is slightly modified, to honour --enable-x509-alt-username compile time configuration. Two #ifdef's are added. Signed-off-by: Markus Koetter Signed-off-by: David Sommerseth Acked-by: David Sommerseth Signed-off-by: David Sommerseth --- options.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'options.c') diff --git a/options.c b/options.c index f4eeaee..4c28a8f 100644 --- a/options.c +++ b/options.c @@ -5907,7 +5907,8 @@ add_option (struct options *options, { char *s = p[1]; VERIFY_PERMISSION (OPT_P_GENERAL); - while ((*s = toupper(*s)) != '\0') s++; /* Uppercase if necessary */ + if( strncmp ("ext:",s,4) != 0 ) + while ((*s = toupper(*s)) != '\0') s++; /* Uppercase if necessary */ options->x509_username_field = p[1]; } #endif /* ENABLE_X509ALTUSERNAME */ -- cgit v1.2.3