Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
S1OVS
openvpn-server
Commits
7568bd9a
Commit
7568bd9a
authored
Jul 06, 2021
by
Lindsay Harvey
Browse files
Update client certificate common name length limit to 30 chars in fuctions.sh
parent
cd9fbf94
Pipeline
#1112
passed with stage
in 14 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
functions.sh
View file @
7568bd9a
...
@@ -26,7 +26,7 @@ function ask_key_questions
...
@@ -26,7 +26,7 @@ function ask_key_questions
{
{
echo
""
echo
""
read
-p
"Common Name of certificate, this should be unique,
read
-p
"Common Name of certificate, this should be unique,
using 4 to
15
upper or lowercase letters or numbers and _ ONLY: "
OVPN_COMMONNAME
using 4 to
30
upper or lowercase letters or numbers and _ ONLY: "
OVPN_COMMONNAME
# OVPN_COMMONNAME <-- This is the variable to return to the other script
# OVPN_COMMONNAME <-- This is the variable to return to the other script
# Yes I stole this validation test from the init script so yes it could be optimized
# Yes I stole this validation test from the init script so yes it could be optimized
...
@@ -40,7 +40,7 @@ if [ $COUNT -eq 0 ]; then
...
@@ -40,7 +40,7 @@ if [ $COUNT -eq 0 ]; then
COMMONNAME_VALID
=
0
COMMONNAME_VALID
=
0
else
else
#There was something entered so lets validate OVPN_COMMONNAME
#There was something entered so lets validate OVPN_COMMONNAME
if
[
$COUNT
-gt
3
]
&&
[
$COUNT
-lt
1
6
]
;
then
if
[
$COUNT
-gt
3
]
&&
[
$COUNT
-lt
3
1
]
;
then
#We have between 4 and 12 characters in the variable, lets validate they are valid
#We have between 4 and 12 characters in the variable, lets validate they are valid
if
[[
$OVPN_COMMONNAME
=
~ ^[0-9A-Za-z_]+
$
]]
;
then
if
[[
$OVPN_COMMONNAME
=
~ ^[0-9A-Za-z_]+
$
]]
;
then
COMMONNAME_VALID
=
1
#Yay! winner winner, chicken dinner
COMMONNAME_VALID
=
1
#Yay! winner winner, chicken dinner
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment