3
# This Source Code Form is subject to the terms of the Mozilla Public
4
# License, v. 2.0. If a copy of the MPL was not distributed with this
5
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
########################################################################
9
# mozilla/security/nss/tests/crmf/crmf.sh
11
# Script to test NSS crmf library (a static library)
13
# needs to work on all Unix and Windows platforms
17
# FIXME ... known problems, search for this string
18
# NOTE .... unexpected behavior
20
########################################################################
22
############################## smime_init ##############################
23
# local shell function to initialize this script
24
########################################################################
27
SCRIPTNAME=crmf.sh # sourced - $0 would point to all.sh
29
if [ -z "${CLEANUP}" ] ; then # if nobody else is responsible for
30
CLEANUP="${SCRIPTNAME}" # cleaning this script will do it
33
if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
37
if [ ! -r $CERT_LOG_FILE ]; then # we need certificates here
41
html_head "CRMF/CMMF Tests"
43
# cmrf uses the S/MIME certs to test with
44
grep "SUCCESS: SMIME passed" $CERT_LOG_FILE >/dev/null || {
45
Exit 11 "Fatal - S/MIME of cert.sh needs to pass first"
48
CRMFDIR=${HOSTDIR}/crmf
54
############################## crmf_main ##############################
55
# local shell function to test basic CRMF request and CMMF responses
57
########################################################################
60
echo "$SCRIPTNAME: CRMF/CMMF Tests ------------------------------"
61
echo "crmftest -d ${P_R_BOBDIR} -p Bob -e dave@bogus.com -s TestCA -P nss crmf decode"
62
${BINDIR}/crmftest -d ${P_R_BOBDIR} -p Bob -e dave@bogus.com -s TestCA -P nss crmf decode
63
html_msg $? 0 "CRMF test" "."
65
echo "crmftest -d ${P_R_BOBDIR} -p Bob -e dave@bogus.com -s TestCA -P nss cmmf"
66
${BINDIR}/crmftest -d ${P_R_BOBDIR} -p Bob -e dave@bogus.com -s TestCA -P nss cmmf
67
html_msg $? 0 "CMMF test" "."
69
# Add tests for key recovery and challange as crmftest's capabilities increase
73
############################## crmf_cleanup ###########################
74
# local shell function to finish this script (no exit since it might be
76
########################################################################
84
################## main #################################################