From 29b751095713fbd1f7a22242e652aa84ef2b380b Mon Sep 17 00:00:00 2001 From: neilpang Date: Fri, 4 Nov 2016 22:22:01 +0800 Subject: [PATCH] add sign error check. --- acme.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/acme.sh b/acme.sh index 3f4fbebb..18453b6d 100755 --- a/acme.sh +++ b/acme.sh @@ -1185,7 +1185,13 @@ _send_signed_request() { protected64="$(printf "$protected" | _base64 | _urlencode)" _debug3 protected64 "$protected64" - sig=$(printf "%s" "$protected64.$payload64" | _sign "$keyfile" "sha256" | _urlencode) + if ! _sig_t="$(printf "%s" "$protected64.$payload64" | _sign "$keyfile" "sha256")" ; then + _err "Sign request failed." + return 1 + fi + _debug3 _sig_t "$_sig_t" + + sig="$(printf "%s" "$_sig_t" | _urlencode)" _debug3 sig "$sig" body="{\"header\": $JWK_HEADER, \"protected\": \"$protected64\", \"payload\": \"$payload64\", \"signature\": \"$sig\"}"