Commit 668a2757 authored by Vincent Pelletier's avatar Vincent Pelletier

shell/caucase.sh: Remove unnecessary return statements.

If there is no return statement, shell functions return the status of the
last command they ran. So "return $?" as last function statement is
superfluous.
parent 45385484
......@@ -207,7 +207,6 @@ PUTNoOut () {
_matchCertificateBoundary () {
test "$1" = '-----END CERTIFICATE-----'
return $?
}
_matchPrivateKeyBoundary () {
......@@ -270,7 +269,6 @@ expiresBefore () {
enddate="$(openssl x509 -enddate -noout | sed 's/^[^=]*=//')"
test $? -ne 0 && return 1
test "$(date --date="$enddate" +%s)" -lt "$1"
return $?
}
printIfExpiresAfter () {
......@@ -314,7 +312,6 @@ checkCertificateMatchesKey () {
)" = "$(
echo "$2" | openssl rsa -modulus -noout | sed 's/^Modulus=//'
)"
return $?
}
checkDeps () {
......@@ -412,7 +409,6 @@ revokeCertificate () {
--header 'Content-Type: application/json' \
--insecure \
"$1/crt/revoke/"
return $?
}
revokeCRTWithoutKey () {
......@@ -424,7 +420,6 @@ revokeCRTWithoutKey () {
--header 'Content-Type: application/json' \
--cacert "$2" \
"$1/crt/revoke/"
return $?
}
revokeSerial () {
......@@ -436,7 +431,6 @@ revokeSerial () {
--header 'Content-Type: application/json' \
--cacert "$2" \
"$1/crt/revoke/"
return $?
}
updateCACertificate () {
......@@ -476,19 +470,16 @@ updateCACertificate () {
getCertificateRevocationList () {
# Usage: <url> <ca>
CURL --insecure "$1/crl" | openssl crl -CAfile "$2" 2> /dev/null
return $?
}
getCertificateSigningRequest () {
# Usage: <url> <csr id>
CURL --insecure "$1/csr/$2"
return $?
}
getPendingCertificateRequestList () {
# Usage: <url> <ca> <user crt>
CURL --cert "$3" --cacert "$2" "$1/csr"
return $?
}
createCertificateSigningRequest () {
......@@ -503,13 +494,11 @@ createCertificateSigningRequest () {
;;
esac
done
return $?
}
deletePendingCertificateRequest () {
# Usage: <url> <ca> <user crt> <csr id>
CURL --request DELETE --cert "$3" --cacert "$2" "$1/csr/$4"
return $?
}
getCertificate () {
......@@ -540,7 +529,6 @@ createCertificateWith () {
# Usage: <url> <ca> <user crt> <csr id> < csr
PUTNoOut --cert "$3" --cacert "$2" \
--header 'Content-Type: application/pkcs10' "$1/crt/$4"
return $?
}
if [ $# -ne 0 ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment