]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
CC_PRINT character class now allows any 8-bit character value >= 32.
authorJames Yonan <james@openvpn.net>
Fri, 19 Aug 2011 03:10:08 +0000 (03:10 +0000)
committerDavid Sommerseth <davids@redhat.com>
Wed, 24 Aug 2011 11:34:26 +0000 (13:34 +0200)
This is done to allow UTF-8 and restrict the use of control characters
in usernames, passwords, common names, etc.

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@7538 e7ae566f-a301-0410-adde-c780ea21d3b5

buffer.c

index ce28cb002160da789924dcc0023831b9d12e9227..f3221250f5c80e1857a70f0f8de95037ec31d505 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -720,7 +720,7 @@ char_class (const unsigned char c, const unsigned int flags)
     return true;
   if ((flags & CC_DIGIT) && isdigit (c))
     return true;
-  if ((flags & CC_PRINT) && (isprint (c) || c >= 0x7f)) /* allow UTF-8 */
+  if ((flags & CC_PRINT) && (c >= 32)) /* allow ascii non-control and UTF-8 */
     return true;
   if ((flags & CC_PUNCT) && ispunct (c))
     return true;