Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor, output thumbprint #590

Merged
merged 1 commit into from
Feb 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions acme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2489,6 +2489,10 @@ __calcAccountKeyHash() {
[ -f "$ACCOUNT_KEY_PATH" ] && _digest sha256 <"$ACCOUNT_KEY_PATH"
}

__calc_account_thumbprint() {
printf "%s" "$jwk" | tr -d ' ' | _digest "sha256" | _url_replace
}

#keylength
_regAccount() {
_initpath
Expand Down Expand Up @@ -2579,6 +2583,8 @@ _regAccount() {
return 1
fi
fi
ACCOUNT_THUMBPRINT="$(__calc_account_thumbprint)"
_info "ACCOUNT_THUMBPRINT" "$ACCOUNT_THUMBPRINT"
return 0
done

Expand Down Expand Up @@ -2810,8 +2816,7 @@ issue() {
fi

if [ -z "$thumbprint" ]; then
accountkey_json=$(printf "%s" "$jwk" | tr -d ' ')
thumbprint=$(printf "%s" "$accountkey_json" | _digest "sha256" | _url_replace)
thumbprint="$(__calc_account_thumbprint)"
fi

entry="$(printf "%s\n" "$response" | _egrep_o '[^\{]*"type":"'$vtype'"[^\}]*')"
Expand Down