Skip to content

Commit

Permalink
Allow round brackets in ISSUER_URI
Browse files Browse the repository at this point in the history
Rather than silently stripping them.

I think this is safe, certainly it works in this case, but this was originally stripped out in matteocorti@5cb0158
  • Loading branch information
peternewman authored Dec 11, 2020
1 parent b9d3629 commit 13201d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions check_ssl_cert
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@ main() {
# we just consider the first URI
# TODO check SC2016
# shellcheck disable=SC2086,SC2016
ISSUER_URI="$(${OPENSSL} "${OPENSSL_COMMAND}" ${OPENSSL_PARAMS} -in "${CERT}" -text -noout | grep "CA Issuers" | head -n 1 | sed -e "s/^.*CA Issuers - URI://" | tr -d '"!|;$(){}<>`&')"
ISSUER_URI="$(${OPENSSL} "${OPENSSL_COMMAND}" ${OPENSSL_PARAMS} -in "${CERT}" -text -noout | grep "CA Issuers" | head -n 1 | sed -e "s/^.*CA Issuers - URI://" | tr -d '"!|;${}<>`&')"

# TODO: should be checked
# shellcheck disable=SC2021
Expand Down Expand Up @@ -2777,9 +2777,9 @@ main() {
debuglog "OCSP: fetching issuer certificate ${ISSUER_URI} to ${ISSUER_CERT_TMP}"

if [ -n "${CURL_USER_AGENT}" ] ; then
exec_with_timeout "${TIMEOUT}" "${CURL_BIN} ${CURL_PROXY} ${CURL_PROXY_ARGUMENT} ${INETPROTO} --silent --user-agent '${CURL_USER_AGENT}' --location ${ISSUER_URI} > ${ISSUER_CERT_TMP}"
exec_with_timeout "${TIMEOUT}" "${CURL_BIN} ${CURL_PROXY} ${CURL_PROXY_ARGUMENT} ${INETPROTO} --silent --user-agent '${CURL_USER_AGENT}' --location \\\"${ISSUER_URI}\\\" > ${ISSUER_CERT_TMP}"
else
exec_with_timeout "${TIMEOUT}" "${CURL_BIN} ${CURL_PROXY} ${CURL_PROXY_ARGUMENT} ${INETPROTO} --silent --location ${ISSUER_URI} > ${ISSUER_CERT_TMP}"
exec_with_timeout "${TIMEOUT}" "${CURL_BIN} ${CURL_PROXY} ${CURL_PROXY_ARGUMENT} ${INETPROTO} --silent --location \\\"${ISSUER_URI}\\\" > ${ISSUER_CERT_TMP}"
fi

debuglog "OCSP: issuer certificate type: $(${FILE_BIN} "${ISSUER_CERT_TMP}" | sed 's/.*://' )"
Expand Down

0 comments on commit 13201d9

Please sign in to comment.