From 1643b476eb322c431697aab35ae5aa075483ce35 Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 27 Aug 2016 20:00:47 +0800 Subject: [PATCH] fix bugs. --- acme.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/acme.sh b/acme.sh index e797fb63..d4493b06 100755 --- a/acme.sh +++ b/acme.sh @@ -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 "_readAllDomainListFromCSR mycsr.csr" + _usage "_readKeyLengthFromCSR 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