mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 09:57:32 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
106
security/nss/tests/dbupgrade/dbupgrade.sh
Normal file
106
security/nss/tests/dbupgrade/dbupgrade.sh
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# mozilla/security/nss/tests/dbupgrade/dbupgrade.sh
|
||||
#
|
||||
# Script to upgrade databases to Shared DB
|
||||
#
|
||||
# needs to work on all Unix and Windows platforms
|
||||
#
|
||||
# special strings
|
||||
# ---------------
|
||||
# FIXME ... known problems, search for this string
|
||||
# NOTE .... unexpected behavior
|
||||
#
|
||||
########################################################################
|
||||
|
||||
############################ dbupgrade_init ############################
|
||||
# local shell function to initialize this script
|
||||
########################################################################
|
||||
dbupgrade_init()
|
||||
{
|
||||
if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
|
||||
cd ${QADIR}/common
|
||||
. ./init.sh
|
||||
fi
|
||||
|
||||
if [ ! -r "${CERT_LOG_FILE}" ]; then # we need certificates here
|
||||
cd ${QADIR}/cert
|
||||
. ./cert.sh
|
||||
fi
|
||||
|
||||
if [ ! -d ${HOSTDIR}/SDR ]; then # we also need sdr as well
|
||||
cd ${QADIR}/sdr
|
||||
. ./sdr.sh
|
||||
fi
|
||||
|
||||
SCRIPTNAME=dbupgrade.sh
|
||||
if [ -z "${CLEANUP}" ] ; then # if nobody else is responsible for
|
||||
CLEANUP="${SCRIPTNAME}" # cleaning this script will do it
|
||||
fi
|
||||
|
||||
echo "$SCRIPTNAME: DB upgrade tests ==============================="
|
||||
}
|
||||
|
||||
############################ dbupgrade_main ############################
|
||||
# local shell function to upgrade certificate databases
|
||||
########################################################################
|
||||
dbupgrade_main()
|
||||
{
|
||||
# 'reset' the databases to initial values
|
||||
echo "Reset databases to their initial values:"
|
||||
cd ${HOSTDIR}
|
||||
${BINDIR}/certutil -D -n objsigner -d alicedir 2>&1
|
||||
${BINDIR}/certutil -M -n FIPS_PUB_140_Test_Certificate -t "C,C,C" -d fips -f ${FIPSPWFILE} 2>&1
|
||||
${BINDIR}/certutil -L -d fips 2>&1
|
||||
rm -f smime/alicehello.env
|
||||
|
||||
# test upgrade to the new database
|
||||
echo "nss" > ${PWFILE}
|
||||
html_head "Legacy to shared Library update"
|
||||
dirs="alicedir bobdir CA cert_extensions client clientCA dave eccurves eve ext_client ext_server SDR server serverCA ssl_gtests stapling tools/copydir"
|
||||
for i in $dirs
|
||||
do
|
||||
echo $i
|
||||
if [ -d $i ]; then
|
||||
echo "upgrading db $i"
|
||||
${BINDIR}/certutil -G -g 512 -d sql:$i -f ${PWFILE} -z ${NOISE_FILE} 2>&1
|
||||
html_msg $? 0 "Upgrading $i"
|
||||
else
|
||||
echo "skipping db $i"
|
||||
html_msg 0 0 "No directory $i"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -d fips ]; then
|
||||
echo "upgrading db fips"
|
||||
${BINDIR}/certutil -S -g 1024 -n tmprsa -t "u,u,u" -s "CN=tmprsa, C=US" -x -d sql:fips -f ${FIPSPWFILE} -z ${NOISE_FILE} 2>&1
|
||||
html_msg $? 0 "Upgrading fips"
|
||||
# remove our temp certificate we created in the fist token
|
||||
${BINDIR}/certutil -F -n tmprsa -d sql:fips -f ${FIPSPWFILE} 2>&1
|
||||
${BINDIR}/certutil -L -d sql:fips 2>&1
|
||||
fi
|
||||
|
||||
html "</TABLE><BR>"
|
||||
}
|
||||
|
||||
########################## dbupgrade_cleanup ###########################
|
||||
# local shell function to finish this script (no exit since it might be
|
||||
# sourced)
|
||||
########################################################################
|
||||
dbupgrade_cleanup()
|
||||
{
|
||||
cd ${QADIR}
|
||||
. common/cleanup.sh
|
||||
}
|
||||
|
||||
################################# main #################################
|
||||
|
||||
dbupgrade_init
|
||||
dbupgrade_main
|
||||
dbupgrade_cleanup
|
||||
Loading…
Add table
Add a link
Reference in a new issue