mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-22 08:27:31 +09:00
Replace NSS with Pale Moon's
This commit is contained in:
parent
ff1e5e48bf
commit
8c2e376f94
2870 changed files with 1762232 additions and 1374220 deletions
5
security/nss/tests/common/certsetup.sh
Normal file → Executable file
5
security/nss/tests/common/certsetup.sh
Normal file → Executable file
|
|
@ -56,6 +56,11 @@ make_cert() {
|
|||
type_args=(-g 2048 --extGeneric 1.3.6.1.4.1.44363.44:not-critical:empty.txt)
|
||||
type=rsa
|
||||
;;
|
||||
delegator_rsa_pss2048)
|
||||
touch empty.txt
|
||||
type_args=(-g 2048 --pss --extGeneric 1.3.6.1.4.1.44363.44:not-critical:empty.txt)
|
||||
type=rsa
|
||||
;;
|
||||
esac
|
||||
msg="create certificate: $@"
|
||||
shift 2
|
||||
|
|
|
|||
2
security/nss/tests/common/cleanup.sh
Normal file → Executable file
2
security/nss/tests/common/cleanup.sh
Normal file → Executable file
|
|
@ -34,6 +34,8 @@ if [ -z "${CLEANUP}" -o "${CLEANUP}" = "${SCRIPTNAME}" ]; then
|
|||
echo "IOPR_HOSTADDR_LIST=${IOPR_HOSTADDR_LIST}"
|
||||
echo "PKITS_DATA=${PKITS_DATA}"
|
||||
echo "NSS_DISABLE_HW_AES=${NSS_DISABLE_HW_AES}"
|
||||
echo "NSS_DISABLE_HW_SHA1=${NSS_DISABLE_HW_SHA1}"
|
||||
echo "NSS_DISABLE_HW_SHA2=${NSS_DISABLE_HW_SHA2}"
|
||||
echo "NSS_DISABLE_PCLMUL=${NSS_DISABLE_PCLMUL}"
|
||||
echo "NSS_DISABLE_AVX=${NSS_DISABLE_AVX}"
|
||||
echo "NSS_DISABLE_ARM_NEON=${NSS_DISABLE_ARM_NEON}"
|
||||
|
|
|
|||
75
security/nss/tests/common/init.sh
Normal file → Executable file
75
security/nss/tests/common/init.sh
Normal file → Executable file
|
|
@ -83,6 +83,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
|
|||
GTESTDIR=${HOSTDIR}/gtests
|
||||
|
||||
PWFILE=${HOSTDIR}/tests.pw
|
||||
LONGPWFILE=${HOSTDIR}/tests.longpw
|
||||
EMPTY_FILE=${HOSTDIR}/tests_empty
|
||||
NOISE_FILE=${HOSTDIR}/tests_noise
|
||||
CORELIST_FILE=${HOSTDIR}/clist
|
||||
|
|
@ -91,6 +92,9 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
|
|||
FIPSBADPWFILE=${HOSTDIR}/tests.fipsbadpw
|
||||
FIPSP12PWFILE=${HOSTDIR}/tests.fipsp12pw
|
||||
|
||||
echo nss > ${PWFILE}
|
||||
echo "nss123456789012345678901234567890123456789012345678901234567890_" > ${LONGPWFILE}
|
||||
echo > ${EMPTY_FILE}
|
||||
echo "fIps140" > ${FIPSPWFILE}
|
||||
echo "fips104" > ${FIPSBADPWFILE}
|
||||
echo "pKcs12fips140" > ${FIPSP12PWFILE}
|
||||
|
|
@ -253,6 +257,72 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
|
|||
HTML_UNKNOWN='</TD><TD>Unknown</TD><TR>'
|
||||
TABLE_ARGS=
|
||||
|
||||
gtest_parse_report_helper()
|
||||
{
|
||||
# Check XML reports for normal test runs and failures.
|
||||
local successes=$(gtest_parse_report_xpath "//testcase[@status='run'][count(*)=0]" "$@" )
|
||||
local failures=$(gtest_parse_report_xpath "//failure/.." "$@" )
|
||||
|
||||
# Print all tests that succeeded.
|
||||
while read result name; do
|
||||
html_passed_ignore_core "$name"
|
||||
done <<< "$successes"
|
||||
|
||||
# Print failing tests.
|
||||
if [ -n "$failures" ]; then
|
||||
printf "\nFAILURES:\n=========\n"
|
||||
|
||||
while read result name; do
|
||||
html_failed_ignore_core "$name"
|
||||
done <<< "$failures"
|
||||
|
||||
printf "\n"
|
||||
fi
|
||||
}
|
||||
|
||||
# This legacy report parser can't actually detect failures. It always relied
|
||||
# on the binary's exit code. Print the tests we ran to keep the old behavior.
|
||||
gtest_parse_report_legacy()
|
||||
{
|
||||
while read result name && [ -n "$name" ]; do
|
||||
if [ "$result" = "notrun" ]; then
|
||||
echo "$name" SKIPPED
|
||||
elif [ "$result" = "run" ]; then
|
||||
html_passed_ignore_core "$name"
|
||||
else
|
||||
html_failed_ignore_core "$name"
|
||||
fi
|
||||
done <<< "$(sed -f "${COMMON}/parsegtestreport.sed" "$@" )"
|
||||
# here's how we would use bash if it wasn't so slow
|
||||
# done <<< "$(sh "${COMMON}/parsegtestreport.sh" "$@" )"
|
||||
}
|
||||
|
||||
gtest_parse_report_xpath()
|
||||
{
|
||||
# Query the XML report with the given XPath pattern.
|
||||
xpath="$1"
|
||||
shift
|
||||
xmllint --xpath "${xpath}" "$@" 2>/dev/null | \
|
||||
# Insert newlines to help sed.
|
||||
sed $'s/<testcase/\\\n<testcase/g' | \
|
||||
# Use sed to parse the report.
|
||||
sed -f "${COMMON}/parsegtestreport.sed"
|
||||
# here's how we would use bash if it wasn't so slow
|
||||
#sh "${COMMON}/parsegtestreport.sh"
|
||||
}
|
||||
|
||||
gtest_parse_report()
|
||||
{
|
||||
if type xmllint &>/dev/null; then
|
||||
echo "DEBUG: Using xmllint to parse GTest XML report(s)"
|
||||
gtest_parse_report_helper "$@"
|
||||
else
|
||||
echo "DEBUG: Falling back to legacy XML report parsing using only sed"
|
||||
gtest_parse_report_legacy "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
#directory name init
|
||||
SCRIPTNAME=init.sh
|
||||
|
|
@ -593,6 +663,7 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
|
|||
fi
|
||||
|
||||
R_PWFILE=../tests.pw
|
||||
R_LONGPWFILE=../tests.longpw
|
||||
R_EMPTY_FILE=../tests_empty
|
||||
R_NOISE_FILE=../tests_noise
|
||||
|
||||
|
|
@ -651,9 +722,9 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
|
|||
|
||||
RELOAD_CRL=1
|
||||
|
||||
# if test mode isn't set, test scripts default to expecting dbm
|
||||
# if test mode isn't set, test scripts default to expecting sql
|
||||
if [ "${TEST_MODE}" = "" ]; then
|
||||
NSS_DEFAULT_DB_TYPE="dbm"
|
||||
NSS_DEFAULT_DB_TYPE=${NSS_DEFAULT_DB_TYPE:-"sql"}
|
||||
export NSS_DEFAULT_DB_TYPE
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
/\<testcase/{
|
||||
s/^.* name="\([^"]*\)" value_param="\([^"]*\)" status="\([^"]*\)" time="[^"]*" classname="\([^"]*\)".*$/\3 '\4: \1 \2'/
|
||||
s/^.* name="\([^"]*\)" value_param="\([^"]*\)" status="\([^"]*\)" time="[^"]*" classname="\([^"]*\).*$/\3 '\4: \1 \2'/
|
||||
t end
|
||||
s/^.* name="\([^"]*\)" status="\([^"]*\)" time="[^"]*" classname="\([^"]*\)".*$/\2 '\3: \1'/
|
||||
t end
|
||||
s/^.* name="\([^"]*\)" value_param="\([^"]*\)" status="\([^"]*\)" result="[^"]*" time="[^"]*" timestamp="[^"]*" classname="\([^"]*\)".*$/\3 '\4: \1 \2'/
|
||||
t end
|
||||
s/^.* name="\([^"]*\)" status="\([^"]*\)" result="[^"]*" time="[^"]*" timestamp="[^"]*" classname="\([^"]*\)".*$/\2 '\3: \1'/
|
||||
t end
|
||||
}
|
||||
d
|
||||
: end
|
||||
|
|
|
|||
44
security/nss/tests/common/parsegtestreport.sh
Normal file
44
security/nss/tests/common/parsegtestreport.sh
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# parse the gtest results file this replaces a sed script which produced
|
||||
# the identical output. This new script is now independent of new unknown
|
||||
# labels being introduced in future revisions of gtests.
|
||||
|
||||
#this function extracts the appropriate value from
|
||||
# <testcase label="value1" label2="value2" label3="value3" />
|
||||
# which value is selected from the label , which is specified
|
||||
# as the 2nd parameter. The line to parse is the first parameter.
|
||||
getvalue()
|
||||
{
|
||||
pattern1='*'${2}'="'
|
||||
pattern2='"*'
|
||||
front=${1#${pattern1}}
|
||||
if [[ "${front}" != "${1}" ]]; then
|
||||
val=${front%%${pattern2}}
|
||||
# as we output the result, restore any quotes that may have
|
||||
# been in the original test names.
|
||||
echo ${val//"/\"}
|
||||
fi
|
||||
}
|
||||
|
||||
parse()
|
||||
{
|
||||
while read line
|
||||
do
|
||||
if [[ "${line}" =~ "<testcase " ]]; then
|
||||
name=$(getvalue "${line}" "name")
|
||||
value=$(getvalue "${line}" "value_param")
|
||||
stat=$(getvalue "${line}" "status")
|
||||
class=$(getvalue "${line}" "classname")
|
||||
echo "${stat} '${class}: $(echo ${name} ${value})'"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# if no arguments, just take standard in, if arguments, take the args as
|
||||
# files and cat them together to parse
|
||||
if [ $# -eq 0 ]; then
|
||||
parse
|
||||
else
|
||||
cat "$@" | parse
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue