From: Lukas Schauer Date: Sat, 19 Dec 2015 22:24:29 +0000 (+0100) Subject: wat. removed some unnecessary code. X-Git-Tag: v0.1.0~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f70f3048f95007e286bd6467022c8c45515efb87;p=thirdparty%2Fdehydrated.git wat. removed some unnecessary code. --- diff --git a/letsencrypt.sh b/letsencrypt.sh index 30507f5..44ba556 100755 --- a/letsencrypt.sh +++ b/letsencrypt.sh @@ -127,8 +127,8 @@ init_system() { fi # Get public components from private key and calculate thumbprint - pubExponent64="$(printf "%06x" "$(openssl rsa -in "${PRIVATE_KEY}" -noout -text | grep publicExponent | head -1 | cut -d' ' -f2)" | hex2bin | urlbase64)" - pubMod64="$(printf '%s' "$(openssl rsa -in "${PRIVATE_KEY}" -noout -modulus | cut -d'=' -f2)" | hex2bin | urlbase64)" + pubExponent64="$(openssl rsa -in "${PRIVATE_KEY}" -noout -text | grep publicExponent | grep -oE "0x[a-f0-9]+" | cut -d'x' -f2 | hex2bin | urlbase64)" + pubMod64="$(openssl rsa -in "${PRIVATE_KEY}" -noout -modulus | cut -d'=' -f2 | hex2bin | urlbase64)" thumbprint="$(printf '%s' '{"e":"'"${pubExponent64}"'","kty":"RSA","n":"'"${pubMod64}"'"}' | openssl sha -sha256 -binary | urlbase64)"