Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2017-08-18 15:14:28 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2017-08-18 15:14:28 +0300
commit4a673aebc7003f269e49f3dd738f8678e29f1cc9 (patch)
treeb5b41cf77f45fd7d0aa1c5c7cd558b28d147b1e5 /include/tests_crypto
parentf60db7d950a60c1935dfd0e3c277cede81d494ae (diff)
[CRYP-7902] certificate validation changed
Diffstat (limited to 'include/tests_crypto')
-rw-r--r--include/tests_crypto5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/tests_crypto b/include/tests_crypto
index 14cf92ae..56438178 100644
--- a/include/tests_crypto
+++ b/include/tests_crypto
@@ -54,11 +54,12 @@
COUNT_DIR=$((COUNT_DIR + 1))
LogText "Test: checking certificate ${FILE}"
# Check certificate where 'end date' has been expired
- EXIT_CODE=$(${OPENSSLBINARY} x509 -noout -checkend 0 -in ${FILE} -enddate 2> /dev/null ; echo $?)
+ FIND=$(${OPENSSLBINARY} x509 -noout -checkend 0 -in ${FILE} -enddate 2> /dev/null)
+ EXIT_CODE=$?
CERT_CN=$(${OPENSSLBINARY} x509 -noout -subject -in ${FILE} 2> /dev/null | ${SEDBINARY} -e 's/^subject.*CN=\([a-zA-Z0-9\.\-\*]*\).*$/\1/')
CERT_NOTAFTER=$(${OPENSSLBINARY} x509 -noout -enddate -in ${FILE} 2> /dev/null | ${AWKBINARY} -F= '{if ($1=="notAfter") { print $2 }}')
Report "certificate[]=${FILE}|${EXIT_CODE}|cn:${CERT_CN};notafter:${CERT_NOTAFTER};|"
- if [ "${EXIT_CODE}" = "0" ]; then
+ if [ ${EXIT_CODE} -eq 0 ]; then
LogText "Result: certificate ${FILE} seems to be correct and still valid"
else
FOUNDPROBLEM=1