[CRYP-7902] prevent test from showing error on screen related to wrong certificate file

This commit is contained in:
Michael Boelen 2017-07-18 11:51:45 +02:00
parent b301a1c108
commit 60f94fef47
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@
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 > /dev/null ; echo $?)
EXIT_CODE=$(${OPENSSLBINARY} x509 -noout -checkend 0 -in ${FILE} -enddate 2> /dev/null ; echo $?)
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};|"