mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-04-29 17:42:44 +00:00
Merge b0a081e0c93dbd205c330fd0a40cd2fff9636514 into b0535d8b40a30f9fd2b26b3ea2a49469dcb4d0a8
This commit is contained in:
commit
9477b255c7
32
acme.sh
32
acme.sh
@ -3690,10 +3690,10 @@ _on_issue_success() {
|
|||||||
#account_key_length eab-kid eab-hmac-key
|
#account_key_length eab-kid eab-hmac-key
|
||||||
registeraccount() {
|
registeraccount() {
|
||||||
_account_key_length="$1"
|
_account_key_length="$1"
|
||||||
_eab_id="$2"
|
_eab_kid="$2"
|
||||||
_eab_hmac_key="$3"
|
_eab_hmac_key="$3"
|
||||||
_initpath
|
_initpath
|
||||||
_regAccount "$_account_key_length" "$_eab_id" "$_eab_hmac_key"
|
_regAccount "$_account_key_length" "$_eab_kid" "$_eab_hmac_key"
|
||||||
}
|
}
|
||||||
|
|
||||||
__calcAccountKeyHash() {
|
__calcAccountKeyHash() {
|
||||||
@ -3723,7 +3723,7 @@ _getAccountEmail() {
|
|||||||
_regAccount() {
|
_regAccount() {
|
||||||
_initpath
|
_initpath
|
||||||
_reg_length="$1"
|
_reg_length="$1"
|
||||||
_eab_id="$2"
|
_eab_kid="$2"
|
||||||
_eab_hmac_key="$3"
|
_eab_hmac_key="$3"
|
||||||
_debug3 _regAccount "$_regAccount"
|
_debug3 _regAccount "$_regAccount"
|
||||||
_initAPI
|
_initAPI
|
||||||
@ -3740,13 +3740,13 @@ _regAccount() {
|
|||||||
if ! _calcjwk "$ACCOUNT_KEY_PATH"; then
|
if ! _calcjwk "$ACCOUNT_KEY_PATH"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [ "$_eab_id" ] && [ "$_eab_hmac_key" ]; then
|
if [ "$_eab_kid" ] && [ "$_eab_hmac_key" ]; then
|
||||||
_savecaconf CA_EAB_KEY_ID "$_eab_id"
|
_savecaconf CA_EAB_KEY_ID "$_eab_kid"
|
||||||
_savecaconf CA_EAB_HMAC_KEY "$_eab_hmac_key"
|
_savecaconf CA_EAB_HMAC_KEY "$_eab_hmac_key"
|
||||||
fi
|
fi
|
||||||
_eab_id=$(_readcaconf "CA_EAB_KEY_ID")
|
_eab_kid=$(_readcaconf "CA_EAB_KEY_ID")
|
||||||
_eab_hmac_key=$(_readcaconf "CA_EAB_HMAC_KEY")
|
_eab_hmac_key=$(_readcaconf "CA_EAB_HMAC_KEY")
|
||||||
_secure_debug3 _eab_id "$_eab_id"
|
_secure_debug3 _eab_kid "$_eab_kid"
|
||||||
_secure_debug3 _eab_hmac_key "$_eab_hmac_key"
|
_secure_debug3 _eab_hmac_key "$_eab_hmac_key"
|
||||||
_email="$(_getAccountEmail)"
|
_email="$(_getAccountEmail)"
|
||||||
if [ "$_email" ]; then
|
if [ "$_email" ]; then
|
||||||
@ -3754,7 +3754,7 @@ _regAccount() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$ACME_DIRECTORY" = "$CA_ZEROSSL" ]; then
|
if [ "$ACME_DIRECTORY" = "$CA_ZEROSSL" ]; then
|
||||||
if [ -z "$_eab_id" ] || [ -z "$_eab_hmac_key" ]; then
|
if [ -z "$_eab_kid" ] || [ -z "$_eab_hmac_key" ]; then
|
||||||
_info "No EAB credentials found for ZeroSSL, let's obtain them"
|
_info "No EAB credentials found for ZeroSSL, let's obtain them"
|
||||||
if [ -z "$_email" ]; then
|
if [ -z "$_email" ]; then
|
||||||
_info "$(__green "$PROJECT_NAME is using ZeroSSL as default CA now.")"
|
_info "$(__green "$PROJECT_NAME is using ZeroSSL as default CA now.")"
|
||||||
@ -3770,10 +3770,10 @@ _regAccount() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
_secure_debug2 _eabresp "$_eabresp"
|
_secure_debug2 _eabresp "$_eabresp"
|
||||||
_eab_id="$(echo "$_eabresp" | tr ',}' '\n\n' | grep '"eab_kid"' | cut -d : -f 2 | tr -d '"')"
|
_eab_kid="$(echo "$_eabresp" | tr ',}' '\n\n' | grep '"eab_kid"' | cut -d : -f 2 | tr -d '"')"
|
||||||
_secure_debug2 _eab_id "$_eab_id"
|
_secure_debug2 _eab_kid "$_eab_kid"
|
||||||
if [ -z "$_eab_id" ]; then
|
if [ -z "$_eab_kid" ]; then
|
||||||
_err "Cannot resolve _eab_id"
|
_err "Cannot resolve _eab_kid"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
_eab_hmac_key="$(echo "$_eabresp" | tr ',}' '\n\n' | grep '"eab_hmac_key"' | cut -d : -f 2 | tr -d '"')"
|
_eab_hmac_key="$(echo "$_eabresp" | tr ',}' '\n\n' | grep '"eab_hmac_key"' | cut -d : -f 2 | tr -d '"')"
|
||||||
@ -3782,12 +3782,12 @@ _regAccount() {
|
|||||||
_err "Cannot resolve _eab_hmac_key"
|
_err "Cannot resolve _eab_hmac_key"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
_savecaconf CA_EAB_KEY_ID "$_eab_id"
|
_savecaconf CA_EAB_KEY_ID "$_eab_kid"
|
||||||
_savecaconf CA_EAB_HMAC_KEY "$_eab_hmac_key"
|
_savecaconf CA_EAB_HMAC_KEY "$_eab_hmac_key"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$_eab_id" ] && [ "$_eab_hmac_key" ]; then
|
if [ "$_eab_kid" ] && [ "$_eab_hmac_key" ]; then
|
||||||
eab_protected="{\"alg\":\"HS256\",\"kid\":\"$_eab_id\",\"url\":\"${ACME_NEW_ACCOUNT}\"}"
|
eab_protected="{\"alg\":\"HS256\",\"kid\":\"$_eab_kid\",\"url\":\"${ACME_NEW_ACCOUNT}\"}"
|
||||||
_debug3 eab_protected "$eab_protected"
|
_debug3 eab_protected "$eab_protected"
|
||||||
|
|
||||||
eab_protected64=$(printf "%s" "$eab_protected" | _base64 | _url_replace)
|
eab_protected64=$(printf "%s" "$eab_protected" | _base64 | _url_replace)
|
||||||
@ -4503,7 +4503,7 @@ issue() {
|
|||||||
_debug2 _saved_account_key_hash "$_saved_account_key_hash"
|
_debug2 _saved_account_key_hash "$_saved_account_key_hash"
|
||||||
|
|
||||||
if [ -z "$ACCOUNT_URL" ] || [ -z "$_saved_account_key_hash" ] || [ "$_saved_account_key_hash" != "$(__calcAccountKeyHash)" ]; then
|
if [ -z "$ACCOUNT_URL" ] || [ -z "$_saved_account_key_hash" ] || [ "$_saved_account_key_hash" != "$(__calcAccountKeyHash)" ]; then
|
||||||
if ! _regAccount "$_accountkeylength"; then
|
if ! _regAccount "$_accountkeylength" "$_eab_kid" "$_eab_hmac_key"; then
|
||||||
_on_issue_err "$_post_hook"
|
_on_issue_err "$_post_hook"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user