Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
1643b476
Commit
1643b476
authored
Aug 27, 2016
by
neil
Browse files
fix bugs.
parent
5980ebc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
1643b476
...
...
@@ -470,7 +470,7 @@ _readSubjectFromCSR() {
_usage
"_readSubjectFromCSR mycsr.csr"
return
1
fi
openssl req
-noout
-in
"
$_csrfile
"
-subject
| _egrep_o
"CN=.*"
|
cut
-d
=
-f
2 |
cut
-d
/
-f
1
openssl req
-noout
-in
"
$_csrfile
"
-subject
| _egrep_o
"CN=.*"
|
cut
-d
=
-f
2 |
cut
-d
/
-f
1
|
tr
-d
'\n'
}
#_csrfile
...
...
@@ -485,24 +485,24 @@ _readSubjectAltNamesFromCSR() {
_csrsubj
=
"
$(
_readSubjectFromCSR
"
$_csrfile
"
)
"
_debug _csrsubj
"
$_csrsubj
"
_dnsAltnames
=
"
$(
openssl req
-noout
-text
-in
"
$_csrfile
"
|
grep
"^ *DNS:.*"
|
tr
-d
' '
)
"
_dnsAltnames
=
"
$(
openssl req
-noout
-text
-in
"
$_csrfile
"
|
grep
"^ *DNS:.*"
|
tr
-d
'
\n
'
)
"
_debug _dnsAltnames
"
$_dnsAltnames
"
if
_contains
"
$_dnsAltnames
,"
"DNS:
$_csrsubj
,"
;
then
_debug
"AltNames contains subject"
_dnsAltnames
=
"
$(
echo
"
$_dnsAltnames
,"
|
sed
"s/DNS:
$_csrsubj
,//g"
)
"
_dnsAltnames
=
"
$(
printf
"%s"
"
$_dnsAltnames
,"
|
sed
"s/DNS:
$_csrsubj
,//g"
)
"
else
_debug
"AltNames doesn't contain subject"
fi
echo
"
$_dnsAltnames
"
|
sed
"s/DNS://g"
printf
"%s"
"
$_dnsAltnames
"
|
sed
"s/DNS://g"
}
#_csrfile
_readKeyLengthFromCSR
()
{
_csrfile
=
"
$1
"
if
[
-z
"
$_csrfile
"
]
;
then
_usage
"_read
AllDomainList
FromCSR mycsr.csr"
_usage
"_read
KeyLength
FromCSR mycsr.csr"
return
1
fi
...
...
@@ -581,7 +581,7 @@ createAccountKey() {
fi
length
=
$1
if
_
startswith
"
$length
"
"ec-"
;
then
if
_
isEccKey
"
$length
"
;
then
length
=
2048
fi
...
...
Write
Preview
Markdown
is supported
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