mirror of
https://github.com/roytam1/palemoon26.git
synced 2026-05-26 13:58:38 +00:00
nss: update to 3.35
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: Mozilla
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: true
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AlwaysBreakAfterDefinitionReturnType: true
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
BreakBeforeBinaryOperators: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BinPackParameters: true
|
||||
BinPackArguments: true
|
||||
ColumnLimit: 0
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
DerivePointerAlignment: true
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
IndentCaseLabels: true
|
||||
IndentWrappedFunctionNames: false
|
||||
IndentFunctionDeclarationAfterType: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
NamespaceIndentation: None
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCSpaceAfterProperty: true
|
||||
ObjCSpaceBeforeProtocolList: false
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 200
|
||||
PointerAlignment: Right
|
||||
SpacesBeforeTrailingComments: 1
|
||||
Cpp11BracedListStyle: false
|
||||
Standard: Cpp03
|
||||
IndentWidth: 4
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
BreakBeforeBraces: Linux
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
SpacesInAngles: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpaceAfterCStyleCast: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
ContinuationIndentWidth: 4
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
SpaceBeforeParens: ControlStatements
|
||||
DisableFormat: false
|
||||
SortIncludes: false
|
||||
...
|
||||
@@ -0,0 +1,21 @@
|
||||
*~
|
||||
*.swp
|
||||
*OPT.OBJ/
|
||||
*DBG.OBJ/
|
||||
*DBG.OBJD/
|
||||
out/*
|
||||
*.pyc
|
||||
*.bak
|
||||
*.out
|
||||
*.rej
|
||||
*.patch
|
||||
GPATH
|
||||
GRTAGS
|
||||
GTAGS
|
||||
#*
|
||||
.#*
|
||||
.ycm_extra_conf.py*
|
||||
fuzz/libFuzzer/*
|
||||
fuzz/corpus
|
||||
fuzz/out
|
||||
.chk
|
||||
@@ -0,0 +1,89 @@
|
||||
---
|
||||
version: 0
|
||||
metadata:
|
||||
name: "NSS Continuous Integration"
|
||||
description: "The Taskcluster task graph for the NSS tree"
|
||||
owner: "mozilla-taskcluster-maintenance@mozilla.com"
|
||||
source: {{{source}}}
|
||||
|
||||
scopes:
|
||||
# Note the below scopes are insecure however these get overriden on the server
|
||||
# side to whatever scopes are set by mozilla-taskcluster.
|
||||
- queue:*
|
||||
- docker-worker:*
|
||||
- scheduler:*
|
||||
|
||||
# Available mustache parameters (see the mozilla-taskcluster source):
|
||||
#
|
||||
# - owner: push user (email address)
|
||||
# - source: URL of this YAML file
|
||||
# - url: repository URL
|
||||
# - project: alias for the destination repository (basename of
|
||||
# the repo url)
|
||||
# - level: SCM level of the destination repository
|
||||
# (1 = try, 3 = core)
|
||||
# - revision: (short) hg revision of the head of the push
|
||||
# - revision_hash: (long) hg revision of the head of the push
|
||||
# - comment: comment of the push
|
||||
# - pushlog_id: id in the pushlog table of the repository
|
||||
#
|
||||
# and functions:
|
||||
# - as_slugid: convert a label into a slugId
|
||||
# - from_now: generate a timestamp at a fixed offset from now
|
||||
|
||||
tasks:
|
||||
- taskId: '{{#as_slugid}}decision task{{/as_slugid}}'
|
||||
reruns: 3
|
||||
task:
|
||||
created: '{{now}}'
|
||||
deadline: '{{#from_now}}1 day{{/from_now}}'
|
||||
expires: '{{#from_now}}14 days{{/from_now}}'
|
||||
|
||||
metadata:
|
||||
owner: mozilla-taskcluster-maintenance@mozilla.com
|
||||
source: {{{source}}}
|
||||
name: "NSS Decision Task"
|
||||
description: |
|
||||
The task that creates all of the other tasks in the task graph
|
||||
|
||||
workerType: "hg-worker"
|
||||
provisionerId: "aws-provisioner-v1"
|
||||
|
||||
tags:
|
||||
createdForUser: {{owner}}
|
||||
|
||||
routes:
|
||||
- "tc-treeherder-stage.v2.{{project}}.{{revision}}.{{pushlog_id}}"
|
||||
- "tc-treeherder.v2.{{project}}.{{revision}}.{{pushlog_id}}"
|
||||
|
||||
payload:
|
||||
image: nssdev/nss-decision:0.0.2
|
||||
|
||||
env:
|
||||
TC_OWNER: {{owner}}
|
||||
TC_SOURCE: {{{source}}}
|
||||
TC_PROJECT: {{project}}
|
||||
TC_COMMENT: '{{comment}}'
|
||||
NSS_PUSHLOG_ID: '{{pushlog_id}}'
|
||||
NSS_HEAD_REPOSITORY: '{{{url}}}'
|
||||
NSS_HEAD_REVISION: '{{revision}}'
|
||||
|
||||
maxRunTime: 1800
|
||||
|
||||
command:
|
||||
- bash
|
||||
- -cx
|
||||
- >
|
||||
bin/checkout.sh &&
|
||||
nss/automation/taskcluster/scripts/extend_task_graph.sh
|
||||
|
||||
features:
|
||||
taskclusterProxy: true
|
||||
|
||||
extra:
|
||||
treeherder:
|
||||
symbol: D
|
||||
build:
|
||||
platform: nss-decision
|
||||
machine:
|
||||
platform: nss-decision
|
||||
+37
-5
@@ -26,7 +26,10 @@ include $(CORE_DEPTH)/coreconf/config.mk
|
||||
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
|
||||
#######################################################################
|
||||
|
||||
|
||||
ifdef NSS_DISABLE_GTESTS
|
||||
DIRS := $(filter-out gtests,$(DIRS))
|
||||
DIRS := $(filter-out cpputil,$(DIRS))
|
||||
endif
|
||||
|
||||
#######################################################################
|
||||
# (5) Execute "global" rules. (OPTIONAL) #
|
||||
@@ -44,7 +47,7 @@ include $(CORE_DEPTH)/coreconf/rules.mk
|
||||
# (7) Execute "local" rules. (OPTIONAL). #
|
||||
#######################################################################
|
||||
|
||||
nss_build_all: build_nspr all
|
||||
nss_build_all: build_nspr all latest
|
||||
|
||||
nss_clean_all: clobber_nspr clobber
|
||||
|
||||
@@ -56,7 +59,11 @@ NSPR_CONFIGURE = $(CORE_DEPTH)/../nspr/configure
|
||||
#
|
||||
|
||||
ifeq ($(OS_TARGET),Android)
|
||||
NSPR_CONFIGURE_OPTS += --with-android-ndk=$(ANDROID_NDK) --target=arm-linux-androideabi --with-android-version=$(OS_TARGET_RELEASE)
|
||||
NSPR_CONFIGURE_OPTS += --with-android-ndk=$(ANDROID_NDK) \
|
||||
--target=$(ANDROID_PREFIX) \
|
||||
--with-android-version=$(OS_TARGET_RELEASE) \
|
||||
--with-android-toolchain=$(ANDROID_TOOLCHAIN) \
|
||||
--with-android-platform=$(ANDROID_SYSROOT)
|
||||
endif
|
||||
ifdef BUILD_OPT
|
||||
NSPR_CONFIGURE_OPTS += --disable-debug --enable-optimize
|
||||
@@ -77,8 +84,18 @@ ifdef USE_STATIC_RTL
|
||||
NSPR_CONFIGURE_OPTS += --enable-static-rtl
|
||||
endif
|
||||
ifdef NS_USE_GCC
|
||||
NSPR_COMPILERS = CC=gcc CXX=g++
|
||||
NSPR_CONFIGURE_ENV = CC=gcc CXX=g++
|
||||
endif
|
||||
ifdef CC
|
||||
NSPR_CONFIGURE_ENV = CC=$(CC)
|
||||
endif
|
||||
ifdef CCC
|
||||
NSPR_CONFIGURE_ENV += CXX=$(CCC)
|
||||
endif
|
||||
# Remove -arch definitions. NSPR can't handle that.
|
||||
NSPR_CONFIGURE_ENV := $(filter-out -arch x86_64,$(NSPR_CONFIGURE_ENV))
|
||||
NSPR_CONFIGURE_ENV := $(filter-out -arch i386,$(NSPR_CONFIGURE_ENV))
|
||||
NSPR_CONFIGURE_ENV := $(filter-out -arch ppc,$(NSPR_CONFIGURE_ENV))
|
||||
|
||||
#
|
||||
# Some pwd commands on Windows (for example, the pwd
|
||||
@@ -101,17 +118,29 @@ else
|
||||
NSPR_PREFIX = $$(topsrcdir)/../dist/$(OBJDIR_NAME)
|
||||
endif
|
||||
|
||||
ifndef NSS_GYP_PREFIX
|
||||
$(NSPR_CONFIG_STATUS): $(NSPR_CONFIGURE)
|
||||
mkdir -p $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
|
||||
cd $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) ; \
|
||||
$(NSPR_COMPILERS) sh ../configure \
|
||||
$(NSPR_CONFIGURE_ENV) sh ../configure \
|
||||
$(NSPR_CONFIGURE_OPTS) \
|
||||
--with-dist-prefix='$(NSPR_PREFIX)' \
|
||||
--with-dist-includedir='$(NSPR_PREFIX)/include'
|
||||
else
|
||||
$(NSPR_CONFIG_STATUS): $(NSPR_CONFIGURE)
|
||||
mkdir -p $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
|
||||
cd $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) ; \
|
||||
$(NSPR_CONFIGURE_ENV) sh ../configure \
|
||||
$(NSPR_CONFIGURE_OPTS) \
|
||||
--prefix='$(NSS_GYP_PREFIX)'
|
||||
endif
|
||||
|
||||
build_nspr: $(NSPR_CONFIG_STATUS)
|
||||
$(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
|
||||
|
||||
install_nspr: build_nspr
|
||||
$(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) install
|
||||
|
||||
clobber_nspr: $(NSPR_CONFIG_STATUS)
|
||||
$(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) clobber
|
||||
|
||||
@@ -126,3 +155,6 @@ nss_RelEng_bld: import all
|
||||
package:
|
||||
$(MAKE) -C pkg publish
|
||||
|
||||
latest:
|
||||
echo $(OBJDIR_NAME) > $(CORE_DEPTH)/../dist/latest
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
NSS_3_19_4_2
|
||||
NSS_3_35_RTM
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Functions changes summary: 1 Removed, 0 Changed, 0 Added function
|
||||
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
|
||||
|
||||
1 Removed function:
|
||||
|
||||
'function void PR_EXPERIMENTAL_ONLY_IN_4_17_GetOverlappedIOHandle(void**)' {PR_EXPERIMENTAL_ONLY_IN_4_17_GetOverlappedIOHandle}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Functions changes summary: 0 Removed, 0 Changed (5 filtered out), 0 Added function
|
||||
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
NSS_3_34_BRANCH
|
||||
@@ -19,6 +19,9 @@ proc_args()
|
||||
"--test-nss")
|
||||
TEST_NSS=1
|
||||
;;
|
||||
"--check-abi")
|
||||
CHECK_ABI=1
|
||||
;;
|
||||
"--build-jss")
|
||||
BUILD_JSS=1
|
||||
;;
|
||||
@@ -40,6 +43,7 @@ proc_args()
|
||||
echo " --build-jss"
|
||||
echo " --test-nss"
|
||||
echo " --test-jss"
|
||||
echo " --check-abi"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -199,7 +203,7 @@ test_nss()
|
||||
print_log "$ cd ${HGDIR}/nss/tests"
|
||||
cd ${HGDIR}/nss/tests
|
||||
print_log "$ ./all.sh"
|
||||
./all.sh 2>&1 | tee ${LOG_TMP} | grep ${GREP_BUFFER} ": #"
|
||||
./all.sh 2>&1 | tee ${LOG_TMP} | egrep ${GREP_BUFFER} ": #|^\[.{10}\] "
|
||||
OUTPUTFILE=${LOG_TMP}
|
||||
fi
|
||||
|
||||
@@ -208,13 +212,93 @@ test_nss()
|
||||
RET=$?
|
||||
|
||||
print_log "######## details of detected failures (if any) ########"
|
||||
grep -B50 FAIL ${OUTPUTFILE}
|
||||
grep -B50 FAILED ${OUTPUTFILE}
|
||||
[ $? -eq 1 ] || RET=1
|
||||
|
||||
print_result "NSS - tests - ${BITS} bits - ${OPT}" ${RET} 0
|
||||
return ${RET}
|
||||
}
|
||||
|
||||
check_abi()
|
||||
{
|
||||
print_log "######## NSS ABI CHECK - ${BITS} bits - ${OPT} ########"
|
||||
print_log "######## creating temporary HG clones ########"
|
||||
|
||||
rm -rf ${HGDIR}/baseline
|
||||
mkdir ${HGDIR}/baseline
|
||||
BASE_NSS=`cat ${HGDIR}/nss/automation/abi-check/previous-nss-release`
|
||||
hg clone -u "${BASE_NSS}" "${HGDIR}/nss" "${HGDIR}/baseline/nss"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "invalid tag in automation/abi-check/previous-nss-release"
|
||||
return 1
|
||||
fi
|
||||
|
||||
BASE_NSPR=NSPR_$(head -1 ${HGDIR}/baseline/nss/automation/release/nspr-version.txt | cut -d . -f 1-2 | tr . _)_BRANCH
|
||||
hg clone -u "${BASE_NSPR}" "${HGDIR}/nspr" "${HGDIR}/baseline/nspr"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "nonexisting tag ${BASE_NSPR} derived from ${BASE_NSS} automation/release/nspr-version.txt"
|
||||
# Assume that version hasn't been released yet, fall back to trunk
|
||||
pushd "${HGDIR}/baseline/nspr"
|
||||
hg update default
|
||||
popd
|
||||
fi
|
||||
|
||||
print_log "######## building baseline NSPR/NSS ########"
|
||||
pushd ${HGDIR}/baseline/nss
|
||||
|
||||
print_log "$ ${MAKE} ${NSS_BUILD_TARGET}"
|
||||
${MAKE} ${NSS_BUILD_TARGET} 2>&1 | tee -a ${LOG_ALL}
|
||||
RET=$?
|
||||
print_result "NSS - build - ${BITS} bits - ${OPT}" ${RET} 0
|
||||
if [ ${RET} -ne 0 ]; then
|
||||
tail -100 ${LOG_ALL}
|
||||
return ${RET}
|
||||
fi
|
||||
popd
|
||||
|
||||
ABI_PROBLEM_FOUND=0
|
||||
ABI_REPORT=${OUTPUTDIR}/abi-diff.txt
|
||||
rm -f ${ABI_REPORT}
|
||||
PREVDIST=${HGDIR}/baseline/dist
|
||||
NEWDIST=${HGDIR}/dist
|
||||
ALL_SOs="libfreebl3.so libfreeblpriv3.so libnspr4.so libnss3.so libnssckbi.so libnssdbm3.so libnsssysinit.so libnssutil3.so libplc4.so libplds4.so libsmime3.so libsoftokn3.so libssl3.so"
|
||||
for SO in ${ALL_SOs}; do
|
||||
if [ ! -f ${HGDIR}/nss/automation/abi-check/expected-report-$SO.txt ]; then
|
||||
touch ${HGDIR}/nss/automation/abi-check/expected-report-$SO.txt
|
||||
fi
|
||||
abidiff --hd1 $PREVDIST/public/ --hd2 $NEWDIST/public \
|
||||
$PREVDIST/*/lib/$SO $NEWDIST/*/lib/$SO \
|
||||
> ${HGDIR}/nss/automation/abi-check/new-report-$SO.txt
|
||||
if [ $? -ne 0 ]; then
|
||||
ABI_PROBLEM_FOUND=1
|
||||
print_log "FAILED to run abidiff {$PREVDIST , $NEWDIST} for $SO, or failed writing to ${HGDIR}/nss/automation/abi-check/new-report-$SO.txt"
|
||||
fi
|
||||
if [ ! -f ${HGDIR}/nss/automation/abi-check/expected-report-$SO.txt ]; then
|
||||
ABI_PROBLEM_FOUND=1
|
||||
print_log "FAILED to access report file: ${HGDIR}/nss/automation/abi-check/expected-report-$SO.txt"
|
||||
fi
|
||||
|
||||
diff -wB -u ${HGDIR}/nss/automation/abi-check/expected-report-$SO.txt \
|
||||
${HGDIR}/nss/automation/abi-check/new-report-$SO.txt >> ${ABI_REPORT}
|
||||
if [ ! -f ${ABI_REPORT} ]; then
|
||||
ABI_PROBLEM_FOUND=1
|
||||
print_log "FAILED to compare exepcted and new report: ${HGDIR}/nss/automation/abi-check/new-report-$SO.txt"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -s ${ABI_REPORT} ]; then
|
||||
print_log "FAILED: there are new unexpected ABI changes"
|
||||
cat ${ABI_REPORT}
|
||||
return 1
|
||||
elif [ $ABI_PROBLEM_FOUND -ne 0 ]; then
|
||||
print_log "FAILED: failure executing the ABI checks"
|
||||
cat ${ABI_REPORT}
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
test_jss()
|
||||
{
|
||||
print_log "######## JSS - tests - ${BITS} bits - ${OPT} ########"
|
||||
@@ -243,6 +327,39 @@ test_jss()
|
||||
return ${RET}
|
||||
}
|
||||
|
||||
create_objdir_dist_link()
|
||||
{
|
||||
# compute relevant 'dist' OBJDIR_NAME subdirectory names for JSS and NSS
|
||||
OS_TARGET=`uname -s`
|
||||
OS_RELEASE=`uname -r | sed 's/-.*//' | sed 's/-.*//' | cut -d . -f1,2`
|
||||
CPU_TAG=_`uname -m`
|
||||
# OBJDIR_NAME_COMPILER appears to be defined for NSS but not JSS
|
||||
OBJDIR_NAME_COMPILER=_cc
|
||||
LIBC_TAG=_glibc
|
||||
IMPL_STRATEGY=_PTH
|
||||
if [ "${RUN_BITS}" = "64" ]; then
|
||||
OBJDIR_TAG=_${RUN_BITS}_${RUN_OPT}.OBJ
|
||||
else
|
||||
OBJDIR_TAG=_${RUN_OPT}.OBJ
|
||||
fi
|
||||
|
||||
# define NSS_OBJDIR_NAME
|
||||
NSS_OBJDIR_NAME=${OS_TARGET}${OS_RELEASE}${CPU_TAG}${OBJDIR_NAME_COMPILER}
|
||||
NSS_OBJDIR_NAME=${NSS_OBJDIR_NAME}${LIBC_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}
|
||||
print_log "create_objdir_dist_link(): NSS_OBJDIR_NAME='${NSS_OBJDIR_NAME}'"
|
||||
|
||||
# define JSS_OBJDIR_NAME
|
||||
JSS_OBJDIR_NAME=${OS_TARGET}${OS_RELEASE}${CPU_TAG}
|
||||
JSS_OBJDIR_NAME=${JSS_OBJDIR_NAME}${LIBC_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}
|
||||
print_log "create_objdir_dist_link(): JSS_OBJDIR_NAME='${JSS_OBJDIR_NAME}'"
|
||||
|
||||
if [ -e "${HGDIR}/dist/${NSS_OBJDIR_NAME}" ]; then
|
||||
SOURCE=${HGDIR}/dist/${NSS_OBJDIR_NAME}
|
||||
TARGET=${HGDIR}/dist/${JSS_OBJDIR_NAME}
|
||||
ln -s ${SOURCE} ${TARGET} >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
build_and_test()
|
||||
{
|
||||
if [ -n "${BUILD_NSS}" ]; then
|
||||
@@ -255,7 +372,13 @@ build_and_test()
|
||||
[ $? -eq 0 ] || return 1
|
||||
fi
|
||||
|
||||
if [ -n "${CHECK_ABI}" ]; then
|
||||
check_abi
|
||||
[ $? -eq 0 ] || return 1
|
||||
fi
|
||||
|
||||
if [ -n "${BUILD_JSS}" ]; then
|
||||
create_objdir_dist_link
|
||||
build_jss
|
||||
[ $? -eq 0 ] || return 1
|
||||
fi
|
||||
@@ -288,12 +411,14 @@ prepare()
|
||||
mv ${OUTPUTDIR} ${OUTPUTDIR}.last >/dev/null 2>&1
|
||||
mkdir -p ${OUTPUTDIR}
|
||||
|
||||
if [ -z "${NSS_DISABLE_ECC}" -a -n "${NSS_ECC_MORE_THAN_SUITE_B}" ]; then
|
||||
cd ${HGDIR}/nss
|
||||
ECF="lib/freebl/ecl/ecl-curve.h"
|
||||
print_log "hg revert -r NSS_3_11_1_RTM ${ECF}"
|
||||
hg revert -r NSS_3_11_1_RTM security/nss/${ECF}
|
||||
cp -f security/nss/${ECF} ${ECF}
|
||||
# Remove temporary test files from previous jobs, that weren't cleaned up
|
||||
# by move_results(), e.g. caused by unexpected interruptions.
|
||||
rm -rf ${HGDIR}/tests_results/
|
||||
|
||||
cd ${HGDIR}/nss
|
||||
|
||||
if [ -n "${FEWER_STRESS_ITERATIONS}" ]; then
|
||||
sed -i 's/-c_1000_/-c_500_/g' tests/ssl/sslstress.txt
|
||||
fi
|
||||
|
||||
return 0
|
||||
@@ -324,6 +449,7 @@ main()
|
||||
{
|
||||
VALID=0
|
||||
RET=1
|
||||
FAIL=0
|
||||
|
||||
for BITS in 32 64; do
|
||||
echo ${RUN_BITS} | grep ${BITS} > /dev/null
|
||||
@@ -336,7 +462,10 @@ main()
|
||||
set_env
|
||||
run_all
|
||||
RET=$?
|
||||
print_log "### result of run_all is ${RET}"
|
||||
print_log "### result of run_all is ${RET}"
|
||||
if [ ${RET} -ne 0 ]; then
|
||||
FAIL=${RET}
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
@@ -345,7 +474,7 @@ main()
|
||||
return 1
|
||||
fi
|
||||
|
||||
return ${RET}
|
||||
return ${FAIL}
|
||||
}
|
||||
|
||||
#function killallsub()
|
||||
@@ -373,6 +502,8 @@ echo "tinderbox args: $0 $@"
|
||||
proc_args "$@"
|
||||
main
|
||||
|
||||
#RET=$?
|
||||
RET=$?
|
||||
print_log "### result of main is ${RET}"
|
||||
|
||||
#rm $IS_RUNNING_FILE
|
||||
#exit ${RET}
|
||||
exit ${RET}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
echo running > ..\buildbot-is-building
|
||||
|
||||
echo running: "%MOZILLABUILD%\msys\bin\bash" -c "hg/tinder/buildbot/build.sh %*"
|
||||
"%MOZILLABUILD%\msys\bin\bash" -c "hg/tinder/buildbot/build.sh %*"
|
||||
echo running: "%MOZILLABUILD%\msys\bin\bash" -c "hg/nss/automation/buildbot-slave/build.sh %*"
|
||||
"%MOZILLABUILD%\msys\bin\bash" -c "hg/nss/automation/buildbot-slave/build.sh %*"
|
||||
|
||||
if %errorlevel% neq 0 (
|
||||
set EXITCODE=1
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
FROM ubuntu:16.04
|
||||
MAINTAINER Franziskus Kiefer <franziskuskiefer@gmail.com>
|
||||
|
||||
RUN useradd -d /home/worker -s /bin/bash -m worker
|
||||
WORKDIR /home/worker
|
||||
|
||||
# Install dependencies.
|
||||
ADD setup.sh /tmp/setup.sh
|
||||
RUN bash /tmp/setup.sh
|
||||
|
||||
# Change user.
|
||||
USER worker
|
||||
|
||||
# Env variables.
|
||||
ENV HOME /home/worker
|
||||
ENV SHELL /bin/bash
|
||||
ENV USER worker
|
||||
ENV LOGNAME worker
|
||||
ENV HOSTNAME taskcluster-worker
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV HOST localhost
|
||||
ENV DOMSUF localdomain
|
||||
|
||||
# Entrypoint.
|
||||
ENTRYPOINT ["/home/worker/nss/automation/clang-format/run_clang_format.sh"]
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ $(id -u) -eq 0 ]]; then
|
||||
# Drop privileges by re-running this script.
|
||||
# Note: this mangles arguments, better to avoid running scripts as root.
|
||||
exec su worker -c "$0 $*"
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
# Apply clang-format on the provided folder and verify that this doesn't change any file.
|
||||
# If any file differs after formatting, the script eventually exits with 1.
|
||||
# Any differences between formatted and unformatted files is printed to stdout to give a hint what's wrong.
|
||||
|
||||
# Includes a default set of directories NOT to clang-format on.
|
||||
blacklist=(
|
||||
"./automation" \
|
||||
"./coreconf" \
|
||||
"./doc" \
|
||||
"./pkg" \
|
||||
"./tests" \
|
||||
"./lib/libpkix" \
|
||||
"./lib/zlib" \
|
||||
"./lib/sqlite" \
|
||||
"./gtests/google_test" \
|
||||
"./out" \
|
||||
)
|
||||
|
||||
top=$(cd "$(dirname $0)/../.."; pwd -P)
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
dirs=("$@")
|
||||
else
|
||||
cd "$top"
|
||||
dirs=($(find . -maxdepth 2 -mindepth 1 -type d ! -path '*/.*' -print))
|
||||
fi
|
||||
|
||||
format_folder()
|
||||
{
|
||||
for black in "${blacklist[@]}"; do
|
||||
if [[ "$1" == "$black"* ]]; then
|
||||
echo "skip $1"
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
for dir in "${dirs[@]}"; do
|
||||
if format_folder "$dir"; then
|
||||
c="${dir//[^\/]}"
|
||||
echo "formatting $dir ..."
|
||||
depth=()
|
||||
if [ "${#c}" == "1" ]; then
|
||||
depth+=(-maxdepth 1)
|
||||
fi
|
||||
find "$dir" "${depth[@]}" -type f \( -name '*.[ch]' -o -name '*.cc' \) -exec clang-format -i {} \+
|
||||
fi
|
||||
done
|
||||
|
||||
TMPFILE=$(mktemp /tmp/$(basename $0).XXXXXX)
|
||||
trap 'rm -f $TMPFILE' exit
|
||||
if [[ -d "$top/.hg" ]]; then
|
||||
hg diff --git "$top" | tee $TMPFILE
|
||||
else
|
||||
git -C "$top" diff | tee $TMPFILE
|
||||
fi
|
||||
[[ ! -s $TMPFILE ]]
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Update packages.
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -y update && apt-get -y upgrade
|
||||
|
||||
# Install packages.
|
||||
apt_packages=()
|
||||
apt_packages+=('ca-certificates')
|
||||
apt_packages+=('curl')
|
||||
apt_packages+=('xz-utils')
|
||||
apt_packages+=('mercurial')
|
||||
apt_packages+=('git')
|
||||
apt_packages+=('locales')
|
||||
apt-get install -y --no-install-recommends ${apt_packages[@]}
|
||||
|
||||
# Download clang.
|
||||
curl -L https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz -o clang.tar.xz
|
||||
curl -L https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig -o clang.tar.xz.sig
|
||||
# Verify the signature.
|
||||
gpg --keyserver pool.sks-keyservers.net --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D
|
||||
gpg --verify clang.tar.xz.sig
|
||||
# Install into /usr/local/.
|
||||
tar xJvf *.tar.xz -C /usr/local --strip-components=1
|
||||
|
||||
# Cleanup.
|
||||
function cleanup() {
|
||||
rm -f clang.tar.xz clang.tar.xz.sig
|
||||
}
|
||||
trap cleanup ERR EXIT
|
||||
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
|
||||
# We're done. Remove this script.
|
||||
rm $0
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash -eu
|
||||
#
|
||||
# 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/.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# List of targets disabled for oss-fuzz.
|
||||
declare -A disabled=([pkcs8]=1)
|
||||
|
||||
# List of targets we want to fuzz in TLS and non-TLS mode.
|
||||
declare -A tls_targets=([tls-client]=1 [tls-server]=1 [dtls-client]=1 [dtls-server]=1)
|
||||
|
||||
# Helper function that copies a fuzzer binary and its seed corpus.
|
||||
copy_fuzzer()
|
||||
{
|
||||
local fuzzer=$1
|
||||
local name=$2
|
||||
|
||||
# Copy the binary.
|
||||
cp ../dist/Debug/bin/$fuzzer $OUT/$name
|
||||
|
||||
# Zip and copy the corpus, if any.
|
||||
if [ -d "$SRC/nss-corpus/$name" ]; then
|
||||
zip $OUT/${name}_seed_corpus.zip $SRC/nss-corpus/$name/*
|
||||
else
|
||||
zip $OUT/${name}_seed_corpus.zip $SRC/nss-corpus/*/*
|
||||
fi
|
||||
}
|
||||
|
||||
# Copy libFuzzer options
|
||||
cp fuzz/options/*.options $OUT/
|
||||
|
||||
# Build the library (non-TLS fuzzing mode).
|
||||
CXX="$CXX -stdlib=libc++" LDFLAGS="$CFLAGS" \
|
||||
./build.sh -c -v --fuzz=oss --fuzz --disable-tests
|
||||
|
||||
# Copy fuzzing targets.
|
||||
for fuzzer in $(find ../dist/Debug/bin -name "nssfuzz-*" -printf "%f\n"); do
|
||||
name=${fuzzer:8}
|
||||
if [ -z "${disabled[$name]:-}" ]; then
|
||||
[ -n "${tls_targets[$name]:-}" ] && name="${name}-no_fuzzer_mode"
|
||||
copy_fuzzer $fuzzer $name
|
||||
fi
|
||||
done
|
||||
|
||||
# Build the library again (TLS fuzzing mode).
|
||||
CXX="$CXX -stdlib=libc++" LDFLAGS="$CFLAGS" \
|
||||
./build.sh -c -v --fuzz=oss --fuzz=tls --disable-tests
|
||||
|
||||
# Copy dual mode targets in TLS mode.
|
||||
for name in "${!tls_targets[@]}"; do
|
||||
if [ -z "${disabled[$name]:-}" ]; then
|
||||
copy_fuzzer nssfuzz-$name $name
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,10 @@
|
||||
4.18
|
||||
|
||||
# The first line of this file must contain the human readable NSPR
|
||||
# version number, which is the minimum required version of NSPR
|
||||
# that is supported by this version of NSS.
|
||||
#
|
||||
# This information is used by release automation,
|
||||
# when creating an NSS source archive.
|
||||
#
|
||||
# All other lines in this file are ignored.
|
||||
@@ -0,0 +1,288 @@
|
||||
#!/usr/bin/python
|
||||
# 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/.
|
||||
|
||||
import os
|
||||
import sys
|
||||
import datetime
|
||||
import shutil
|
||||
import glob
|
||||
from optparse import OptionParser
|
||||
from subprocess import check_call
|
||||
from subprocess import check_output
|
||||
|
||||
nssutil_h = "lib/util/nssutil.h"
|
||||
softkver_h = "lib/softoken/softkver.h"
|
||||
nss_h = "lib/nss/nss.h"
|
||||
nssckbi_h = "lib/ckfw/builtins/nssckbi.h"
|
||||
abi_base_version_file = "automation/abi-check/previous-nss-release"
|
||||
|
||||
abi_report_files = ['automation/abi-check/expected-report-libfreebl3.so.txt',
|
||||
'automation/abi-check/expected-report-libfreeblpriv3.so.txt',
|
||||
'automation/abi-check/expected-report-libnspr4.so.txt',
|
||||
'automation/abi-check/expected-report-libnss3.so.txt',
|
||||
'automation/abi-check/expected-report-libnssckbi.so.txt',
|
||||
'automation/abi-check/expected-report-libnssdbm3.so.txt',
|
||||
'automation/abi-check/expected-report-libnsssysinit.so.txt',
|
||||
'automation/abi-check/expected-report-libnssutil3.so.txt',
|
||||
'automation/abi-check/expected-report-libplc4.so.txt',
|
||||
'automation/abi-check/expected-report-libplds4.so.txt',
|
||||
'automation/abi-check/expected-report-libsmime3.so.txt',
|
||||
'automation/abi-check/expected-report-libsoftokn3.so.txt',
|
||||
'automation/abi-check/expected-report-libssl3.so.txt']
|
||||
|
||||
def check_call_noisy(cmd, *args, **kwargs):
|
||||
print "Executing command:", cmd
|
||||
check_call(cmd, *args, **kwargs)
|
||||
|
||||
o = OptionParser(usage="client.py [options] remove_beta | set_beta | print_library_versions | print_root_ca_version | set_root_ca_version | set_version_to_minor_release | set_version_to_patch_release | set_release_candidate_number | set_4_digit_release_number | create_nss_release_archive")
|
||||
|
||||
try:
|
||||
options, args = o.parse_args()
|
||||
action = args[0]
|
||||
except IndexError:
|
||||
o.print_help()
|
||||
sys.exit(2)
|
||||
|
||||
def exit_with_failure(what):
|
||||
print "failure: ", what
|
||||
sys.exit(2)
|
||||
|
||||
def check_files_exist():
|
||||
if (not os.path.exists(nssutil_h) or not os.path.exists(softkver_h)
|
||||
or not os.path.exists(nss_h) or not os.path.exists(nssckbi_h)):
|
||||
exit_with_failure("cannot find expected header files, must run from inside NSS hg directory")
|
||||
|
||||
def sed_inplace(sed_expression, filename):
|
||||
backup_file = filename + '.tmp'
|
||||
check_call_noisy(["sed", "-i.tmp", sed_expression, filename])
|
||||
os.remove(backup_file)
|
||||
|
||||
def toggle_beta_status(is_beta):
|
||||
check_files_exist()
|
||||
if (is_beta):
|
||||
print "adding Beta status to version numbers"
|
||||
sed_inplace('s/^\(#define *NSSUTIL_VERSION *\"[0-9.]\+\)\" *$/\\1 Beta\"/', nssutil_h)
|
||||
sed_inplace('s/^\(#define *NSSUTIL_BETA *\)PR_FALSE *$/\\1PR_TRUE/', nssutil_h)
|
||||
sed_inplace('s/^\(#define *SOFTOKEN_VERSION *\"[0-9.]\+\" *SOFTOKEN_ECC_STRING\) *$/\\1 \" Beta"/', softkver_h)
|
||||
sed_inplace('s/^\(#define *SOFTOKEN_BETA *\)PR_FALSE *$/\\1PR_TRUE/', softkver_h)
|
||||
sed_inplace('s/^\(#define *NSS_VERSION *\"[0-9.]\+\" *_NSS_CUSTOMIZED\) *$/\\1 \" Beta"/', nss_h)
|
||||
sed_inplace('s/^\(#define *NSS_BETA *\)PR_FALSE *$/\\1PR_TRUE/', nss_h)
|
||||
else:
|
||||
print "removing Beta status from version numbers"
|
||||
sed_inplace('s/^\(#define *NSSUTIL_VERSION *\"[0-9.]\+\) *Beta\" *$/\\1\"/', nssutil_h)
|
||||
sed_inplace('s/^\(#define *NSSUTIL_BETA *\)PR_TRUE *$/\\1PR_FALSE/', nssutil_h)
|
||||
sed_inplace('s/^\(#define *SOFTOKEN_VERSION *\"[0-9.]\+\" *SOFTOKEN_ECC_STRING\) *\" *Beta\" *$/\\1/', softkver_h)
|
||||
sed_inplace('s/^\(#define *SOFTOKEN_BETA *\)PR_TRUE *$/\\1PR_FALSE/', softkver_h)
|
||||
sed_inplace('s/^\(#define *NSS_VERSION *\"[0-9.]\+\" *_NSS_CUSTOMIZED\) *\" *Beta\" *$/\\1/', nss_h)
|
||||
sed_inplace('s/^\(#define *NSS_BETA *\)PR_TRUE *$/\\1PR_FALSE/', nss_h)
|
||||
print "please run 'hg stat' and 'hg diff' to verify the files have been verified correctly"
|
||||
|
||||
def print_beta_versions():
|
||||
check_call_noisy(["egrep", "#define *NSSUTIL_VERSION|#define *NSSUTIL_BETA", nssutil_h])
|
||||
check_call_noisy(["egrep", "#define *SOFTOKEN_VERSION|#define *SOFTOKEN_BETA", softkver_h])
|
||||
check_call_noisy(["egrep", "#define *NSS_VERSION|#define *NSS_BETA", nss_h])
|
||||
|
||||
def remove_beta_status():
|
||||
print "--- removing beta flags. Existing versions were:"
|
||||
print_beta_versions()
|
||||
toggle_beta_status(False)
|
||||
print "--- finished modifications, new versions are:"
|
||||
print_beta_versions()
|
||||
|
||||
def set_beta_status():
|
||||
print "--- adding beta flags. Existing versions were:"
|
||||
print_beta_versions()
|
||||
toggle_beta_status(True)
|
||||
print "--- finished modifications, new versions are:"
|
||||
print_beta_versions()
|
||||
|
||||
def print_library_versions():
|
||||
check_files_exist()
|
||||
check_call_noisy(["egrep", "#define *NSSUTIL_VERSION|#define NSSUTIL_VMAJOR|#define *NSSUTIL_VMINOR|#define *NSSUTIL_VPATCH|#define *NSSUTIL_VBUILD|#define *NSSUTIL_BETA", nssutil_h])
|
||||
check_call_noisy(["egrep", "#define *SOFTOKEN_VERSION|#define SOFTOKEN_VMAJOR|#define *SOFTOKEN_VMINOR|#define *SOFTOKEN_VPATCH|#define *SOFTOKEN_VBUILD|#define *SOFTOKEN_BETA", softkver_h])
|
||||
check_call_noisy(["egrep", "#define *NSS_VERSION|#define NSS_VMAJOR|#define *NSS_VMINOR|#define *NSS_VPATCH|#define *NSS_VBUILD|#define *NSS_BETA", nss_h])
|
||||
|
||||
def print_root_ca_version():
|
||||
check_files_exist()
|
||||
check_call_noisy(["grep", "define *NSS_BUILTINS_LIBRARY_VERSION", nssckbi_h])
|
||||
|
||||
|
||||
def ensure_arguments_after_action(how_many, usage):
|
||||
if (len(sys.argv) != (2+how_many)):
|
||||
exit_with_failure("incorrect number of arguments, expected parameters are:\n" + usage)
|
||||
|
||||
def set_major_versions(major):
|
||||
sed_inplace('s/^\(#define *NSSUTIL_VMAJOR *\).*$/\\1' + major + '/', nssutil_h)
|
||||
sed_inplace('s/^\(#define *SOFTOKEN_VMAJOR *\).*$/\\1' + major + '/', softkver_h)
|
||||
sed_inplace('s/^\(#define *NSS_VMAJOR *\).*$/\\1' + major + '/', nss_h)
|
||||
|
||||
def set_minor_versions(minor):
|
||||
sed_inplace('s/^\(#define *NSSUTIL_VMINOR *\).*$/\\1' + minor + '/', nssutil_h)
|
||||
sed_inplace('s/^\(#define *SOFTOKEN_VMINOR *\).*$/\\1' + minor + '/', softkver_h)
|
||||
sed_inplace('s/^\(#define *NSS_VMINOR *\).*$/\\1' + minor + '/', nss_h)
|
||||
|
||||
def set_patch_versions(patch):
|
||||
sed_inplace('s/^\(#define *NSSUTIL_VPATCH *\).*$/\\1' + patch + '/', nssutil_h)
|
||||
sed_inplace('s/^\(#define *SOFTOKEN_VPATCH *\).*$/\\1' + patch + '/', softkver_h)
|
||||
sed_inplace('s/^\(#define *NSS_VPATCH *\).*$/\\1' + patch + '/', nss_h)
|
||||
|
||||
def set_build_versions(build):
|
||||
sed_inplace('s/^\(#define *NSSUTIL_VBUILD *\).*$/\\1' + build + '/', nssutil_h)
|
||||
sed_inplace('s/^\(#define *SOFTOKEN_VBUILD *\).*$/\\1' + build + '/', softkver_h)
|
||||
sed_inplace('s/^\(#define *NSS_VBUILD *\).*$/\\1' + build + '/', nss_h)
|
||||
|
||||
def set_full_lib_versions(version):
|
||||
sed_inplace('s/^\(#define *NSSUTIL_VERSION *\"\)\([0-9.]\+\)\(.*\)$/\\1' + version + '\\3/', nssutil_h)
|
||||
sed_inplace('s/^\(#define *SOFTOKEN_VERSION *\"\)\([0-9.]\+\)\(.*\)$/\\1' + version + '\\3/', softkver_h)
|
||||
sed_inplace('s/^\(#define *NSS_VERSION *\"\)\([0-9.]\+\)\(.*\)$/\\1' + version + '\\3/', nss_h)
|
||||
|
||||
def set_root_ca_version():
|
||||
ensure_arguments_after_action(2, "major_version minor_version")
|
||||
major = args[1].strip()
|
||||
minor = args[2].strip()
|
||||
version = major + '.' + minor
|
||||
sed_inplace('s/^\(#define *NSS_BUILTINS_LIBRARY_VERSION *\"\).*$/\\1' + version + '/', nssckbi_h)
|
||||
sed_inplace('s/^\(#define *NSS_BUILTINS_LIBRARY_VERSION_MAJOR *\).*$/\\1' + major + '/', nssckbi_h)
|
||||
sed_inplace('s/^\(#define *NSS_BUILTINS_LIBRARY_VERSION_MINOR *\).*$/\\1' + minor + '/', nssckbi_h)
|
||||
|
||||
def set_all_lib_versions(version, major, minor, patch, build):
|
||||
grep_major = check_output(['grep', 'define.*NSS_VMAJOR', nss_h])
|
||||
grep_minor = check_output(['grep', 'define.*NSS_VMINOR', nss_h])
|
||||
|
||||
old_major = int(grep_major.split()[2]);
|
||||
old_minor = int(grep_minor.split()[2]);
|
||||
|
||||
new_major = int(major)
|
||||
new_minor = int(minor)
|
||||
|
||||
if (old_major < new_major or (old_major == new_major and old_minor < new_minor)):
|
||||
print "You're increasing the minor (or major) version:"
|
||||
print "- erasing ABI comparison expectations"
|
||||
new_branch = "NSS_" + str(old_major) + "_" + str(old_minor) + "_BRANCH"
|
||||
print "- setting reference branch to the branch of the previous version: " + new_branch
|
||||
with open(abi_base_version_file, "w") as abi_base:
|
||||
abi_base.write("%s\n" % new_branch)
|
||||
for report_file in abi_report_files:
|
||||
with open(report_file, "w") as report_file_handle:
|
||||
report_file_handle.truncate()
|
||||
|
||||
set_full_lib_versions(version)
|
||||
set_major_versions(major)
|
||||
set_minor_versions(minor)
|
||||
set_patch_versions(patch)
|
||||
set_build_versions(build)
|
||||
|
||||
def set_version_to_minor_release():
|
||||
ensure_arguments_after_action(2, "major_version minor_version")
|
||||
major = args[1].strip()
|
||||
minor = args[2].strip()
|
||||
version = major + '.' + minor
|
||||
patch = "0"
|
||||
build = "0"
|
||||
set_all_lib_versions(version, major, minor, patch, build)
|
||||
|
||||
def set_version_to_patch_release():
|
||||
ensure_arguments_after_action(3, "major_version minor_version patch_release")
|
||||
major = args[1].strip()
|
||||
minor = args[2].strip()
|
||||
patch = args[3].strip()
|
||||
version = major + '.' + minor + '.' + patch
|
||||
build = "0"
|
||||
set_all_lib_versions(version, major, minor, patch, build)
|
||||
|
||||
def set_release_candidate_number():
|
||||
ensure_arguments_after_action(1, "release_candidate_number")
|
||||
build = args[1].strip()
|
||||
set_build_versions(build)
|
||||
|
||||
def set_4_digit_release_number():
|
||||
ensure_arguments_after_action(4, "major_version minor_version patch_release 4th_digit_release_number")
|
||||
major = args[1].strip()
|
||||
minor = args[2].strip()
|
||||
patch = args[3].strip()
|
||||
build = args[4].strip()
|
||||
version = major + '.' + minor + '.' + patch + '.' + build
|
||||
set_all_lib_versions(version, major, minor, patch, build)
|
||||
|
||||
def create_nss_release_archive():
|
||||
ensure_arguments_after_action(3, "nss_release_version nss_hg_release_tag path_to_stage_directory")
|
||||
nssrel = args[1].strip() #e.g. 3.19.3
|
||||
nssreltag = args[2].strip() #e.g. NSS_3_19_3_RTM
|
||||
stagedir = args[3].strip() #e.g. ../stage
|
||||
|
||||
with open('automation/release/nspr-version.txt') as nspr_version_file:
|
||||
nsprrel = next(nspr_version_file).strip()
|
||||
|
||||
nspr_tar = "nspr-" + nsprrel + ".tar.gz"
|
||||
nsprtar_with_path= stagedir + "/v" + nsprrel + "/src/" + nspr_tar
|
||||
if (not os.path.exists(nsprtar_with_path)):
|
||||
exit_with_failure("cannot find nspr archive at expected location " + nsprtar_with_path)
|
||||
|
||||
nss_stagedir= stagedir + "/" + nssreltag + "/src"
|
||||
if (os.path.exists(nss_stagedir)):
|
||||
exit_with_failure("nss stage directory already exists: " + nss_stagedir)
|
||||
|
||||
nss_tar = "nss-" + nssrel + ".tar.gz"
|
||||
|
||||
check_call_noisy(["mkdir", "-p", nss_stagedir])
|
||||
check_call_noisy(["hg", "archive", "-r", nssreltag, "--prefix=nss-" + nssrel + "/nss",
|
||||
stagedir + "/" + nssreltag + "/src/" + nss_tar, "-X", ".hgtags"])
|
||||
check_call_noisy(["tar", "-xz", "-C", nss_stagedir, "-f", nsprtar_with_path])
|
||||
print "changing to directory " + nss_stagedir
|
||||
os.chdir(nss_stagedir)
|
||||
check_call_noisy(["tar", "-xz", "-f", nss_tar])
|
||||
check_call_noisy(["mv", "-i", "nspr-" + nsprrel + "/nspr", "nss-" + nssrel + "/"])
|
||||
check_call_noisy(["rmdir", "nspr-" + nsprrel])
|
||||
|
||||
nss_nspr_tar = "nss-" + nssrel + "-with-nspr-" + nsprrel + ".tar.gz"
|
||||
|
||||
check_call_noisy(["tar", "-cz", "--remove-files", "-f", nss_nspr_tar, "nss-" + nssrel])
|
||||
check_call("sha1sum " + nss_tar + " " + nss_nspr_tar + " > SHA1SUMS", shell=True)
|
||||
check_call("sha256sum " + nss_tar + " " + nss_nspr_tar + " > SHA256SUMS", shell=True)
|
||||
print "created directory " + nss_stagedir + " with files:"
|
||||
check_call_noisy(["ls", "-l"])
|
||||
|
||||
if action in ('remove_beta'):
|
||||
remove_beta_status()
|
||||
|
||||
elif action in ('set_beta'):
|
||||
set_beta_status()
|
||||
|
||||
elif action in ('print_library_versions'):
|
||||
print_library_versions()
|
||||
|
||||
elif action in ('print_root_ca_version'):
|
||||
print_root_ca_version()
|
||||
|
||||
elif action in ('set_root_ca_version'):
|
||||
set_root_ca_version()
|
||||
|
||||
# x.y version number - 2 parameters
|
||||
elif action in ('set_version_to_minor_release'):
|
||||
set_version_to_minor_release()
|
||||
|
||||
# x.y.z version number - 3 parameters
|
||||
elif action in ('set_version_to_patch_release'):
|
||||
set_version_to_patch_release()
|
||||
|
||||
# change the release candidate number, usually increased by one,
|
||||
# usually if previous release candiate had a bug
|
||||
# 1 parameter
|
||||
elif action in ('set_release_candidate_number'):
|
||||
set_release_candidate_number()
|
||||
|
||||
# use the build/release candiate number in the identifying version number
|
||||
# 4 parameters
|
||||
elif action in ('set_4_digit_release_number'):
|
||||
set_4_digit_release_number()
|
||||
|
||||
elif action in ('create_nss_release_archive'):
|
||||
create_nss_release_archive()
|
||||
|
||||
else:
|
||||
o.print_help()
|
||||
sys.exit(2)
|
||||
|
||||
sys.exit(0)
|
||||
@@ -0,0 +1,30 @@
|
||||
FROM franziskus/xenial:aarch64
|
||||
MAINTAINER Franziskus Kiefer <franziskuskiefer@gmail.com>
|
||||
|
||||
RUN useradd -d /home/worker -s /bin/bash -m worker
|
||||
WORKDIR /home/worker
|
||||
|
||||
# Add build and test scripts.
|
||||
ADD bin /home/worker/bin
|
||||
RUN chmod +x /home/worker/bin/*
|
||||
|
||||
# Install dependencies.
|
||||
ADD setup.sh /tmp/setup.sh
|
||||
RUN bash /tmp/setup.sh
|
||||
|
||||
# Change user.
|
||||
# USER worker # See bug 1347473.
|
||||
|
||||
# Env variables.
|
||||
ENV HOME /home/worker
|
||||
ENV SHELL /bin/bash
|
||||
ENV USER worker
|
||||
ENV LOGNAME worker
|
||||
ENV HOSTNAME taskcluster-worker
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV HOST localhost
|
||||
ENV DOMSUF localdomain
|
||||
|
||||
# Set a default command for debugging.
|
||||
CMD ["/bin/bash", "--login"]
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
# Drop privileges by re-running this script.
|
||||
exec su worker $0
|
||||
fi
|
||||
|
||||
# Default values for testing.
|
||||
REVISION=${NSS_HEAD_REVISION:-default}
|
||||
REPOSITORY=${NSS_HEAD_REPOSITORY:-https://hg.mozilla.org/projects/nss}
|
||||
|
||||
# Clone NSS.
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r $REVISION $REPOSITORY nss && exit 0
|
||||
rm -rf nss
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
apt-get -y update
|
||||
apt-get -y install software-properties-common
|
||||
|
||||
# Add more repos
|
||||
add-apt-repository "deb http://ports.ubuntu.com/ xenial main restricted universe multiverse"
|
||||
add-apt-repository "deb http://ports.ubuntu.com/ xenial-security main restricted universe multiverse"
|
||||
add-apt-repository "deb http://ports.ubuntu.com/ xenial-updates main restricted universe multiverse"
|
||||
add-apt-repository "deb http://ports.ubuntu.com/ xenial-backports main restricted universe multiverse"
|
||||
|
||||
# Update.
|
||||
apt-get -y update
|
||||
apt-get -y dist-upgrade
|
||||
|
||||
apt_packages=()
|
||||
apt_packages+=('build-essential')
|
||||
apt_packages+=('ca-certificates')
|
||||
apt_packages+=('curl')
|
||||
apt_packages+=('libxml2-utils')
|
||||
apt_packages+=('zlib1g-dev')
|
||||
apt_packages+=('ninja-build')
|
||||
apt_packages+=('gyp')
|
||||
apt_packages+=('mercurial')
|
||||
apt_packages+=('locales')
|
||||
|
||||
# Install packages.
|
||||
apt-get install -y --no-install-recommends ${apt_packages[@]}
|
||||
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
rm $0
|
||||
@@ -0,0 +1,27 @@
|
||||
FROM armv7/armhf-ubuntu:16.04
|
||||
MAINTAINER Franziskus Kiefer <franziskuskiefer@gmail.com>
|
||||
|
||||
RUN useradd -d /home/worker -s /bin/bash -m worker
|
||||
WORKDIR /home/worker
|
||||
|
||||
# Add build and test scripts.
|
||||
ADD bin /home/worker/bin
|
||||
RUN chmod +x /home/worker/bin/*
|
||||
|
||||
# Install dependencies.
|
||||
ADD setup.sh /tmp/setup.sh
|
||||
RUN bash /tmp/setup.sh
|
||||
|
||||
# Env variables.
|
||||
ENV HOME /home/worker
|
||||
ENV SHELL /bin/bash
|
||||
ENV USER worker
|
||||
ENV LOGNAME worker
|
||||
ENV HOSTNAME taskcluster-worker
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV HOST localhost
|
||||
ENV DOMSUF localdomain
|
||||
|
||||
# Set a default command for debugging.
|
||||
CMD ["/bin/bash", "--login"]
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
# set up fake uname
|
||||
if [ ! -f /bin/uname-real ]; then
|
||||
mv /bin/uname /bin/uname-real
|
||||
ln -s /home/worker/bin/uname.sh /bin/uname
|
||||
fi
|
||||
# Drop privileges by re-running this script.
|
||||
exec su worker $0
|
||||
fi
|
||||
|
||||
# Default values for testing.
|
||||
REVISION=${NSS_HEAD_REVISION:-default}
|
||||
REPOSITORY=${NSS_HEAD_REPOSITORY:-https://hg.mozilla.org/projects/nss}
|
||||
|
||||
# Clone NSS.
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r $REVISION $REPOSITORY nss && exit 0
|
||||
rm -rf nss
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
args=`getopt rmvs $*`
|
||||
set -- $args
|
||||
for i
|
||||
do
|
||||
if [ "$i" == "-v" ]; then
|
||||
/bin/uname-real -v
|
||||
fi
|
||||
if [ "$i" == "-r" ]; then
|
||||
echo "4.4.16-v7+"
|
||||
fi
|
||||
if [ "$i" == "-m" ]; then
|
||||
echo "armv7l"
|
||||
fi
|
||||
if [ "$i" == "-s" ]; then
|
||||
echo "Linux"
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Update.
|
||||
apt-get -y update
|
||||
apt-get -y dist-upgrade
|
||||
|
||||
apt_packages=()
|
||||
apt_packages+=('build-essential')
|
||||
apt_packages+=('ca-certificates')
|
||||
apt_packages+=('curl')
|
||||
apt_packages+=('locales')
|
||||
apt_packages+=('python-dev')
|
||||
apt_packages+=('python-pip')
|
||||
apt_packages+=('python-setuptools')
|
||||
apt_packages+=('zlib1g-dev')
|
||||
|
||||
# Install packages.
|
||||
apt-get install -y --no-install-recommends ${apt_packages[@]}
|
||||
|
||||
# Latest Mercurial.
|
||||
pip install --upgrade pip
|
||||
pip install Mercurial
|
||||
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
rm $0
|
||||
@@ -0,0 +1,30 @@
|
||||
FROM ubuntu:16.04
|
||||
MAINTAINER Tim Taubert <ttaubert@mozilla.com>
|
||||
|
||||
RUN useradd -d /home/worker -s /bin/bash -m worker
|
||||
WORKDIR /home/worker
|
||||
|
||||
# Add build and test scripts.
|
||||
ADD bin /home/worker/bin
|
||||
RUN chmod +x /home/worker/bin/*
|
||||
|
||||
# Install dependencies.
|
||||
ADD setup.sh /tmp/setup.sh
|
||||
RUN bash /tmp/setup.sh
|
||||
|
||||
# Change user.
|
||||
USER worker
|
||||
|
||||
# Env variables.
|
||||
ENV HOME /home/worker
|
||||
ENV SHELL /bin/bash
|
||||
ENV USER worker
|
||||
ENV LOGNAME worker
|
||||
ENV HOSTNAME taskcluster-worker
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV HOST localhost
|
||||
ENV DOMSUF localdomain
|
||||
|
||||
# Set a default command for debugging.
|
||||
CMD ["/bin/bash", "--login"]
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
# Drop privileges by re-running this script.
|
||||
exec su worker $0
|
||||
fi
|
||||
|
||||
# Default values for testing.
|
||||
REVISION=${NSS_HEAD_REVISION:-default}
|
||||
REPOSITORY=${NSS_HEAD_REPOSITORY:-https://hg.mozilla.org/projects/nss}
|
||||
|
||||
# Clone NSS.
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r $REVISION $REPOSITORY nss && exit 0
|
||||
rm -rf nss
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Update packages.
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -y update && apt-get -y upgrade
|
||||
|
||||
# Need this to add keys for PPAs below.
|
||||
apt-get install -y --no-install-recommends apt-utils
|
||||
|
||||
apt_packages=()
|
||||
apt_packages+=('ca-certificates')
|
||||
apt_packages+=('curl')
|
||||
apt_packages+=('locales')
|
||||
apt_packages+=('xz-utils')
|
||||
|
||||
# Latest Mercurial.
|
||||
apt_packages+=('mercurial')
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 41BD8711B1F0EC2B0D85B91CF59CE3A8323293EE
|
||||
echo "deb http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu xenial main" > /etc/apt/sources.list.d/mercurial.list
|
||||
|
||||
# Install packages.
|
||||
apt-get -y update
|
||||
apt-get install -y --no-install-recommends ${apt_packages[@]}
|
||||
|
||||
# Download clang.
|
||||
curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
|
||||
curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig
|
||||
# Verify the signature.
|
||||
gpg --keyserver pool.sks-keyservers.net --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D
|
||||
gpg --verify *.tar.xz.sig
|
||||
# Install into /usr/local/.
|
||||
tar xJvf *.tar.xz -C /usr/local --strip-components=1
|
||||
# Cleanup.
|
||||
rm *.tar.xz*
|
||||
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
rm $0
|
||||
@@ -0,0 +1,30 @@
|
||||
FROM ubuntu:16.04
|
||||
MAINTAINER Tim Taubert <ttaubert@mozilla.com>
|
||||
|
||||
RUN useradd -d /home/worker -s /bin/bash -m worker
|
||||
WORKDIR /home/worker
|
||||
|
||||
# Add build and test scripts.
|
||||
ADD bin /home/worker/bin
|
||||
RUN chmod +x /home/worker/bin/*
|
||||
|
||||
# Install dependencies.
|
||||
ADD setup.sh /tmp/setup.sh
|
||||
RUN bash /tmp/setup.sh
|
||||
|
||||
# Change user.
|
||||
USER worker
|
||||
|
||||
# Env variables.
|
||||
ENV HOME /home/worker
|
||||
ENV SHELL /bin/bash
|
||||
ENV USER worker
|
||||
ENV LOGNAME worker
|
||||
ENV HOSTNAME taskcluster-worker
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV HOST localhost
|
||||
ENV DOMSUF localdomain
|
||||
|
||||
# Set a default command for debugging.
|
||||
CMD ["/bin/bash", "--login"]
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Default values for testing.
|
||||
REVISION=${NSS_HEAD_REVISION:-default}
|
||||
REPOSITORY=${NSS_HEAD_REPOSITORY:-https://hg.mozilla.org/projects/nss}
|
||||
|
||||
# Clone NSS.
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r $REVISION $REPOSITORY nss && exit 0
|
||||
rm -rf nss
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Update packages.
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -y update && apt-get -y upgrade
|
||||
|
||||
# Need those to install newer packages below.
|
||||
apt-get install -y --no-install-recommends apt-utils curl ca-certificates locales
|
||||
|
||||
# Latest Mercurial.
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 41BD8711B1F0EC2B0D85B91CF59CE3A8323293EE
|
||||
echo "deb http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu xenial main" > /etc/apt/sources.list.d/mercurial.list
|
||||
|
||||
# Install packages.
|
||||
apt-get -y update && apt-get install -y --no-install-recommends mercurial
|
||||
|
||||
# Latest Node.JS.
|
||||
curl -sL https://deb.nodesource.com/setup_6.x | bash -
|
||||
apt-get install -y --no-install-recommends nodejs
|
||||
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
rm $0
|
||||
@@ -0,0 +1,33 @@
|
||||
FROM ubuntu:16.04
|
||||
MAINTAINER Tim Taubert <ttaubert@mozilla.com>
|
||||
|
||||
RUN useradd -d /home/worker -s /bin/bash -m worker
|
||||
WORKDIR /home/worker
|
||||
|
||||
# Add build and test scripts.
|
||||
ADD bin /home/worker/bin
|
||||
RUN chmod +x /home/worker/bin/*
|
||||
|
||||
# Install dependencies.
|
||||
ADD setup.sh /tmp/setup.sh
|
||||
RUN bash /tmp/setup.sh
|
||||
|
||||
# Change user.
|
||||
USER worker
|
||||
|
||||
# Env variables.
|
||||
ENV HOME /home/worker
|
||||
ENV SHELL /bin/bash
|
||||
ENV USER worker
|
||||
ENV LOGNAME worker
|
||||
ENV HOSTNAME taskcluster-worker
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV HOST localhost
|
||||
ENV DOMSUF localdomain
|
||||
|
||||
# LLVM 4.0
|
||||
ENV PATH "${PATH}:/home/worker/third_party/llvm-build/Release+Asserts/bin/"
|
||||
|
||||
# Set a default command for debugging.
|
||||
CMD ["/bin/bash", "--login"]
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
# Drop privileges by re-running this script.
|
||||
exec su worker $0
|
||||
fi
|
||||
|
||||
# Default values for testing.
|
||||
REVISION=${NSS_HEAD_REVISION:-default}
|
||||
REPOSITORY=${NSS_HEAD_REPOSITORY:-https://hg.mozilla.org/projects/nss}
|
||||
|
||||
# Clone NSS.
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r $REVISION $REPOSITORY nss && exit 0
|
||||
rm -rf nss
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Update packages.
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -y update && apt-get -y upgrade
|
||||
|
||||
# Need this to add keys for PPAs below.
|
||||
apt-get install -y --no-install-recommends apt-utils
|
||||
|
||||
apt_packages=()
|
||||
apt_packages+=('build-essential')
|
||||
apt_packages+=('ca-certificates')
|
||||
apt_packages+=('curl')
|
||||
apt_packages+=('git')
|
||||
apt_packages+=('gyp')
|
||||
apt_packages+=('libssl-dev')
|
||||
apt_packages+=('libxml2-utils')
|
||||
apt_packages+=('locales')
|
||||
apt_packages+=('ninja-build')
|
||||
apt_packages+=('pkg-config')
|
||||
apt_packages+=('zlib1g-dev')
|
||||
|
||||
# 32-bit builds
|
||||
apt_packages+=('gcc-multilib')
|
||||
apt_packages+=('g++-multilib')
|
||||
|
||||
# Latest Mercurial.
|
||||
apt_packages+=('mercurial')
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 41BD8711B1F0EC2B0D85B91CF59CE3A8323293EE
|
||||
echo "deb http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu xenial main" > /etc/apt/sources.list.d/mercurial.list
|
||||
|
||||
# Install packages.
|
||||
apt-get -y update
|
||||
apt-get install -y --no-install-recommends ${apt_packages[@]}
|
||||
|
||||
# 32-bit builds
|
||||
dpkg --add-architecture i386
|
||||
apt-get -y update
|
||||
apt-get install -y --no-install-recommends libssl-dev:i386
|
||||
|
||||
# Install LLVM/clang-4.0.
|
||||
mkdir clang-tmp
|
||||
git clone -n --depth 1 https://chromium.googlesource.com/chromium/src/tools/clang clang-tmp/clang
|
||||
git -C clang-tmp/clang checkout HEAD scripts/update.py
|
||||
clang-tmp/clang/scripts/update.py
|
||||
rm -fr clang-tmp
|
||||
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
rm $0
|
||||
@@ -0,0 +1,30 @@
|
||||
FROM ubuntu:14.04
|
||||
MAINTAINER Tim Taubert <ttaubert@mozilla.com>
|
||||
|
||||
RUN useradd -d /home/worker -s /bin/bash -m worker
|
||||
WORKDIR /home/worker
|
||||
|
||||
# Add build and test scripts.
|
||||
ADD bin /home/worker/bin
|
||||
RUN chmod +x /home/worker/bin/*
|
||||
|
||||
# Install dependencies.
|
||||
ADD setup.sh /tmp/setup.sh
|
||||
RUN bash /tmp/setup.sh
|
||||
|
||||
# Change user.
|
||||
USER worker
|
||||
|
||||
# Env variables.
|
||||
ENV HOME /home/worker
|
||||
ENV SHELL /bin/bash
|
||||
ENV USER worker
|
||||
ENV LOGNAME worker
|
||||
ENV HOSTNAME taskcluster-worker
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV HOST localhost
|
||||
ENV DOMSUF localdomain
|
||||
|
||||
# Set a default command for debugging.
|
||||
CMD ["/bin/bash", "--login"]
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
# Drop privileges by re-running this script.
|
||||
exec su worker $0
|
||||
fi
|
||||
|
||||
# Default values for testing.
|
||||
REVISION=${NSS_HEAD_REVISION:-default}
|
||||
REPOSITORY=${NSS_HEAD_REPOSITORY:-https://hg.mozilla.org/projects/nss}
|
||||
|
||||
# Clone NSS.
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r $REVISION $REPOSITORY nss && exit 0
|
||||
rm -rf nss
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Update packages.
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -y update && apt-get -y upgrade
|
||||
|
||||
apt_packages=()
|
||||
apt_packages+=('ca-certificates')
|
||||
apt_packages+=('g++-4.4')
|
||||
apt_packages+=('gcc-4.4')
|
||||
apt_packages+=('locales')
|
||||
apt_packages+=('make')
|
||||
apt_packages+=('mercurial')
|
||||
apt_packages+=('zlib1g-dev')
|
||||
|
||||
# Install packages.
|
||||
apt-get -y update
|
||||
apt-get install -y --no-install-recommends ${apt_packages[@]}
|
||||
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
rm $0
|
||||
@@ -0,0 +1,30 @@
|
||||
FROM ubuntu:xenial
|
||||
|
||||
MAINTAINER Franziskus Kiefer <franziskuskiefer@gmail.com>
|
||||
# Based on the HACL* image from Benjamin Beurdouche and
|
||||
# the original F* formula with Daniel Fabian
|
||||
|
||||
# Pinned versions of HACL* (F* and KreMLin are pinned as submodules)
|
||||
ENV haclrepo https://github.com/mitls/hacl-star.git
|
||||
|
||||
# Define versions of dependencies
|
||||
ENV opamv 4.04.2
|
||||
ENV haclversion dcd48329d535727dbde93877b124c5ec4a7a2b20
|
||||
|
||||
# Install required packages and set versions
|
||||
ADD setup.sh /tmp/setup.sh
|
||||
RUN bash /tmp/setup.sh
|
||||
|
||||
# Create user, add scripts.
|
||||
RUN useradd -ms /bin/bash worker
|
||||
WORKDIR /home/worker
|
||||
ADD bin /home/worker/bin
|
||||
RUN chmod +x /home/worker/bin/*
|
||||
USER worker
|
||||
|
||||
# Build F*, HACL*, verify. Install a few more dependencies.
|
||||
ENV OPAMYES true
|
||||
ENV PATH "/home/worker/hacl-star/dependencies/z3/bin:$PATH"
|
||||
ADD setup-user.sh /tmp/setup-user.sh
|
||||
ADD license.txt /tmp/license.txt
|
||||
RUN bash /tmp/setup-user.sh
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
# Drop privileges by re-running this script.
|
||||
exec su worker $0
|
||||
fi
|
||||
|
||||
# Default values for testing.
|
||||
REVISION=${NSS_HEAD_REVISION:-default}
|
||||
REPOSITORY=${NSS_HEAD_REPOSITORY:-https://hg.mozilla.org/projects/nss}
|
||||
|
||||
# Clone NSS.
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r $REVISION $REPOSITORY nss && exit 0
|
||||
rm -rf nss
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,15 @@
|
||||
/* Copyright 2016-2017 INRIA and Microsoft Corporation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Prepare build (OCaml packages)
|
||||
opam init
|
||||
echo ". /home/worker/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true" >> .bashrc
|
||||
opam switch -v ${opamv}
|
||||
opam install ocamlfind batteries sqlite3 fileutils yojson ppx_deriving_yojson zarith pprint menhir ulex process fix wasm stdint
|
||||
|
||||
# Get the HACL* code
|
||||
git clone ${haclrepo} hacl-star
|
||||
git -C hacl-star checkout ${haclversion}
|
||||
|
||||
# Prepare submodules, and build, verify, test, and extract c code
|
||||
# This caches the extracted c code (pins the HACL* version). All we need to do
|
||||
# on CI now is comparing the code in this docker image with the one in NSS.
|
||||
opam config exec -- make -C hacl-star prepare -j$(nproc)
|
||||
make -C hacl-star verify-nss -j$(nproc)
|
||||
make -C hacl-star -f Makefile.build snapshots/nss -j$(nproc)
|
||||
KOPTS="-funroll-loops 5" make -C hacl-star/code/curve25519 test -j$(nproc)
|
||||
make -C hacl-star/code/salsa-family test -j$(nproc)
|
||||
make -C hacl-star/code/poly1305 test -j$(nproc)
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Update packages.
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -qq update
|
||||
apt-get install --yes libssl-dev libsqlite3-dev g++-5 gcc-5 m4 make opam pkg-config python libgmp3-dev cmake curl libtool-bin autoconf wget locales
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 200
|
||||
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 200
|
||||
|
||||
# Get clang-format-3.9
|
||||
curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
|
||||
curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig
|
||||
# Verify the signature.
|
||||
gpg --keyserver pool.sks-keyservers.net --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D
|
||||
gpg --verify *.tar.xz.sig
|
||||
# Install into /usr/local/.
|
||||
tar xJvf *.tar.xz -C /usr/local --strip-components=1
|
||||
# Cleanup.
|
||||
rm *.tar.xz*
|
||||
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
@@ -0,0 +1,33 @@
|
||||
FROM ubuntu:16.04
|
||||
MAINTAINER Tim Taubert <ttaubert@mozilla.com>
|
||||
|
||||
RUN useradd -d /home/worker -s /bin/bash -m worker
|
||||
WORKDIR /home/worker
|
||||
|
||||
# Add build and test scripts.
|
||||
ADD bin /home/worker/bin
|
||||
RUN chmod +x /home/worker/bin/*
|
||||
|
||||
# Install dependencies.
|
||||
ADD setup.sh /tmp/setup.sh
|
||||
RUN bash /tmp/setup.sh
|
||||
|
||||
# Change user.
|
||||
USER worker
|
||||
|
||||
# Env variables.
|
||||
ENV HOME /home/worker
|
||||
ENV SHELL /bin/bash
|
||||
ENV USER worker
|
||||
ENV LOGNAME worker
|
||||
ENV HOSTNAME taskcluster-worker
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV HOST localhost
|
||||
ENV DOMSUF localdomain
|
||||
|
||||
# Rust + Go
|
||||
ENV PATH "${PATH}:/home/worker/.cargo/bin/:/usr/lib/go-1.6/bin"
|
||||
|
||||
# Set a default command for debugging.
|
||||
CMD ["/bin/bash", "--login"]
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
# Drop privileges by re-running this script.
|
||||
exec su worker $0
|
||||
fi
|
||||
|
||||
# Default values for testing.
|
||||
REVISION=${NSS_HEAD_REVISION:-default}
|
||||
REPOSITORY=${NSS_HEAD_REPOSITORY:-https://hg.mozilla.org/projects/nss}
|
||||
|
||||
# Clone NSS.
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r $REVISION $REPOSITORY nss && exit 0
|
||||
rm -rf nss
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Update packages.
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -y update && apt-get -y upgrade
|
||||
|
||||
# Need this to add keys for PPAs below.
|
||||
apt-get install -y --no-install-recommends apt-utils
|
||||
|
||||
apt_packages=()
|
||||
apt_packages+=('build-essential')
|
||||
apt_packages+=('ca-certificates')
|
||||
apt_packages+=('curl')
|
||||
apt_packages+=('npm')
|
||||
apt_packages+=('git')
|
||||
apt_packages+=('golang-1.6')
|
||||
apt_packages+=('libxml2-utils')
|
||||
apt_packages+=('locales')
|
||||
apt_packages+=('ninja-build')
|
||||
apt_packages+=('pkg-config')
|
||||
apt_packages+=('zlib1g-dev')
|
||||
|
||||
# 32-bit builds
|
||||
apt_packages+=('lib32z1-dev')
|
||||
apt_packages+=('gcc-multilib')
|
||||
apt_packages+=('g++-multilib')
|
||||
|
||||
# ct-verif and sanitizers
|
||||
apt_packages+=('valgrind')
|
||||
|
||||
# Latest Mercurial.
|
||||
apt_packages+=('mercurial')
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 41BD8711B1F0EC2B0D85B91CF59CE3A8323293EE
|
||||
echo "deb http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu xenial main" > /etc/apt/sources.list.d/mercurial.list
|
||||
|
||||
# gcc 4.8 and 6
|
||||
apt_packages+=('g++-6')
|
||||
apt_packages+=('g++-4.8')
|
||||
apt_packages+=('g++-6-multilib')
|
||||
apt_packages+=('g++-4.8-multilib')
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 60C317803A41BA51845E371A1E9377A2BA9EF27F
|
||||
echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" > /etc/apt/sources.list.d/toolchain.list
|
||||
|
||||
# Install packages.
|
||||
apt-get -y update
|
||||
apt-get install -y --no-install-recommends ${apt_packages[@]}
|
||||
|
||||
# Download clang.
|
||||
curl -LO https://releases.llvm.org/4.0.0/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
|
||||
curl -LO https://releases.llvm.org/4.0.0/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig
|
||||
# Verify the signature.
|
||||
gpg --keyserver pool.sks-keyservers.net --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D
|
||||
gpg --verify *.tar.xz.sig
|
||||
# Install into /usr/local/.
|
||||
tar xJvf *.tar.xz -C /usr/local --strip-components=1
|
||||
# Cleanup.
|
||||
rm *.tar.xz*
|
||||
|
||||
# Install latest Rust (stable).
|
||||
su worker -c "curl https://sh.rustup.rs -sSf | sh -s -- -y"
|
||||
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
|
||||
# Cleanup.
|
||||
rm -rf ~/.ccache ~/.cache
|
||||
apt-get autoremove -y
|
||||
apt-get clean
|
||||
apt-get autoclean
|
||||
rm $0
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "decision-task",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"author": "Tim Taubert <ttaubert@mozilla.com>",
|
||||
"description": "Decision Task for NSS",
|
||||
"scripts": {
|
||||
"compile": "babel-compile -p taskcluster src:lib",
|
||||
"install": "npm run compile"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-cli": "^6.14.0",
|
||||
"babel-compile": "^2.0.0",
|
||||
"babel-preset-taskcluster": "^3.0.0",
|
||||
"babel-runtime": "^6.11.6",
|
||||
"flatmap": "0.0.3",
|
||||
"intersect": "^1.0.1",
|
||||
"js-yaml": "^3.6.1",
|
||||
"merge": "^1.2.0",
|
||||
"minimist": "^1.2.0",
|
||||
"slugid": "^1.1.0",
|
||||
"taskcluster-client": "^1.2.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/* 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/. */
|
||||
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import crypto from "crypto";
|
||||
import flatmap from "flatmap";
|
||||
|
||||
// Compute the SHA-256 digest.
|
||||
function sha256(data) {
|
||||
let hash = crypto.createHash("sha256");
|
||||
hash.update(data);
|
||||
return hash.digest("hex");
|
||||
}
|
||||
|
||||
// Recursively collect a list of all files of a given directory.
|
||||
function collectFilesInDirectory(dir) {
|
||||
return flatmap(fs.readdirSync(dir), entry => {
|
||||
let entry_path = path.join(dir, entry);
|
||||
|
||||
if (fs.lstatSync(entry_path).isDirectory()) {
|
||||
return collectFilesInDirectory(entry_path);
|
||||
}
|
||||
|
||||
return [entry_path];
|
||||
});
|
||||
}
|
||||
|
||||
// A list of hashes for each file in the given path.
|
||||
function collectFileHashes(context_path) {
|
||||
let root = path.join(__dirname, "../../../..");
|
||||
let dir = path.join(root, context_path);
|
||||
let files = collectFilesInDirectory(dir).sort();
|
||||
|
||||
return files.map(file => {
|
||||
return sha256(file + "|" + fs.readFileSync(file, "utf-8"));
|
||||
});
|
||||
}
|
||||
|
||||
// Compute a context hash for the given context path.
|
||||
export default function (context_path) {
|
||||
// Regenerate all images when the image_builder changes.
|
||||
let hashes = collectFileHashes("automation/taskcluster/image_builder");
|
||||
|
||||
// Regenerate images when the image itself changes.
|
||||
hashes = hashes.concat(collectFileHashes(context_path));
|
||||
|
||||
// Generate a new prefix every month to ensure the image stays buildable.
|
||||
let now = new Date();
|
||||
let prefix = `${now.getUTCFullYear()}-${now.getUTCMonth() + 1}:`;
|
||||
return sha256(prefix + hashes.join(","));
|
||||
}
|
||||
@@ -0,0 +1,995 @@
|
||||
/* 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/. */
|
||||
|
||||
import merge from "./merge";
|
||||
import * as queue from "./queue";
|
||||
|
||||
const LINUX_IMAGE = {
|
||||
name: "linux",
|
||||
path: "automation/taskcluster/docker"
|
||||
};
|
||||
|
||||
const LINUX_CLANG39_IMAGE = {
|
||||
name: "linux-clang-3.9",
|
||||
path: "automation/taskcluster/docker-clang-3.9"
|
||||
};
|
||||
|
||||
const LINUX_GCC44_IMAGE = {
|
||||
name: "linux-gcc-4.4",
|
||||
path: "automation/taskcluster/docker-gcc-4.4"
|
||||
};
|
||||
|
||||
const FUZZ_IMAGE = {
|
||||
name: "fuzz",
|
||||
path: "automation/taskcluster/docker-fuzz"
|
||||
};
|
||||
|
||||
const HACL_GEN_IMAGE = {
|
||||
name: "hacl",
|
||||
path: "automation/taskcluster/docker-hacl"
|
||||
};
|
||||
|
||||
const WINDOWS_CHECKOUT_CMD =
|
||||
"bash -c \"hg clone -r $NSS_HEAD_REVISION $NSS_HEAD_REPOSITORY nss || " +
|
||||
"(sleep 2; hg clone -r $NSS_HEAD_REVISION $NSS_HEAD_REPOSITORY nss) || " +
|
||||
"(sleep 5; hg clone -r $NSS_HEAD_REVISION $NSS_HEAD_REPOSITORY nss)\"";
|
||||
const MAC_CHECKOUT_CMD = ["bash", "-c",
|
||||
"hg clone -r $NSS_HEAD_REVISION $NSS_HEAD_REPOSITORY nss || " +
|
||||
"(sleep 2; hg clone -r $NSS_HEAD_REVISION $NSS_HEAD_REPOSITORY nss) || " +
|
||||
"(sleep 5; hg clone -r $NSS_HEAD_REVISION $NSS_HEAD_REPOSITORY nss)"];
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
queue.filter(task => {
|
||||
if (task.group == "Builds") {
|
||||
// Remove extra builds on {A,UB}San and ARM.
|
||||
if (task.collection == "asan" || task.platform == "aarch64") {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make modular builds only on Linux make.
|
||||
if (task.symbol == "modular" && task.collection != "make") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (task.tests == "bogo" || task.tests == "interop") {
|
||||
// No windows
|
||||
if (task.platform == "windows2012-64" ||
|
||||
task.platform == "windows2012-32") {
|
||||
return false;
|
||||
}
|
||||
|
||||
// No ARM; TODO: enable
|
||||
if (task.platform == "aarch64") {
|
||||
return false;
|
||||
}
|
||||
|
||||
// No mac
|
||||
if (task.platform == "mac") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (task.tests == "fips" && task.platform == "mac") {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only old make builds have -Ddisable_libpkix=0 and can run chain tests.
|
||||
if (task.tests == "chains" && task.collection != "make") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (task.group == "Test") {
|
||||
// Don't run test builds on old make platforms, and not for fips gyp.
|
||||
if (task.collection == "make" || task.collection == "fips") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't run additional hardware tests on ARM (we don't have anything there).
|
||||
if (task.group == "Cipher" && task.platform == "aarch64" && task.env &&
|
||||
(task.env.NSS_DISABLE_PCLMUL == "1" || task.env.NSS_DISABLE_HW_AES == "1"
|
||||
|| task.env.NSS_DISABLE_AVX == "1")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
queue.map(task => {
|
||||
if (task.collection == "asan") {
|
||||
// CRMF and FIPS tests still leak, unfortunately.
|
||||
if (task.tests == "crmf") {
|
||||
task.env.ASAN_OPTIONS = "detect_leaks=0";
|
||||
}
|
||||
}
|
||||
|
||||
// We don't run FIPS SSL tests
|
||||
if (task.tests == "ssl") {
|
||||
if (!task.env) {
|
||||
task.env = {};
|
||||
}
|
||||
task.env.NSS_SSL_TESTS = "crl iopr policy";
|
||||
}
|
||||
|
||||
// Windows is slow.
|
||||
if (task.platform == "windows2012-64" && task.tests == "chains") {
|
||||
task.maxRunTime = 7200;
|
||||
}
|
||||
|
||||
return task;
|
||||
});
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
export default async function main() {
|
||||
await scheduleLinux("Linux 32 (opt)", {
|
||||
platform: "linux32",
|
||||
image: LINUX_IMAGE
|
||||
}, "-m32 --opt");
|
||||
|
||||
await scheduleLinux("Linux 32 (debug)", {
|
||||
platform: "linux32",
|
||||
collection: "debug",
|
||||
image: LINUX_IMAGE
|
||||
}, "-m32");
|
||||
|
||||
await scheduleLinux("Linux 64 (opt)", {
|
||||
platform: "linux64",
|
||||
image: LINUX_IMAGE
|
||||
}, "--opt");
|
||||
|
||||
await scheduleLinux("Linux 64 (debug)", {
|
||||
platform: "linux64",
|
||||
collection: "debug",
|
||||
image: LINUX_IMAGE
|
||||
});
|
||||
|
||||
await scheduleLinux("Linux 64 (debug, make)", {
|
||||
env: {USE_64: "1"},
|
||||
platform: "linux64",
|
||||
image: LINUX_IMAGE,
|
||||
collection: "make",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/build.sh"
|
||||
],
|
||||
});
|
||||
|
||||
await scheduleLinux("Linux 64 (opt, make)", {
|
||||
env: {USE_64: "1", BUILD_OPT: "1"},
|
||||
platform: "linux64",
|
||||
image: LINUX_IMAGE,
|
||||
collection: "make",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/build.sh"
|
||||
],
|
||||
});
|
||||
|
||||
await scheduleLinux("Linux 32 (debug, make)", {
|
||||
platform: "linux32",
|
||||
image: LINUX_IMAGE,
|
||||
collection: "make",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/build.sh"
|
||||
],
|
||||
});
|
||||
|
||||
await scheduleLinux("Linux 64 (ASan, debug)", {
|
||||
env: {
|
||||
UBSAN_OPTIONS: "print_stacktrace=1",
|
||||
NSS_DISABLE_ARENA_FREE_LIST: "1",
|
||||
NSS_DISABLE_UNLOAD: "1",
|
||||
CC: "clang",
|
||||
CCC: "clang++",
|
||||
},
|
||||
platform: "linux64",
|
||||
collection: "asan",
|
||||
image: LINUX_IMAGE,
|
||||
features: ["allowPtrace"],
|
||||
}, "--ubsan --asan");
|
||||
|
||||
await scheduleLinux("Linux 64 (FIPS opt)", {
|
||||
platform: "linux64",
|
||||
collection: "fips",
|
||||
image: LINUX_IMAGE,
|
||||
}, "--enable-fips --opt");
|
||||
|
||||
await scheduleWindows("Windows 2012 64 (debug, make)", {
|
||||
platform: "windows2012-64",
|
||||
collection: "make",
|
||||
env: {USE_64: "1"}
|
||||
}, "build.sh");
|
||||
|
||||
await scheduleWindows("Windows 2012 32 (debug, make)", {
|
||||
platform: "windows2012-32",
|
||||
collection: "make"
|
||||
}, "build.sh");
|
||||
|
||||
await scheduleWindows("Windows 2012 64 (opt)", {
|
||||
platform: "windows2012-64",
|
||||
}, "build_gyp.sh --opt");
|
||||
|
||||
await scheduleWindows("Windows 2012 64 (debug)", {
|
||||
platform: "windows2012-64",
|
||||
collection: "debug"
|
||||
}, "build_gyp.sh");
|
||||
|
||||
await scheduleWindows("Windows 2012 32 (opt)", {
|
||||
platform: "windows2012-32",
|
||||
}, "build_gyp.sh --opt -m32");
|
||||
|
||||
await scheduleWindows("Windows 2012 32 (debug)", {
|
||||
platform: "windows2012-32",
|
||||
collection: "debug"
|
||||
}, "build_gyp.sh -m32");
|
||||
|
||||
await scheduleFuzzing();
|
||||
await scheduleFuzzing32();
|
||||
|
||||
await scheduleTools();
|
||||
|
||||
let aarch64_base = {
|
||||
image: "franziskus/nss-aarch64-ci",
|
||||
provisioner: "localprovisioner",
|
||||
workerType: "nss-aarch64",
|
||||
platform: "aarch64",
|
||||
maxRunTime: 7200
|
||||
};
|
||||
|
||||
await scheduleLinux("Linux AArch64 (debug)",
|
||||
merge({
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh"
|
||||
],
|
||||
collection: "debug",
|
||||
}, aarch64_base)
|
||||
);
|
||||
|
||||
await scheduleLinux("Linux AArch64 (opt)",
|
||||
merge({
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh --opt"
|
||||
],
|
||||
collection: "opt",
|
||||
}, aarch64_base)
|
||||
);
|
||||
|
||||
await scheduleMac("Mac (opt)", {collection: "opt"}, "--opt");
|
||||
await scheduleMac("Mac (debug)", {collection: "debug"});
|
||||
}
|
||||
|
||||
|
||||
async function scheduleMac(name, base, args = "") {
|
||||
let mac_base = merge(base, {
|
||||
env: {
|
||||
PATH: "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
|
||||
NSS_TASKCLUSTER_MAC: "1",
|
||||
DOMSUF: "localdomain",
|
||||
HOST: "localhost",
|
||||
},
|
||||
provisioner: "localprovisioner",
|
||||
workerType: "nss-macos-10-12",
|
||||
platform: "mac"
|
||||
});
|
||||
|
||||
// Build base definition.
|
||||
let build_base = merge({
|
||||
command: [
|
||||
MAC_CHECKOUT_CMD,
|
||||
["bash", "-c",
|
||||
"nss/automation/taskcluster/scripts/build_gyp.sh", args]
|
||||
],
|
||||
provisioner: "localprovisioner",
|
||||
workerType: "nss-macos-10-12",
|
||||
platform: "mac",
|
||||
maxRunTime: 7200,
|
||||
artifacts: [{
|
||||
expires: 24 * 7,
|
||||
type: "directory",
|
||||
path: "public"
|
||||
}],
|
||||
kind: "build",
|
||||
symbol: "B"
|
||||
}, mac_base);
|
||||
|
||||
// The task that builds NSPR+NSS.
|
||||
let task_build = queue.scheduleTask(merge(build_base, {name}));
|
||||
|
||||
// The task that generates certificates.
|
||||
let task_cert = queue.scheduleTask(merge(build_base, {
|
||||
name: "Certificates",
|
||||
command: [
|
||||
MAC_CHECKOUT_CMD,
|
||||
["bash", "-c",
|
||||
"nss/automation/taskcluster/scripts/gen_certs.sh"]
|
||||
],
|
||||
parent: task_build,
|
||||
symbol: "Certs"
|
||||
}));
|
||||
|
||||
// Schedule tests.
|
||||
scheduleTests(task_build, task_cert, merge(mac_base, {
|
||||
command: [
|
||||
MAC_CHECKOUT_CMD,
|
||||
["bash", "-c",
|
||||
"nss/automation/taskcluster/scripts/run_tests.sh"]
|
||||
]
|
||||
}));
|
||||
|
||||
return queue.submit();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
async function scheduleLinux(name, base, args = "") {
|
||||
// Build base definition.
|
||||
let build_base = merge({
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh " + args
|
||||
],
|
||||
artifacts: {
|
||||
public: {
|
||||
expires: 24 * 7,
|
||||
type: "directory",
|
||||
path: "/home/worker/artifacts"
|
||||
}
|
||||
},
|
||||
kind: "build",
|
||||
symbol: "B"
|
||||
}, base);
|
||||
|
||||
// The task that builds NSPR+NSS.
|
||||
let task_build = queue.scheduleTask(merge(build_base, {name}));
|
||||
|
||||
// Make builds run FIPS tests, which need an extra FIPS build.
|
||||
if (base.collection == "make") {
|
||||
let extra_build = queue.scheduleTask(merge(build_base, {
|
||||
env: { NSS_FORCE_FIPS: "1" },
|
||||
group: "FIPS",
|
||||
name: `${name} w/ NSS_FORCE_FIPS`
|
||||
}));
|
||||
|
||||
// The task that generates certificates.
|
||||
let task_cert = queue.scheduleTask(merge(build_base, {
|
||||
name: "Certificates",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/gen_certs.sh"
|
||||
],
|
||||
parent: extra_build,
|
||||
symbol: "Certs-F",
|
||||
group: "FIPS",
|
||||
}));
|
||||
|
||||
// Schedule FIPS tests.
|
||||
queue.scheduleTask(merge(base, {
|
||||
parent: task_cert,
|
||||
name: "FIPS",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_tests.sh"
|
||||
],
|
||||
cycle: "standard",
|
||||
kind: "test",
|
||||
name: "FIPS tests",
|
||||
symbol: "Tests-F",
|
||||
tests: "fips",
|
||||
group: "FIPS"
|
||||
}));
|
||||
}
|
||||
|
||||
// The task that generates certificates.
|
||||
let task_cert = queue.scheduleTask(merge(build_base, {
|
||||
name: "Certificates",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/gen_certs.sh"
|
||||
],
|
||||
parent: task_build,
|
||||
symbol: "Certs"
|
||||
}));
|
||||
|
||||
// Schedule tests.
|
||||
scheduleTests(task_build, task_cert, merge(base, {
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_tests.sh"
|
||||
]
|
||||
}));
|
||||
|
||||
// Extra builds.
|
||||
let extra_base = merge({group: "Builds"}, build_base);
|
||||
queue.scheduleTask(merge(extra_base, {
|
||||
name: `${name} w/ clang-4.0`,
|
||||
env: {
|
||||
CC: "clang",
|
||||
CCC: "clang++",
|
||||
},
|
||||
symbol: "clang-4.0"
|
||||
}));
|
||||
|
||||
queue.scheduleTask(merge(extra_base, {
|
||||
name: `${name} w/ gcc-4.4`,
|
||||
image: LINUX_GCC44_IMAGE,
|
||||
env: {
|
||||
USE_64: "1",
|
||||
CC: "gcc-4.4",
|
||||
CCC: "g++-4.4",
|
||||
// gcc-4.6 introduced nullptr.
|
||||
NSS_DISABLE_GTESTS: "1",
|
||||
},
|
||||
// Use the old Makefile-based build system, GYP doesn't have a proper GCC
|
||||
// version check for __int128 support. It's mainly meant to cover RHEL6.
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/build.sh",
|
||||
],
|
||||
symbol: "gcc-4.4"
|
||||
}));
|
||||
|
||||
queue.scheduleTask(merge(extra_base, {
|
||||
name: `${name} w/ gcc-4.8`,
|
||||
env: {
|
||||
CC: "gcc-4.8",
|
||||
CCC: "g++-4.8"
|
||||
},
|
||||
symbol: "gcc-4.8"
|
||||
}));
|
||||
|
||||
queue.scheduleTask(merge(extra_base, {
|
||||
name: `${name} w/ gcc-6.1`,
|
||||
env: {
|
||||
CC: "gcc-6",
|
||||
CCC: "g++-6"
|
||||
},
|
||||
symbol: "gcc-6.1"
|
||||
}));
|
||||
|
||||
queue.scheduleTask(merge(extra_base, {
|
||||
name: `${name} w/ modular builds`,
|
||||
env: {NSS_BUILD_MODULAR: "1"},
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/build.sh",
|
||||
],
|
||||
symbol: "modular"
|
||||
}));
|
||||
|
||||
await scheduleTestBuilds(merge(base, {group: "Test"}), args);
|
||||
|
||||
return queue.submit();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
function scheduleFuzzingRun(base, name, target, max_len, symbol = null, corpus = null) {
|
||||
const MAX_FUZZ_TIME = 300;
|
||||
|
||||
queue.scheduleTask(merge(base, {
|
||||
name,
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/fuzz.sh " +
|
||||
`${target} nss/fuzz/corpus/${corpus || target} ` +
|
||||
`-max_total_time=${MAX_FUZZ_TIME} ` +
|
||||
`-max_len=${max_len}`
|
||||
],
|
||||
symbol: symbol || name
|
||||
}));
|
||||
}
|
||||
|
||||
async function scheduleFuzzing() {
|
||||
let base = {
|
||||
env: {
|
||||
ASAN_OPTIONS: "allocator_may_return_null=1:detect_stack_use_after_return=1",
|
||||
UBSAN_OPTIONS: "print_stacktrace=1",
|
||||
NSS_DISABLE_ARENA_FREE_LIST: "1",
|
||||
NSS_DISABLE_UNLOAD: "1",
|
||||
CC: "clang",
|
||||
CCC: "clang++"
|
||||
},
|
||||
features: ["allowPtrace"],
|
||||
platform: "linux64",
|
||||
collection: "fuzz",
|
||||
image: FUZZ_IMAGE
|
||||
};
|
||||
|
||||
// Build base definition.
|
||||
let build_base = merge({
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && " +
|
||||
"nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz"
|
||||
],
|
||||
artifacts: {
|
||||
public: {
|
||||
expires: 24 * 7,
|
||||
type: "directory",
|
||||
path: "/home/worker/artifacts"
|
||||
}
|
||||
},
|
||||
kind: "build",
|
||||
symbol: "B"
|
||||
}, base);
|
||||
|
||||
// The task that builds NSPR+NSS.
|
||||
let task_build = queue.scheduleTask(merge(build_base, {
|
||||
name: "Linux x64 (debug, fuzz)"
|
||||
}));
|
||||
|
||||
// The task that builds NSPR+NSS (TLS fuzzing mode).
|
||||
let task_build_tls = queue.scheduleTask(merge(build_base, {
|
||||
name: "Linux x64 (debug, TLS fuzz)",
|
||||
symbol: "B",
|
||||
group: "TLS",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && " +
|
||||
"nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz=tls"
|
||||
],
|
||||
}));
|
||||
|
||||
// Schedule tests.
|
||||
queue.scheduleTask(merge(base, {
|
||||
parent: task_build_tls,
|
||||
name: "Gtests",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_tests.sh"
|
||||
],
|
||||
env: {GTESTFILTER: "*Fuzz*"},
|
||||
tests: "ssl_gtests gtests",
|
||||
cycle: "standard",
|
||||
symbol: "Gtest",
|
||||
kind: "test"
|
||||
}));
|
||||
|
||||
// Schedule fuzzing runs.
|
||||
let run_base = merge(base, {parent: task_build, kind: "test"});
|
||||
scheduleFuzzingRun(run_base, "CertDN", "certDN", 4096);
|
||||
scheduleFuzzingRun(run_base, "QuickDER", "quickder", 10000);
|
||||
|
||||
// Schedule MPI fuzzing runs.
|
||||
let mpi_base = merge(run_base, {group: "MPI"});
|
||||
let mpi_names = ["add", "addmod", "div", "mod", "mulmod", "sqr",
|
||||
"sqrmod", "sub", "submod"];
|
||||
for (let name of mpi_names) {
|
||||
scheduleFuzzingRun(mpi_base, `MPI (${name})`, `mpi-${name}`, 4096, name);
|
||||
}
|
||||
scheduleFuzzingRun(mpi_base, `MPI (invmod)`, `mpi-invmod`, 256, "invmod");
|
||||
scheduleFuzzingRun(mpi_base, `MPI (expmod)`, `mpi-expmod`, 2048, "expmod");
|
||||
|
||||
// Schedule TLS fuzzing runs (non-fuzzing mode).
|
||||
let tls_base = merge(run_base, {group: "TLS"});
|
||||
scheduleFuzzingRun(tls_base, "TLS Client", "tls-client", 20000, "client-nfm",
|
||||
"tls-client-no_fuzzer_mode");
|
||||
scheduleFuzzingRun(tls_base, "TLS Server", "tls-server", 20000, "server-nfm",
|
||||
"tls-server-no_fuzzer_mode");
|
||||
scheduleFuzzingRun(tls_base, "DTLS Client", "dtls-client", 20000,
|
||||
"dtls-client-nfm", "dtls-client-no_fuzzer_mode");
|
||||
scheduleFuzzingRun(tls_base, "DTLS Server", "dtls-server", 20000,
|
||||
"dtls-server-nfm", "dtls-server-no_fuzzer_mode");
|
||||
|
||||
// Schedule TLS fuzzing runs (fuzzing mode).
|
||||
let tls_fm_base = merge(tls_base, {parent: task_build_tls});
|
||||
scheduleFuzzingRun(tls_fm_base, "TLS Client", "tls-client", 20000, "client");
|
||||
scheduleFuzzingRun(tls_fm_base, "TLS Server", "tls-server", 20000, "server");
|
||||
scheduleFuzzingRun(tls_fm_base, "DTLS Client", "dtls-client", 20000, "dtls-client");
|
||||
scheduleFuzzingRun(tls_fm_base, "DTLS Server", "dtls-server", 20000, "dtls-server");
|
||||
|
||||
return queue.submit();
|
||||
}
|
||||
|
||||
async function scheduleFuzzing32() {
|
||||
let base = {
|
||||
env: {
|
||||
ASAN_OPTIONS: "allocator_may_return_null=1:detect_stack_use_after_return=1",
|
||||
UBSAN_OPTIONS: "print_stacktrace=1",
|
||||
NSS_DISABLE_ARENA_FREE_LIST: "1",
|
||||
NSS_DISABLE_UNLOAD: "1",
|
||||
CC: "clang",
|
||||
CCC: "clang++"
|
||||
},
|
||||
features: ["allowPtrace"],
|
||||
platform: "linux32",
|
||||
collection: "fuzz",
|
||||
image: FUZZ_IMAGE
|
||||
};
|
||||
|
||||
// Build base definition.
|
||||
let build_base = merge({
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && " +
|
||||
"nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz -m32"
|
||||
],
|
||||
artifacts: {
|
||||
public: {
|
||||
expires: 24 * 7,
|
||||
type: "directory",
|
||||
path: "/home/worker/artifacts"
|
||||
}
|
||||
},
|
||||
kind: "build",
|
||||
symbol: "B"
|
||||
}, base);
|
||||
|
||||
// The task that builds NSPR+NSS.
|
||||
let task_build = queue.scheduleTask(merge(build_base, {
|
||||
name: "Linux 32 (debug, fuzz)"
|
||||
}));
|
||||
|
||||
// The task that builds NSPR+NSS (TLS fuzzing mode).
|
||||
let task_build_tls = queue.scheduleTask(merge(build_base, {
|
||||
name: "Linux 32 (debug, TLS fuzz)",
|
||||
symbol: "B",
|
||||
group: "TLS",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && " +
|
||||
"nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz=tls -m32"
|
||||
],
|
||||
}));
|
||||
|
||||
// Schedule tests.
|
||||
queue.scheduleTask(merge(base, {
|
||||
parent: task_build_tls,
|
||||
name: "Gtests",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_tests.sh"
|
||||
],
|
||||
env: {GTESTFILTER: "*Fuzz*"},
|
||||
tests: "ssl_gtests gtests",
|
||||
cycle: "standard",
|
||||
symbol: "Gtest",
|
||||
kind: "test"
|
||||
}));
|
||||
|
||||
// Schedule fuzzing runs.
|
||||
let run_base = merge(base, {parent: task_build, kind: "test"});
|
||||
scheduleFuzzingRun(run_base, "CertDN", "certDN", 4096);
|
||||
scheduleFuzzingRun(run_base, "QuickDER", "quickder", 10000);
|
||||
|
||||
// Schedule MPI fuzzing runs.
|
||||
let mpi_base = merge(run_base, {group: "MPI"});
|
||||
let mpi_names = ["add", "addmod", "div", "expmod", "mod", "mulmod", "sqr",
|
||||
"sqrmod", "sub", "submod"];
|
||||
for (let name of mpi_names) {
|
||||
scheduleFuzzingRun(mpi_base, `MPI (${name})`, `mpi-${name}`, 4096, name);
|
||||
}
|
||||
scheduleFuzzingRun(mpi_base, `MPI (invmod)`, `mpi-invmod`, 256, "invmod");
|
||||
|
||||
// Schedule TLS fuzzing runs (non-fuzzing mode).
|
||||
let tls_base = merge(run_base, {group: "TLS"});
|
||||
scheduleFuzzingRun(tls_base, "TLS Client", "tls-client", 20000, "client-nfm",
|
||||
"tls-client-no_fuzzer_mode");
|
||||
scheduleFuzzingRun(tls_base, "TLS Server", "tls-server", 20000, "server-nfm",
|
||||
"tls-server-no_fuzzer_mode");
|
||||
scheduleFuzzingRun(tls_base, "DTLS Client", "dtls-client", 20000,
|
||||
"dtls-client-nfm", "dtls-client-no_fuzzer_mode");
|
||||
scheduleFuzzingRun(tls_base, "DTLS Server", "dtls-server", 20000,
|
||||
"dtls-server-nfm", "dtls-server-no_fuzzer_mode");
|
||||
|
||||
// Schedule TLS fuzzing runs (fuzzing mode).
|
||||
let tls_fm_base = merge(tls_base, {parent: task_build_tls});
|
||||
scheduleFuzzingRun(tls_fm_base, "TLS Client", "tls-client", 20000, "client");
|
||||
scheduleFuzzingRun(tls_fm_base, "TLS Server", "tls-server", 20000, "server");
|
||||
scheduleFuzzingRun(tls_fm_base, "DTLS Client", "dtls-client", 20000, "dtls-client");
|
||||
scheduleFuzzingRun(tls_fm_base, "DTLS Server", "dtls-server", 20000, "dtls-server");
|
||||
|
||||
return queue.submit();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
async function scheduleTestBuilds(base, args = "") {
|
||||
// Build base definition.
|
||||
let build = merge({
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && " +
|
||||
"nss/automation/taskcluster/scripts/build_gyp.sh -g -v --test --ct-verif " + args
|
||||
],
|
||||
artifacts: {
|
||||
public: {
|
||||
expires: 24 * 7,
|
||||
type: "directory",
|
||||
path: "/home/worker/artifacts"
|
||||
}
|
||||
},
|
||||
kind: "build",
|
||||
symbol: "B",
|
||||
name: "Linux 64 (debug, test)"
|
||||
}, base);
|
||||
|
||||
// The task that builds NSPR+NSS.
|
||||
let task_build = queue.scheduleTask(build);
|
||||
|
||||
// Schedule tests.
|
||||
queue.scheduleTask(merge(base, {
|
||||
parent: task_build,
|
||||
name: "mpi",
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_tests.sh"
|
||||
],
|
||||
tests: "mpi",
|
||||
cycle: "standard",
|
||||
symbol: "mpi",
|
||||
kind: "test"
|
||||
}));
|
||||
queue.scheduleTask(merge(base, {
|
||||
parent: task_build,
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_tests.sh"
|
||||
],
|
||||
name: "Gtests",
|
||||
symbol: "Gtest",
|
||||
tests: "gtests",
|
||||
cycle: "standard",
|
||||
kind: "test"
|
||||
}));
|
||||
|
||||
return queue.submit();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
async function scheduleWindows(name, base, build_script) {
|
||||
base = merge(base, {
|
||||
workerType: "nss-win2012r2",
|
||||
env: {
|
||||
PATH: "c:\\mozilla-build\\python;c:\\mozilla-build\\msys\\local\\bin;" +
|
||||
"c:\\mozilla-build\\7zip;c:\\mozilla-build\\info-zip;" +
|
||||
"c:\\mozilla-build\\python\\Scripts;c:\\mozilla-build\\yasm;" +
|
||||
"c:\\mozilla-build\\msys\\bin;c:\\Windows\\system32;" +
|
||||
"c:\\mozilla-build\\upx391w;c:\\mozilla-build\\moztools-x64\\bin;" +
|
||||
"c:\\mozilla-build\\wget",
|
||||
DOMSUF: "localdomain",
|
||||
HOST: "localhost",
|
||||
}
|
||||
});
|
||||
|
||||
// Build base definition.
|
||||
let build_base = merge(base, {
|
||||
command: [
|
||||
WINDOWS_CHECKOUT_CMD,
|
||||
`bash -c 'nss/automation/taskcluster/windows/${build_script}'`
|
||||
],
|
||||
artifacts: [{
|
||||
expires: 24 * 7,
|
||||
type: "directory",
|
||||
path: "public\\build"
|
||||
}],
|
||||
kind: "build",
|
||||
symbol: "B"
|
||||
});
|
||||
|
||||
// Make builds run FIPS tests, which need an extra FIPS build.
|
||||
if (base.collection == "make") {
|
||||
let extra_build = queue.scheduleTask(merge(build_base, {
|
||||
env: { NSS_FORCE_FIPS: "1" },
|
||||
group: "FIPS",
|
||||
name: `${name} w/ NSS_FORCE_FIPS`
|
||||
}));
|
||||
|
||||
// The task that generates certificates.
|
||||
let task_cert = queue.scheduleTask(merge(build_base, {
|
||||
name: "Certificates",
|
||||
command: [
|
||||
WINDOWS_CHECKOUT_CMD,
|
||||
"bash -c nss/automation/taskcluster/windows/gen_certs.sh"
|
||||
],
|
||||
parent: extra_build,
|
||||
symbol: "Certs-F",
|
||||
group: "FIPS",
|
||||
}));
|
||||
|
||||
// Schedule FIPS tests.
|
||||
queue.scheduleTask(merge(base, {
|
||||
parent: task_cert,
|
||||
name: "FIPS",
|
||||
command: [
|
||||
WINDOWS_CHECKOUT_CMD,
|
||||
"bash -c nss/automation/taskcluster/windows/run_tests.sh"
|
||||
],
|
||||
cycle: "standard",
|
||||
kind: "test",
|
||||
name: "FIPS tests",
|
||||
symbol: "Tests-F",
|
||||
tests: "fips",
|
||||
group: "FIPS"
|
||||
}));
|
||||
}
|
||||
|
||||
// The task that builds NSPR+NSS.
|
||||
let task_build = queue.scheduleTask(merge(build_base, {name}));
|
||||
|
||||
// The task that generates certificates.
|
||||
let task_cert = queue.scheduleTask(merge(build_base, {
|
||||
name: "Certificates",
|
||||
command: [
|
||||
WINDOWS_CHECKOUT_CMD,
|
||||
"bash -c nss/automation/taskcluster/windows/gen_certs.sh"
|
||||
],
|
||||
parent: task_build,
|
||||
symbol: "Certs"
|
||||
}));
|
||||
|
||||
// Schedule tests.
|
||||
scheduleTests(task_build, task_cert, merge(base, {
|
||||
command: [
|
||||
WINDOWS_CHECKOUT_CMD,
|
||||
"bash -c nss/automation/taskcluster/windows/run_tests.sh"
|
||||
]
|
||||
}));
|
||||
|
||||
return queue.submit();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
function scheduleTests(task_build, task_cert, test_base) {
|
||||
test_base = merge({kind: "test"}, test_base);
|
||||
|
||||
// Schedule tests that do NOT need certificates.
|
||||
let no_cert_base = merge(test_base, {parent: task_build});
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "Gtests", symbol: "Gtest", tests: "ssl_gtests gtests", cycle: "standard"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "Bogo tests", symbol: "Bogo", tests: "bogo", cycle: "standard"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "Interop tests", symbol: "Interop", tests: "interop", cycle: "standard"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "Chains tests", symbol: "Chains", tests: "chains"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "Cipher tests", symbol: "Default", tests: "cipher", group: "Cipher"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "Cipher tests", symbol: "NoAESNI", tests: "cipher",
|
||||
env: {NSS_DISABLE_HW_AES: "1"}, group: "Cipher"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "Cipher tests", symbol: "NoPCLMUL", tests: "cipher",
|
||||
env: {NSS_DISABLE_PCLMUL: "1"}, group: "Cipher"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "Cipher tests", symbol: "NoAVX", tests: "cipher",
|
||||
env: {NSS_DISABLE_AVX: "1"}, group: "Cipher"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "EC tests", symbol: "EC", tests: "ec"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "Lowhash tests", symbol: "Lowhash", tests: "lowhash"
|
||||
}));
|
||||
queue.scheduleTask(merge(no_cert_base, {
|
||||
name: "SDR tests", symbol: "SDR", tests: "sdr"
|
||||
}));
|
||||
|
||||
// Schedule tests that need certificates.
|
||||
let cert_base = merge(test_base, {parent: task_cert});
|
||||
queue.scheduleTask(merge(cert_base, {
|
||||
name: "CRMF tests", symbol: "CRMF", tests: "crmf"
|
||||
}));
|
||||
queue.scheduleTask(merge(cert_base, {
|
||||
name: "DB tests", symbol: "DB", tests: "dbtests"
|
||||
}));
|
||||
queue.scheduleTask(merge(cert_base, {
|
||||
name: "Merge tests", symbol: "Merge", tests: "merge"
|
||||
}));
|
||||
queue.scheduleTask(merge(cert_base, {
|
||||
name: "S/MIME tests", symbol: "SMIME", tests: "smime"
|
||||
}));
|
||||
queue.scheduleTask(merge(cert_base, {
|
||||
name: "Tools tests", symbol: "Tools", tests: "tools"
|
||||
}));
|
||||
|
||||
// SSL tests, need certificates too.
|
||||
let ssl_base = merge(cert_base, {tests: "ssl", group: "SSL"});
|
||||
queue.scheduleTask(merge(ssl_base, {
|
||||
name: "SSL tests (standard)", symbol: "standard", cycle: "standard"
|
||||
}));
|
||||
queue.scheduleTask(merge(ssl_base, {
|
||||
name: "SSL tests (pkix)", symbol: "pkix", cycle: "pkix"
|
||||
}));
|
||||
queue.scheduleTask(merge(ssl_base, {
|
||||
name: "SSL tests (sharedb)", symbol: "sharedb", cycle: "sharedb"
|
||||
}));
|
||||
queue.scheduleTask(merge(ssl_base, {
|
||||
name: "SSL tests (upgradedb)", symbol: "upgradedb", cycle: "upgradedb"
|
||||
}));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
async function scheduleTools() {
|
||||
let base = {
|
||||
platform: "nss-tools",
|
||||
kind: "test"
|
||||
};
|
||||
|
||||
queue.scheduleTask(merge(base, {
|
||||
symbol: "clang-format-3.9",
|
||||
name: "clang-format-3.9",
|
||||
image: LINUX_CLANG39_IMAGE,
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/clang-format/run_clang_format.sh"
|
||||
]
|
||||
}));
|
||||
|
||||
queue.scheduleTask(merge(base, {
|
||||
symbol: "scan-build-4.0",
|
||||
name: "scan-build-4.0",
|
||||
image: LINUX_IMAGE,
|
||||
env: {
|
||||
USE_64: "1",
|
||||
CC: "clang",
|
||||
CCC: "clang++",
|
||||
},
|
||||
artifacts: {
|
||||
public: {
|
||||
expires: 24 * 7,
|
||||
type: "directory",
|
||||
path: "/home/worker/artifacts"
|
||||
}
|
||||
},
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_scan_build.sh"
|
||||
]
|
||||
}));
|
||||
|
||||
queue.scheduleTask(merge(base, {
|
||||
symbol: "hacl",
|
||||
name: "hacl",
|
||||
image: HACL_GEN_IMAGE,
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_hacl.sh"
|
||||
]
|
||||
}));
|
||||
|
||||
return queue.submit();
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/* 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/. */
|
||||
|
||||
import * as queue from "./queue";
|
||||
import context_hash from "./context_hash";
|
||||
import taskcluster from "taskcluster-client";
|
||||
|
||||
async function taskHasImageArtifact(taskId) {
|
||||
let queue = new taskcluster.Queue();
|
||||
let {artifacts} = await queue.listLatestArtifacts(taskId);
|
||||
return artifacts.some(artifact => artifact.name == "public/image.tar");
|
||||
}
|
||||
|
||||
async function findTaskWithImageArtifact(ns) {
|
||||
let index = new taskcluster.Index();
|
||||
let {taskId} = await index.findTask(ns);
|
||||
let has_image = await taskHasImageArtifact(taskId);
|
||||
return has_image ? taskId : null;
|
||||
}
|
||||
|
||||
export async function findTask({name, path}) {
|
||||
let hash = await context_hash(path);
|
||||
let ns = `docker.images.v1.${process.env.TC_PROJECT}.${name}.hash.${hash}`;
|
||||
return findTaskWithImageArtifact(ns).catch(() => null);
|
||||
}
|
||||
|
||||
export async function buildTask({name, path}) {
|
||||
let hash = await context_hash(path);
|
||||
let ns = `docker.images.v1.${process.env.TC_PROJECT}.${name}.hash.${hash}`;
|
||||
|
||||
return {
|
||||
name: "Image Builder",
|
||||
image: "nssdev/image_builder:0.1.5",
|
||||
routes: ["index." + ns],
|
||||
env: {
|
||||
NSS_HEAD_REPOSITORY: process.env.NSS_HEAD_REPOSITORY,
|
||||
NSS_HEAD_REVISION: process.env.NSS_HEAD_REVISION,
|
||||
PROJECT: process.env.TC_PROJECT,
|
||||
CONTEXT_PATH: path,
|
||||
HASH: hash
|
||||
},
|
||||
artifacts: {
|
||||
"public/image.tar": {
|
||||
type: "file",
|
||||
expires: 24 * 90,
|
||||
path: "/artifacts/image.tar"
|
||||
}
|
||||
},
|
||||
command: [
|
||||
"/bin/bash",
|
||||
"-c",
|
||||
"bin/checkout.sh && nss/automation/taskcluster/scripts/build_image.sh"
|
||||
],
|
||||
platform: "nss-decision",
|
||||
features: ["dind"],
|
||||
maxRunTime: 7200,
|
||||
kind: "build",
|
||||
symbol: "I"
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/* 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/. */
|
||||
|
||||
import * as try_syntax from "./try_syntax";
|
||||
import extend from "./extend";
|
||||
|
||||
// Init try syntax filter.
|
||||
if (process.env.TC_PROJECT == "nss-try") {
|
||||
try_syntax.initFilter();
|
||||
}
|
||||
|
||||
// Extend the task graph.
|
||||
extend().catch(console.error);
|
||||
@@ -0,0 +1,10 @@
|
||||
/* 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/. */
|
||||
|
||||
import {recursive as merge} from "merge";
|
||||
|
||||
// We always want to clone.
|
||||
export default function (...args) {
|
||||
return merge(true, ...args);
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
/* 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/. */
|
||||
|
||||
import {clone} from "merge";
|
||||
import merge from "./merge";
|
||||
import slugid from "slugid";
|
||||
import taskcluster from "taskcluster-client";
|
||||
import * as image_builder from "./image_builder";
|
||||
|
||||
let maps = [];
|
||||
let filters = [];
|
||||
|
||||
let tasks = new Map();
|
||||
let image_tasks = new Map();
|
||||
|
||||
let queue = new taskcluster.Queue({
|
||||
baseUrl: "http://taskcluster/queue/v1"
|
||||
});
|
||||
|
||||
function fromNow(hours) {
|
||||
let d = new Date();
|
||||
d.setHours(d.getHours() + (hours|0));
|
||||
return d.toJSON();
|
||||
}
|
||||
|
||||
function parseRoutes(routes) {
|
||||
let rv = [
|
||||
`tc-treeherder.v2.${process.env.TC_PROJECT}.${process.env.NSS_HEAD_REVISION}.${process.env.NSS_PUSHLOG_ID}`,
|
||||
...routes
|
||||
];
|
||||
|
||||
// Notify about failures (except on try).
|
||||
if (process.env.TC_PROJECT != "nss-try") {
|
||||
rv.push(`notify.email.${process.env.TC_OWNER}.on-failed`,
|
||||
`notify.email.${process.env.TC_OWNER}.on-exception`);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
function parseFeatures(list) {
|
||||
return list.reduce((map, feature) => {
|
||||
map[feature] = true;
|
||||
return map;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function parseArtifacts(artifacts) {
|
||||
let copy = clone(artifacts);
|
||||
Object.keys(copy).forEach(key => {
|
||||
copy[key].expires = fromNow(copy[key].expires);
|
||||
});
|
||||
return copy;
|
||||
}
|
||||
|
||||
function parseCollection(name) {
|
||||
let collection = {};
|
||||
collection[name] = true;
|
||||
return collection;
|
||||
}
|
||||
|
||||
function parseTreeherder(def) {
|
||||
let treeherder = {
|
||||
build: {
|
||||
platform: def.platform
|
||||
},
|
||||
machine: {
|
||||
platform: def.platform
|
||||
},
|
||||
symbol: def.symbol,
|
||||
jobKind: def.kind
|
||||
};
|
||||
|
||||
if (def.group) {
|
||||
treeherder.groupSymbol = def.group;
|
||||
}
|
||||
|
||||
if (def.collection) {
|
||||
treeherder.collection = parseCollection(def.collection);
|
||||
}
|
||||
|
||||
if (def.tier) {
|
||||
treeherder.tier = def.tier;
|
||||
}
|
||||
|
||||
return treeherder;
|
||||
}
|
||||
|
||||
function convertTask(def) {
|
||||
let scopes = [];
|
||||
let dependencies = [];
|
||||
|
||||
let env = merge({
|
||||
NSS_HEAD_REPOSITORY: process.env.NSS_HEAD_REPOSITORY,
|
||||
NSS_HEAD_REVISION: process.env.NSS_HEAD_REVISION
|
||||
}, def.env || {});
|
||||
|
||||
if (def.parent) {
|
||||
dependencies.push(def.parent);
|
||||
env.TC_PARENT_TASK_ID = def.parent;
|
||||
}
|
||||
|
||||
if (def.tests) {
|
||||
env.NSS_TESTS = def.tests;
|
||||
}
|
||||
|
||||
if (def.cycle) {
|
||||
env.NSS_CYCLES = def.cycle;
|
||||
}
|
||||
|
||||
let payload = {
|
||||
env,
|
||||
command: def.command,
|
||||
maxRunTime: def.maxRunTime || 3600
|
||||
};
|
||||
|
||||
if (def.image) {
|
||||
payload.image = def.image;
|
||||
}
|
||||
|
||||
if (def.artifacts) {
|
||||
payload.artifacts = parseArtifacts(def.artifacts);
|
||||
}
|
||||
|
||||
if (def.features) {
|
||||
payload.features = parseFeatures(def.features);
|
||||
|
||||
if (payload.features.allowPtrace) {
|
||||
scopes.push("docker-worker:feature:allowPtrace");
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
provisionerId: def.provisioner || "aws-provisioner-v1",
|
||||
workerType: def.workerType || "hg-worker",
|
||||
schedulerId: "task-graph-scheduler",
|
||||
|
||||
scopes,
|
||||
created: fromNow(0),
|
||||
deadline: fromNow(24),
|
||||
|
||||
dependencies,
|
||||
routes: parseRoutes(def.routes || []),
|
||||
|
||||
metadata: {
|
||||
name: def.name,
|
||||
description: def.name,
|
||||
owner: process.env.TC_OWNER,
|
||||
source: process.env.TC_SOURCE
|
||||
},
|
||||
|
||||
payload,
|
||||
|
||||
extra: {
|
||||
treeherder: parseTreeherder(def)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function map(fun) {
|
||||
maps.push(fun);
|
||||
}
|
||||
|
||||
export function filter(fun) {
|
||||
filters.push(fun);
|
||||
}
|
||||
|
||||
export function scheduleTask(def) {
|
||||
let taskId = slugid.v4();
|
||||
tasks.set(taskId, merge({}, def));
|
||||
return taskId;
|
||||
}
|
||||
|
||||
export async function submit() {
|
||||
let promises = new Map();
|
||||
|
||||
for (let [taskId, task] of tasks) {
|
||||
// Allow filtering tasks before we schedule them.
|
||||
if (!filters.every(filter => filter(task))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Allow changing tasks before we schedule them.
|
||||
maps.forEach(map => { task = map(merge({}, task)) });
|
||||
|
||||
let log_id = `${task.name} @ ${task.platform}[${task.collection || "opt"}]`;
|
||||
console.log(`+ Submitting ${log_id}.`);
|
||||
|
||||
let parent = task.parent;
|
||||
|
||||
// Convert the task definition.
|
||||
task = await convertTask(task);
|
||||
|
||||
// Convert the docker image definition.
|
||||
let image_def = task.payload.image;
|
||||
if (image_def && image_def.hasOwnProperty("path")) {
|
||||
let key = `${image_def.name}:${image_def.path}`;
|
||||
let data = {};
|
||||
|
||||
// Check the cache first.
|
||||
if (image_tasks.has(key)) {
|
||||
data = image_tasks.get(key);
|
||||
} else {
|
||||
data.taskId = await image_builder.findTask(image_def);
|
||||
data.isPending = !data.taskId;
|
||||
|
||||
// No task found.
|
||||
if (data.isPending) {
|
||||
let image_task = await image_builder.buildTask(image_def);
|
||||
|
||||
// Schedule a new image builder task immediately.
|
||||
data.taskId = slugid.v4();
|
||||
|
||||
try {
|
||||
await queue.createTask(data.taskId, convertTask(image_task));
|
||||
} catch (e) {
|
||||
console.error("! FAIL: Scheduling image builder task failed.");
|
||||
continue; /* Skip this task on failure. */
|
||||
}
|
||||
}
|
||||
|
||||
// Store in cache.
|
||||
image_tasks.set(key, data);
|
||||
}
|
||||
|
||||
if (data.isPending) {
|
||||
task.dependencies.push(data.taskId);
|
||||
}
|
||||
|
||||
task.payload.image = {
|
||||
path: "public/image.tar",
|
||||
taskId: data.taskId,
|
||||
type: "task-image"
|
||||
};
|
||||
}
|
||||
|
||||
// Wait for the parent task to be created before scheduling dependants.
|
||||
let predecessor = parent ? promises.get(parent) : Promise.resolve();
|
||||
|
||||
promises.set(taskId, predecessor.then(() => {
|
||||
// Schedule the task.
|
||||
return queue.createTask(taskId, task).catch(err => {
|
||||
console.error(`! FAIL: Scheduling ${log_id} failed.`, err);
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
// Wait for all requests to finish.
|
||||
if (promises.length) {
|
||||
await Promise.all([...promises.values()]);
|
||||
console.log("=== Total:", promises.length, "tasks. ===");
|
||||
}
|
||||
|
||||
tasks.clear();
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
/* 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/. */
|
||||
|
||||
import * as queue from "./queue";
|
||||
import intersect from "intersect";
|
||||
import parse_args from "minimist";
|
||||
|
||||
function parseOptions(opts) {
|
||||
opts = parse_args(opts.split(/\s+/), {
|
||||
default: {build: "do", platform: "all", unittests: "none", tools: "none"},
|
||||
alias: {b: "build", p: "platform", u: "unittests", t: "tools", e: "extra-builds"},
|
||||
string: ["build", "platform", "unittests", "tools", "extra-builds"]
|
||||
});
|
||||
|
||||
// Parse build types (d=debug, o=opt).
|
||||
let builds = intersect(opts.build.split(""), ["d", "o"]);
|
||||
|
||||
// If the given value is nonsense default to debug and opt builds.
|
||||
if (builds.length == 0) {
|
||||
builds = ["d", "o"];
|
||||
}
|
||||
|
||||
// Parse platforms.
|
||||
let allPlatforms = ["linux", "linux64", "linux64-asan", "linux64-fips",
|
||||
"win", "win64", "win-make", "win64-make",
|
||||
"linux64-make", "linux-make", "linux-fuzz",
|
||||
"linux64-fuzz", "aarch64", "mac"];
|
||||
let platforms = intersect(opts.platform.split(/\s*,\s*/), allPlatforms);
|
||||
|
||||
// If the given value is nonsense or "none" default to all platforms.
|
||||
if (platforms.length == 0 && opts.platform != "none") {
|
||||
platforms = allPlatforms;
|
||||
}
|
||||
|
||||
// Parse unit tests.
|
||||
let aliases = {"gtests": "gtest"};
|
||||
let allUnitTests = ["bogo", "crmf", "chains", "cipher", "db", "ec", "fips",
|
||||
"gtest", "interop", "lowhash", "merge", "sdr", "smime", "tools",
|
||||
"ssl", "mpi", "scert", "spki"];
|
||||
let unittests = intersect(opts.unittests.split(/\s*,\s*/).map(t => {
|
||||
return aliases[t] || t;
|
||||
}), allUnitTests);
|
||||
|
||||
// If the given value is "all" run all tests.
|
||||
// If it's nonsense then don't run any tests.
|
||||
if (opts.unittests == "all") {
|
||||
unittests = allUnitTests;
|
||||
} else if (unittests.length == 0) {
|
||||
unittests = [];
|
||||
}
|
||||
|
||||
// Parse tools.
|
||||
let allTools = ["clang-format", "scan-build", "hacl"];
|
||||
let tools = intersect(opts.tools.split(/\s*,\s*/), allTools);
|
||||
|
||||
// If the given value is "all" run all tools.
|
||||
// If it's nonsense then don't run any tools.
|
||||
if (opts.tools == "all") {
|
||||
tools = allTools;
|
||||
} else if (tools.length == 0) {
|
||||
tools = [];
|
||||
}
|
||||
|
||||
return {
|
||||
builds: builds,
|
||||
platforms: platforms,
|
||||
unittests: unittests,
|
||||
extra: (opts.e == "all"),
|
||||
tools: tools
|
||||
};
|
||||
}
|
||||
|
||||
function filter(opts) {
|
||||
return function (task) {
|
||||
// Filter tools. We can immediately return here as those
|
||||
// are not affected by platform or build type selectors.
|
||||
if (task.platform == "nss-tools") {
|
||||
return opts.tools.some(tool => {
|
||||
return task.symbol.toLowerCase().startsWith(tool);
|
||||
});
|
||||
}
|
||||
|
||||
// Filter unit tests.
|
||||
if (task.tests) {
|
||||
let found = opts.unittests.some(test => {
|
||||
if (task.group && task.group.toLowerCase() == "ssl" && test == "ssl") {
|
||||
return true;
|
||||
}
|
||||
if (task.group && task.group.toLowerCase() == "cipher" && test == "cipher") {
|
||||
return true;
|
||||
}
|
||||
return task.symbol.toLowerCase().startsWith(test);
|
||||
});
|
||||
|
||||
if (!found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Filter extra builds.
|
||||
if (task.group == "Builds" && !opts.extra) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let coll = name => name == (task.collection || "opt");
|
||||
|
||||
// Filter by platform.
|
||||
let found = opts.platforms.some(platform => {
|
||||
let aliases = {
|
||||
"linux": "linux32",
|
||||
"linux-fuzz": "linux32",
|
||||
"linux64-asan": "linux64",
|
||||
"linux64-fips": "linux64",
|
||||
"linux64-fuzz": "linux64",
|
||||
"linux64-make": "linux64",
|
||||
"linux-make": "linux32",
|
||||
"win64-make": "windows2012-64",
|
||||
"win-make": "windows2012-32",
|
||||
"win64": "windows2012-64",
|
||||
"win": "windows2012-32"
|
||||
};
|
||||
|
||||
// Check the platform name.
|
||||
let keep = (task.platform == (aliases[platform] || platform));
|
||||
|
||||
// Additional checks.
|
||||
if (platform == "linux64-asan") {
|
||||
keep &= coll("asan");
|
||||
} else if (platform == "linux64-fips") {
|
||||
keep &= coll("fips");
|
||||
} else if (platform == "linux64-make" || platform == "linux-make" ||
|
||||
platform == "win64-make" || platform == "win-make") {
|
||||
keep &= coll("make");
|
||||
} else if (platform == "linux64-fuzz" || platform == "linux-fuzz") {
|
||||
keep &= coll("fuzz");
|
||||
} else {
|
||||
keep &= coll("opt") || coll("debug");
|
||||
}
|
||||
|
||||
return keep;
|
||||
});
|
||||
|
||||
if (!found) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Finally, filter by build type.
|
||||
let isDebug = coll("debug") || coll("asan") || coll("make") ||
|
||||
coll("fuzz");
|
||||
return (isDebug && opts.builds.includes("d")) ||
|
||||
(!isDebug && opts.builds.includes("o"));
|
||||
}
|
||||
}
|
||||
|
||||
export function initFilter() {
|
||||
let comment = process.env.TC_COMMENT || "";
|
||||
|
||||
// Check for try syntax in changeset comment.
|
||||
let match = comment.match(/^\s*try:\s*(.*)\s*$/);
|
||||
|
||||
// Add try syntax filter.
|
||||
if (match) {
|
||||
queue.filter(filter(parseOptions(match[1])));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
FROM ubuntu:16.04
|
||||
MAINTAINER Tim Taubert <ttaubert@mozilla.com>
|
||||
|
||||
WORKDIR /home/worker
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y apt-transport-https apt-utils
|
||||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 && \
|
||||
sh -c "echo deb https://get.docker.io/ubuntu docker main \
|
||||
> /etc/apt/sources.list.d/docker.list"
|
||||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 41BD8711B1F0EC2B0D85B91CF59CE3A8323293EE && \
|
||||
sh -c "echo deb http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu xenial main \
|
||||
> /etc/apt/sources.list.d/mercurial.list"
|
||||
RUN apt-get update && apt-get install -y \
|
||||
lxc-docker-1.6.1 \
|
||||
mercurial
|
||||
|
||||
ADD bin /home/worker/bin
|
||||
RUN chmod +x /home/worker/bin/*
|
||||
|
||||
# Set a default command useful for debugging
|
||||
CMD ["/bin/bash", "--login"]
|
||||
@@ -0,0 +1 @@
|
||||
0.1.5
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Default values for testing.
|
||||
REVISION=${NSS_HEAD_REVISION:-default}
|
||||
REPOSITORY=${NSS_HEAD_REPOSITORY:-https://hg.mozilla.org/projects/nss}
|
||||
|
||||
# Clone NSS.
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r $REVISION $REPOSITORY nss && exit 0
|
||||
rm -rf nss
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $(dirname "$0")/tools.sh
|
||||
|
||||
if [ -n "$NSS_BUILD_MODULAR" ]; then
|
||||
$(dirname "$0")/build_nspr.sh || exit $?
|
||||
$(dirname "$0")/build_util.sh || exit $?
|
||||
$(dirname "$0")/build_softoken.sh || exit $?
|
||||
$(dirname "$0")/build_nss.sh || exit $?
|
||||
exit
|
||||
fi
|
||||
|
||||
# Clone NSPR if needed.
|
||||
hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
|
||||
|
||||
# Build.
|
||||
make -C nss nss_build_all
|
||||
|
||||
# Package.
|
||||
mkdir artifacts
|
||||
tar cvfjh artifacts/dist.tar.bz2 dist
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $(dirname "$0")/tools.sh
|
||||
|
||||
# Clone NSPR if needed.
|
||||
hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
|
||||
|
||||
# Build.
|
||||
nss/build.sh -g -v "$@"
|
||||
|
||||
# Package.
|
||||
if [[ $(uname) = "Darwin" ]]; then
|
||||
mkdir -p public
|
||||
tar cvfjh public/dist.tar.bz2 dist
|
||||
else
|
||||
mkdir artifacts
|
||||
tar cvfjh artifacts/dist.tar.bz2 dist
|
||||
fi
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash -vex
|
||||
|
||||
set -x -e -v
|
||||
|
||||
# Prefix errors with taskcluster error prefix so that they are parsed by Treeherder
|
||||
raise_error() {
|
||||
echo
|
||||
echo "[taskcluster-image-build:error] $1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Ensure that the PROJECT is specified so the image can be indexed
|
||||
test -n "$PROJECT" || raise_error "Project must be provided."
|
||||
test -n "$HASH" || raise_error "Context Hash must be provided."
|
||||
|
||||
CONTEXT_PATH=/home/worker/nss/$CONTEXT_PATH
|
||||
|
||||
test -d $CONTEXT_PATH || raise_error "Context Path $CONTEXT_PATH does not exist."
|
||||
test -f "$CONTEXT_PATH/Dockerfile" || raise_error "Dockerfile must be present in $CONTEXT_PATH."
|
||||
|
||||
docker build -t $PROJECT:$HASH $CONTEXT_PATH
|
||||
|
||||
mkdir /artifacts
|
||||
docker save $PROJECT:$HASH > /artifacts/image.tar
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
source $(dirname $0)/tools.sh
|
||||
|
||||
# Clone NSPR if needed.
|
||||
hg_clone https://hg.mozilla.org/projects/nspr nspr default
|
||||
|
||||
# Build.
|
||||
rm -rf dist
|
||||
make -C nss build_nspr
|
||||
|
||||
# Package.
|
||||
test -d artifacts || mkdir artifacts
|
||||
rm -rf dist-nspr
|
||||
mv dist dist-nspr
|
||||
tar cvfjh artifacts/dist-nspr.tar.bz2 dist-nspr
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
source $(dirname $0)/tools.sh
|
||||
source $(dirname $0)/split.sh
|
||||
|
||||
test -d dist-softoken || { echo "run build_softoken.sh first" 1>&2; exit 1; }
|
||||
|
||||
rm -rf nss-nss
|
||||
split_nss nss nss-nss
|
||||
|
||||
# Build.
|
||||
export NSS_BUILD_WITHOUT_SOFTOKEN=1
|
||||
export NSS_USE_SYSTEM_FREEBL=1
|
||||
|
||||
platform=`make -s -C nss platform`
|
||||
|
||||
export NSPR_LIB_DIR="$PWD/dist-nspr/$platform/lib"
|
||||
export NSSUTIL_LIB_DIR="$PWD/dist-util/$platform/lib"
|
||||
export FREEBL_LIB_DIR="$PWD/dist-softoken/$platform/lib"
|
||||
export SOFTOKEN_LIB_DIR="$PWD/dist-softoken/$platform/lib"
|
||||
export FREEBL_LIBS=-lfreebl
|
||||
|
||||
export NSS_NO_PKCS11_BYPASS=1
|
||||
export FREEBL_NO_DEPEND=1
|
||||
|
||||
export LIBRARY_PATH="$PWD/dist-nspr/$platform/lib:$PWD/dist-util/$platform/lib:$PWD/dist-softoken/$platform/lib"
|
||||
export LD_LIBRARY_PATH="$LIBRARY_PATH:$LD_LIBRARY_PATH"
|
||||
export INCLUDES="-I$PWD/dist-nspr/$platform/include -I$PWD/dist-util/public/nss -I$PWD/dist-softoken/public/nss"
|
||||
|
||||
rm -rf dist
|
||||
make -C nss-nss nss_build_all
|
||||
|
||||
# Package.
|
||||
test -d artifacts || mkdir artifacts
|
||||
rm -rf dist-nss
|
||||
mv dist dist-nss
|
||||
tar cvfjh artifacts/dist-nss.tar.bz2 dist-nss
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
source $(dirname $0)/tools.sh
|
||||
source $(dirname $0)/split.sh
|
||||
|
||||
test -d dist-util || { echo "run build_util.sh first" 1>&2; exit 1; }
|
||||
|
||||
rm -rf nss-softoken
|
||||
split_softoken nss nss-softoken
|
||||
|
||||
# Build.
|
||||
platform=`make -s -C nss platform`
|
||||
export LIBRARY_PATH="$PWD/dist-nspr/$platform/lib:$PWD/dist-util/$platform/lib"
|
||||
export LD_LIBRARY_PATH="$LIBRARY_PATH:$LD_LIBRARY_PATH"
|
||||
export INCLUDES="-I$PWD/dist-nspr/$platform/include -I$PWD/dist-util/public/nss"
|
||||
export NSS_BUILD_SOFTOKEN_ONLY=1
|
||||
|
||||
rm -rf dist
|
||||
make -C nss-softoken nss_build_all
|
||||
|
||||
mv dist/private/nss/blapi.h dist/public/nss
|
||||
mv dist/private/nss/alghmac.h dist/public/nss
|
||||
|
||||
# Package.
|
||||
test -d artifacts || mkdir artifacts
|
||||
rm -rf dist-softoken
|
||||
mv dist dist-softoken
|
||||
tar cvfjh artifacts/dist-softoken.tar.bz2 dist-softoken
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
source $(dirname $0)/tools.sh
|
||||
source $(dirname $0)/split.sh
|
||||
|
||||
rm -rf nss-util
|
||||
split_util nss nss-util
|
||||
|
||||
# Build.
|
||||
platform=`make -s -C nss platform`
|
||||
export LIBRARY_PATH="$PWD/dist-nspr/$platform/lib"
|
||||
export LD_LIBRARY_PATH="$LIBRARY_PATH:$LD_LIBRARY_PATH"
|
||||
export INCLUDES="-I$PWD/dist-nspr/$platform/include"
|
||||
export NSS_BUILD_UTIL_ONLY=1
|
||||
|
||||
rm -rf dist
|
||||
make -C nss-util nss_build_all
|
||||
|
||||
# Package.
|
||||
test -d artifacts || mkdir artifacts
|
||||
rm -rf dist-util
|
||||
mv dist dist-util
|
||||
tar cvfjh artifacts/dist-util.tar.bz2 dist-util
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $(dirname "$0")/tools.sh
|
||||
|
||||
mkdir -p /home/worker/artifacts
|
||||
|
||||
# Install Node.JS dependencies.
|
||||
cd nss/automation/taskcluster/graph/ && npm install
|
||||
|
||||
# Extend the task graph.
|
||||
node lib/index.js
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $(dirname "$0")/tools.sh
|
||||
|
||||
type="$1"
|
||||
shift
|
||||
|
||||
# Fetch artifact if needed.
|
||||
fetch_dist
|
||||
|
||||
# Clone corpus.
|
||||
./nss/fuzz/config/clone_corpus.sh
|
||||
|
||||
# Ensure we have a corpus.
|
||||
if [ ! -d "nss/fuzz/corpus/$type" ]; then
|
||||
mkdir -p nss/fuzz/corpus/$type
|
||||
|
||||
set +x
|
||||
|
||||
# Create a corpus out of what we have.
|
||||
for f in $(find nss/fuzz/corpus -type f); do
|
||||
cp $f "nss/fuzz/corpus/$type"
|
||||
done
|
||||
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Fetch objdir name.
|
||||
objdir=$(cat dist/latest)
|
||||
|
||||
# Run nssfuzz.
|
||||
dist/$objdir/bin/nssfuzz-"$type" "$@"
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $(dirname "$0")/tools.sh
|
||||
|
||||
# Fetch artifact if needed.
|
||||
fetch_dist
|
||||
|
||||
# Generate certificates.
|
||||
NSS_TESTS=cert NSS_CYCLES="standard pkix sharedb" $(dirname $0)/run_tests.sh
|
||||
|
||||
# Reset test counter so that test runs pick up our certificates.
|
||||
echo 1 > tests_results/security/localhost
|
||||
|
||||
# Package.
|
||||
if [[ $(uname) = "Darwin" ]]; then
|
||||
mkdir -p public
|
||||
tar cvfjh public/dist.tar.bz2 dist tests_results
|
||||
else
|
||||
mkdir artifacts
|
||||
tar cvfjh artifacts/dist.tar.bz2 dist tests_results
|
||||
fi
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ $(id -u) -eq 0 ]]; then
|
||||
# Drop privileges by re-running this script.
|
||||
# Note: this mangles arguments, better to avoid running scripts as root.
|
||||
exec su worker -c "$0 $*"
|
||||
fi
|
||||
|
||||
set -e -x -v
|
||||
|
||||
# The docker image this is running in has the HACL* and NSS sources.
|
||||
# The extracted C code from HACL* is already generated and the HACL* tests were
|
||||
# successfully executed.
|
||||
|
||||
# Verify Poly1305 (doesn't work in docker image build)
|
||||
make verify -C ~/hacl-star/code/poly1305 -j$(nproc)
|
||||
|
||||
# Add license header to specs
|
||||
spec_files=($(find ~/hacl-star/specs -type f -name '*.fst'))
|
||||
for f in "${spec_files[@]}"; do
|
||||
cat /tmp/license.txt "$f" > /tmp/tmpfile && mv /tmp/tmpfile "$f"
|
||||
done
|
||||
|
||||
# Format the extracted C code.
|
||||
cd ~/hacl-star/snapshots/nss
|
||||
cp ~/nss/.clang-format .
|
||||
find . -type f -name '*.[ch]' -exec clang-format -i {} \+
|
||||
|
||||
# These diff commands will return 1 if there are differences and stop the script.
|
||||
files=($(find ~/nss/lib/freebl/verified/ -type f -name '*.[ch]'))
|
||||
for f in "${files[@]}"; do
|
||||
diff $f $(basename "$f")
|
||||
done
|
||||
|
||||
# Check that the specs didn't change either.
|
||||
cd ~/hacl-star/specs
|
||||
files=($(find ~/nss/lib/freebl/verified/specs -type f))
|
||||
for f in "${files[@]}"; do
|
||||
diff $f $(basename "$f")
|
||||
done
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $(dirname "$0")/tools.sh
|
||||
|
||||
# Clone NSPR if needed.
|
||||
if [ ! -d "nspr" ]; then
|
||||
hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
|
||||
fi
|
||||
|
||||
# Build.
|
||||
cd nss
|
||||
make nss_build_all
|
||||
|
||||
# What we want to scan.
|
||||
# key: directory to scan
|
||||
# value: number of errors expected in that directory
|
||||
declare -A scan=( \
|
||||
[lib/base]=0 \
|
||||
[lib/certdb]=0 \
|
||||
[lib/certhigh]=0 \
|
||||
[lib/ckfw]=0 \
|
||||
[lib/crmf]=0 \
|
||||
[lib/cryptohi]=0 \
|
||||
[lib/dev]=0 \
|
||||
[lib/freebl]=0 \
|
||||
[lib/nss]=0 \
|
||||
[lib/ssl]=0 \
|
||||
[lib/util]=0 \
|
||||
)
|
||||
|
||||
# remove .OBJ directories to force a rebuild of just the select few
|
||||
for i in "${!scan[@]}"; do
|
||||
find "$i" -name "*.OBJ" -exec rm -rf {} \+
|
||||
done
|
||||
|
||||
# run scan-build (only building affected directories)
|
||||
scan-build -o /home/worker/artifacts --use-cc=$CC --use-c++=$CCC make nss_build_all && cd ..
|
||||
|
||||
# print errors we found
|
||||
set +v +x
|
||||
STATUS=0
|
||||
for i in "${!scan[@]}"; do
|
||||
n=$(grep -Rn "$i" /home/worker/artifacts/*/report-*.html | wc -l)
|
||||
if [ $n -ne ${scan[$i]} ]; then
|
||||
STATUS=1
|
||||
echo "$(date '+%T') WARNING - TEST-UNEXPECTED-FAIL: $i contains $n scan-build errors"
|
||||
elif [ $n -ne 0 ]; then
|
||||
echo "$(date '+%T') WARNING - TEST-EXPECTED-FAIL: $i contains $n scan-build errors"
|
||||
fi
|
||||
done
|
||||
exit $STATUS
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source $(dirname "$0")/tools.sh
|
||||
|
||||
# Fetch artifact if needed.
|
||||
fetch_dist
|
||||
|
||||
# Run tests.
|
||||
cd nss/tests && ./all.sh
|
||||
@@ -0,0 +1,148 @@
|
||||
copy_top()
|
||||
{
|
||||
srcdir_="$1"
|
||||
dstdir_="$2"
|
||||
files=`find "$srcdir_" -maxdepth 1 -mindepth 1 -type f`
|
||||
for f in $files; do
|
||||
cp -p "$f" "$dstdir_"
|
||||
done
|
||||
}
|
||||
|
||||
split_util() {
|
||||
nssdir="$1"
|
||||
dstdir="$2"
|
||||
|
||||
# Prepare a source tree only containing files to build nss-util:
|
||||
#
|
||||
# nss/dbm full directory
|
||||
# nss/coreconf full directory
|
||||
# nss top files only
|
||||
# nss/lib top files only
|
||||
# nss/lib/util full directory
|
||||
|
||||
# Copy everything.
|
||||
cp -R $nssdir $dstdir
|
||||
|
||||
# Remove subdirectories that we don't want.
|
||||
rm -rf $dstdir/cmd
|
||||
rm -rf $dstdir/lib
|
||||
rm -rf $dstdir/automation
|
||||
rm -rf $dstdir/doc
|
||||
|
||||
# Start with an empty cmd lib directories to be filled selectively.
|
||||
mkdir $dstdir/cmd
|
||||
cp $nssdir/cmd/Makefile $dstdir/cmd
|
||||
cp $nssdir/cmd/manifest.mn $dstdir/cmd
|
||||
cp $nssdir/cmd/platlibs.mk $dstdir/cmd
|
||||
cp $nssdir/cmd/platrules.mk $dstdir/cmd
|
||||
|
||||
# Copy some files at the top and the util subdirectory recursively.
|
||||
mkdir $dstdir/lib
|
||||
cp $nssdir/lib/Makefile $dstdir/lib
|
||||
cp $nssdir/lib/manifest.mn $dstdir/lib
|
||||
cp -R $nssdir/lib/util $dstdir/lib/util
|
||||
}
|
||||
|
||||
split_softoken() {
|
||||
nssdir="$1"
|
||||
dstdir="$2"
|
||||
|
||||
# Prepare a source tree only containing files to build nss-softoken:
|
||||
#
|
||||
# nss/dbm full directory
|
||||
# nss/coreconf full directory
|
||||
# nss top files only
|
||||
# nss/lib top files only
|
||||
# nss/lib/freebl full directory
|
||||
# nss/lib/softoken full directory
|
||||
# nss/lib/softoken/dbm full directory
|
||||
|
||||
# Copy everything.
|
||||
cp -R $nssdir $dstdir
|
||||
|
||||
# Skip gtests when building.
|
||||
sed '/^DIRS = /s/ cpputil gtests$//' $nssdir/manifest.mn > $dstdir/manifest.mn-t && mv $dstdir/manifest.mn-t $dstdir/manifest.mn
|
||||
|
||||
# Remove subdirectories that we don't want.
|
||||
rm -rf $dstdir/cmd
|
||||
rm -rf $dstdir/tests
|
||||
rm -rf $dstdir/lib
|
||||
rm -rf $dstdir/pkg
|
||||
rm -rf $dstdir/automation
|
||||
rm -rf $dstdir/gtests
|
||||
rm -rf $dstdir/cpputil
|
||||
rm -rf $dstdir/doc
|
||||
|
||||
# Start with an empty lib directory and copy only what we need.
|
||||
mkdir $dstdir/lib
|
||||
copy_top $nssdir/lib $dstdir/lib
|
||||
cp -R $nssdir/lib/dbm $dstdir/lib/dbm
|
||||
cp -R $nssdir/lib/freebl $dstdir/lib/freebl
|
||||
cp -R $nssdir/lib/softoken $dstdir/lib/softoken
|
||||
cp -R $nssdir/lib/sqlite $dstdir/lib/sqlite
|
||||
|
||||
mkdir $dstdir/cmd
|
||||
copy_top $nssdir/cmd $dstdir/cmd
|
||||
cp -R $nssdir/cmd/bltest $dstdir/cmd/bltest
|
||||
cp -R $nssdir/cmd/ecperf $dstdir/cmd/ecperf
|
||||
cp -R $nssdir/cmd/fbectest $dstdir/cmd/fbectest
|
||||
cp -R $nssdir/cmd/fipstest $dstdir/cmd/fipstest
|
||||
cp -R $nssdir/cmd/lib $dstdir/cmd/lib
|
||||
cp -R $nssdir/cmd/lowhashtest $dstdir/cmd/lowhashtest
|
||||
cp -R $nssdir/cmd/shlibsign $dstdir/cmd/shlibsign
|
||||
|
||||
mkdir $dstdir/tests
|
||||
copy_top $nssdir/tests $dstdir/tests
|
||||
|
||||
cp -R $nssdir/tests/cipher $dstdir/tests/cipher
|
||||
cp -R $nssdir/tests/common $dstdir/tests/common
|
||||
cp -R $nssdir/tests/ec $dstdir/tests/ec
|
||||
cp -R $nssdir/tests/lowhash $dstdir/tests/lowhash
|
||||
|
||||
cp $nssdir/lib/util/verref.h $dstdir/lib/freebl
|
||||
cp $nssdir/lib/util/verref.h $dstdir/lib/softoken
|
||||
cp $nssdir/lib/util/verref.h $dstdir/lib/softoken/legacydb
|
||||
}
|
||||
|
||||
split_nss() {
|
||||
nssdir="$1"
|
||||
dstdir="$2"
|
||||
|
||||
# Prepare a source tree only containing files to build nss:
|
||||
#
|
||||
# nss/dbm full directory
|
||||
# nss/coreconf full directory
|
||||
# nss top files only
|
||||
# nss/lib top files only
|
||||
# nss/lib/freebl full directory
|
||||
# nss/lib/softoken full directory
|
||||
# nss/lib/softoken/dbm full directory
|
||||
|
||||
# Copy everything.
|
||||
cp -R $nssdir $dstdir
|
||||
|
||||
# Remove subdirectories that we don't want.
|
||||
rm -rf $dstdir/lib/freebl
|
||||
rm -rf $dstdir/lib/softoken
|
||||
rm -rf $dstdir/lib/util
|
||||
rm -rf $dstdir/cmd/bltest
|
||||
rm -rf $dstdir/cmd/fipstest
|
||||
rm -rf $dstdir/cmd/rsaperf_low
|
||||
|
||||
# Copy these headers until the upstream bug is accepted
|
||||
# Upstream https://bugzilla.mozilla.org/show_bug.cgi?id=820207
|
||||
cp $nssdir/lib/softoken/lowkeyi.h $dstdir/cmd/rsaperf
|
||||
cp $nssdir/lib/softoken/lowkeyti.h $dstdir/cmd/rsaperf
|
||||
|
||||
# Copy verref.h which will be needed later during the build phase.
|
||||
cp $nssdir/lib/util/verref.h $dstdir/lib/ckfw/builtins/verref.h
|
||||
cp $nssdir/lib/util/verref.h $dstdir/lib/nss/verref.h
|
||||
cp $nssdir/lib/util/verref.h $dstdir/lib/smime/verref.h
|
||||
cp $nssdir/lib/util/verref.h $dstdir/lib/ssl/verref.h
|
||||
cp $nssdir/lib/util/templates.c $dstdir/lib/nss/templates.c
|
||||
|
||||
# FIXME: Skip util_gtest because it links with libnssutil.a. Note
|
||||
# that we can't use libnssutil3.so instead, because util_gtest
|
||||
# depends on internal symbols not exported from the shared library.
|
||||
sed '/ util_gtest \\/d' $dstdir/gtests/manifest.mn > $dstdir/gtests/manifest.mn-t && mv $dstdir/gtests/manifest.mn-t $dstdir/gtests/manifest.mn
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
if [[ $(id -u) -eq 0 ]]; then
|
||||
# Drop privileges by re-running this script.
|
||||
# Note: this mangles arguments, better to avoid running scripts as root.
|
||||
exec su worker -c "$0 $*"
|
||||
fi
|
||||
|
||||
# Usage: hg_clone repo dir [revision=@]
|
||||
hg_clone() {
|
||||
repo=$1
|
||||
dir=$2
|
||||
rev=${3:-@}
|
||||
if [ -d "$dir" ]; then
|
||||
hg pull -R "$dir" -ur "$rev" "$repo" && return
|
||||
rm -rf "$dir"
|
||||
fi
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r "$rev" "$repo" "$dir" && return
|
||||
rm -rf "$dir"
|
||||
done
|
||||
exit 1
|
||||
}
|
||||
|
||||
fetch_dist() {
|
||||
url=https://queue.taskcluster.net/v1/task/$TC_PARENT_TASK_ID/artifacts/public/dist.tar.bz2
|
||||
if [ ! -d "dist" ]; then
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
curl --retry 3 -Lo dist.tar.bz2 $url && tar xvjf dist.tar.bz2 && return
|
||||
rm -fr dist.tar.bz2 dist
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Set up the toolchain.
|
||||
if [ "$USE_64" = 1 ]; then
|
||||
source $(dirname $0)/setup64.sh
|
||||
else
|
||||
source $(dirname $0)/setup32.sh
|
||||
fi
|
||||
|
||||
# Clone NSPR.
|
||||
hg_clone https://hg.mozilla.org/projects/nspr nspr default
|
||||
|
||||
# Build.
|
||||
make -C nss nss_build_all
|
||||
|
||||
# Package.
|
||||
7z a public/build/dist.7z dist
|
||||
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Set up the toolchain.
|
||||
if [[ "$@" == *"-m32"* ]]; then
|
||||
source $(dirname $0)/setup32.sh
|
||||
else
|
||||
source $(dirname $0)/setup64.sh
|
||||
fi
|
||||
|
||||
# Install GYP.
|
||||
cd gyp
|
||||
python -m virtualenv test-env
|
||||
test-env/Scripts/python setup.py install
|
||||
test-env/Scripts/python -m pip install --upgrade pip
|
||||
test-env/Scripts/pip install --upgrade setuptools
|
||||
cd ..
|
||||
|
||||
export GYP_MSVS_OVERRIDE_PATH="${VSPATH}"
|
||||
export GYP_MSVS_VERSION="2015"
|
||||
export GYP="${PWD}/gyp/test-env/Scripts/gyp"
|
||||
|
||||
# Fool GYP.
|
||||
touch "${VSPATH}/VC/vcvarsall.bat"
|
||||
|
||||
# Clone NSPR.
|
||||
hg_clone https://hg.mozilla.org/projects/nspr nspr default
|
||||
|
||||
# Build with gyp.
|
||||
GYP=${GYP} ./nss/build.sh -g -v "$@"
|
||||
|
||||
# Package.
|
||||
7z a public/build/dist.7z dist
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Set up the toolchain.
|
||||
source $(dirname $0)/setup.sh
|
||||
|
||||
# Fetch artifact.
|
||||
wget -t 3 --retry-connrefused -w 5 --random-wait https://queue.taskcluster.net/v1/task/$TC_PARENT_TASK_ID/artifacts/public/build/dist.7z -O dist.7z
|
||||
7z x dist.7z
|
||||
|
||||
# Generate certificates.
|
||||
NSS_TESTS=cert NSS_CYCLES="standard pkix sharedb" nss/tests/all.sh
|
||||
|
||||
# Reset test counter so that test runs pick up our certificates.
|
||||
echo 1 > tests_results/security/localhost
|
||||
|
||||
# Package.
|
||||
7z a public/build/dist.7z dist tests_results
|
||||
@@ -0,0 +1,26 @@
|
||||
[
|
||||
{
|
||||
"version": "Visual Studio 2017 15.4.2 / SDK 10.0.15063.0",
|
||||
"size": 303146863,
|
||||
"digest": "18700889e6b5e81613b9cf57ce4e0d46a6ee45bb4c5c33bae2604a5275326128775b8a032a1eb178c5db973746d565340c4e36d98375789e1d5bd836ab16ba58",
|
||||
"algorithm": "sha512",
|
||||
"filename": "vs2017_15.4.2.zip",
|
||||
"unpack": true
|
||||
},
|
||||
{
|
||||
"version": "Ninja 1.7.1",
|
||||
"size": 184821,
|
||||
"digest": "e4f9a1ae624a2630e75264ba37d396d9c7407d6e6aea3763056210ba6e1387908bd31cf4037a6a3661a418e86c4d2761e0c333e6a3bd0d66549d2b0d72d3f43b",
|
||||
"algorithm": "sha512",
|
||||
"filename": "ninja171.zip",
|
||||
"unpack": true
|
||||
},
|
||||
{
|
||||
"size": 13063963,
|
||||
"visibility": "public",
|
||||
"digest": "47a19f8f863eab3414abab2b9e9bd901ab896c799b3d9254b456b2f59374b085b99de805e21069a0819f01eecb3f43f7e2395a8c644c04bcbfa5711261cca29d",
|
||||
"algorithm": "sha512",
|
||||
"filename": "gyp-2017-05-23.zip",
|
||||
"unpack": true
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
# Set up the toolchain.
|
||||
source $(dirname $0)/setup.sh
|
||||
|
||||
# Fetch artifact.
|
||||
wget -t 3 --retry-connrefused -w 5 --random-wait https://queue.taskcluster.net/v1/task/$TC_PARENT_TASK_ID/artifacts/public/build/dist.7z -O dist.7z
|
||||
7z x dist.7z
|
||||
|
||||
# Run tests.
|
||||
cd nss/tests && ./all.sh
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
export VSPATH="$(pwd)/vs2017_15.4.2"
|
||||
export NINJA_PATH="$(pwd)/ninja/bin"
|
||||
|
||||
export WINDOWSSDKDIR="${VSPATH}/SDK"
|
||||
export VS90COMNTOOLS="${VSPATH}/VC"
|
||||
export INCLUDE="${VSPATH}/VC/include:${VSPATH}/SDK/Include/10.0.15063.0/ucrt:${VSPATH}/SDK/Include/10.0.15063.0/shared:${VSPATH}/SDK/Include/10.0.15063.0/um"
|
||||
|
||||
# Usage: hg_clone repo dir [revision=@]
|
||||
hg_clone() {
|
||||
repo=$1
|
||||
dir=$2
|
||||
rev=${3:-@}
|
||||
for i in 0 2 5; do
|
||||
sleep $i
|
||||
hg clone -r "$rev" "$repo" "$dir" && return
|
||||
rm -rf "$dir"
|
||||
done
|
||||
exit 1
|
||||
}
|
||||
|
||||
hg_clone https://hg.mozilla.org/build/tools tools default
|
||||
tools/scripts/tooltool/tooltool_wrapper.sh $(dirname $0)/releng.manifest https://tooltool.mozilla-releng.net/ non-existant-file.sh /c/mozilla-build/python/python.exe /c/builds/tooltool.py --authentication-file /c/builds/relengapi.tok -c /c/builds/tooltool_cache
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
source $(dirname $0)/setup.sh
|
||||
|
||||
export WIN32_REDIST_DIR="${VSPATH}/VC/redist/x86/Microsoft.VC141.CRT"
|
||||
export WIN_UCRT_REDIST_DIR="${VSPATH}/SDK/Redist/ucrt/DLLs/x86"
|
||||
export PATH="${NINJA_PATH}:${VSPATH}/VC/bin/Hostx64/x86:${VSPATH}/VC/bin/Hostx64/x64:${VSPATH}/VC/Hostx86/x86:${VSPATH}/SDK/bin/10.0.15063.0/x64:${VSPATH}/VC/redist/x86/Microsoft.VC141.CRT:${VSPATH}/SDK/Redist/ucrt/DLLs/x86:${PATH}"
|
||||
export LIB="${VSPATH}/VC/lib/x86:${VSPATH}/SDK/lib/10.0.15063.0/ucrt/x86:${VSPATH}/SDK/lib/10.0.15063.0/um/x86"
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -v -e -x
|
||||
|
||||
source $(dirname $0)/setup.sh
|
||||
|
||||
export WIN32_REDIST_DIR="${VSPATH}/VC/redist/x64/Microsoft.VC141.CRT"
|
||||
export WIN_UCRT_REDIST_DIR="${VSPATH}/SDK/Redist/ucrt/DLLs/x64"
|
||||
export PATH="${NINJA_PATH}:${VSPATH}/VC/bin/Hostx64/x64:${VSPATH}/VC/bin/Hostx86/x86:${VSPATH}/SDK/bin/10.0.15063.0/x64:${VSPATH}/VC/redist/x64/Microsoft.VC141.CRT:${VSPATH}/SDK/Redist/ucrt/DLLs/x64:${PATH}"
|
||||
export LIB="${VSPATH}/VC/lib/x64:${VSPATH}/SDK/lib/10.0.15063.0/ucrt/x64:${VSPATH}/SDK/lib/10.0.15063.0/um/x64"
|
||||
@@ -0,0 +1,222 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# 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/.
|
||||
################################################################################
|
||||
#
|
||||
# This script builds NSS with gyp and ninja.
|
||||
#
|
||||
# This build system is still under development. It does not yet support all
|
||||
# the features or platforms that NSS supports.
|
||||
|
||||
set -e
|
||||
|
||||
cwd=$(cd $(dirname $0); pwd -P)
|
||||
source "$cwd"/coreconf/nspr.sh
|
||||
source "$cwd"/coreconf/sanitizers.sh
|
||||
GYP=${GYP:-gyp}
|
||||
|
||||
# Usage info
|
||||
show_help()
|
||||
{
|
||||
cat "$cwd"/help.txt
|
||||
}
|
||||
|
||||
run_verbose()
|
||||
{
|
||||
if [ "$verbose" = 1 ]; then
|
||||
echo "$@"
|
||||
exec 3>&1
|
||||
else
|
||||
exec 3>/dev/null
|
||||
fi
|
||||
"$@" 1>&3 2>&3
|
||||
exec 3>&-
|
||||
}
|
||||
|
||||
if [ -n "$CCC" ] && [ -z "$CXX" ]; then
|
||||
export CXX="$CCC"
|
||||
fi
|
||||
|
||||
opt_build=0
|
||||
build_64=0
|
||||
clean=0
|
||||
rebuild_gyp=0
|
||||
rebuild_nspr=0
|
||||
target=Debug
|
||||
verbose=0
|
||||
fuzz=0
|
||||
fuzz_tls=0
|
||||
fuzz_oss=0
|
||||
no_local_nspr=0
|
||||
armhf=0
|
||||
|
||||
gyp_params=(--depth="$cwd" --generator-output=".")
|
||||
nspr_params=()
|
||||
ninja_params=()
|
||||
|
||||
# try to guess sensible defaults
|
||||
arch=$(python "$cwd"/coreconf/detect_host_arch.py)
|
||||
if [ "$arch" = "x64" -o "$arch" = "aarch64" ]; then
|
||||
build_64=1
|
||||
elif [ "$arch" = "arm" ]; then
|
||||
armhf=1
|
||||
fi
|
||||
|
||||
# parse command line arguments
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
-c) clean=1 ;;
|
||||
-cc) clean_only=1 ;;
|
||||
--gyp|-g) rebuild_gyp=1 ;;
|
||||
--nspr) nspr_clean; rebuild_nspr=1 ;;
|
||||
-j) ninja_params+=(-j "$2"); shift ;;
|
||||
-v) ninja_params+=(-v); verbose=1 ;;
|
||||
--test) gyp_params+=(-Dtest_build=1) ;;
|
||||
--clang) export CC=clang; export CCC=clang++; export CXX=clang++ ;;
|
||||
--gcc) export CC=gcc; export CCC=g++; export CXX=g++ ;;
|
||||
--fuzz) fuzz=1 ;;
|
||||
--fuzz=oss) fuzz=1; fuzz_oss=1 ;;
|
||||
--fuzz=tls) fuzz=1; fuzz_tls=1 ;;
|
||||
--scan-build) enable_scanbuild ;;
|
||||
--scan-build=?*) enable_scanbuild "${1#*=}" ;;
|
||||
--opt|-o) opt_build=1 ;;
|
||||
-m32|--m32) build_64=0 ;;
|
||||
--asan) enable_sanitizer asan ;;
|
||||
--msan) enable_sanitizer msan ;;
|
||||
--ubsan) enable_ubsan ;;
|
||||
--ubsan=?*) enable_ubsan "${1#*=}" ;;
|
||||
--sancov) enable_sancov ;;
|
||||
--sancov=?*) enable_sancov "${1#*=}" ;;
|
||||
--pprof) gyp_params+=(-Duse_pprof=1) ;;
|
||||
--ct-verif) gyp_params+=(-Dct_verif=1) ;;
|
||||
--disable-tests) gyp_params+=(-Ddisable_tests=1) ;;
|
||||
--no-zdefs) gyp_params+=(-Dno_zdefs=1) ;;
|
||||
--system-sqlite) gyp_params+=(-Duse_system_sqlite=1) ;;
|
||||
--with-nspr=?*) set_nspr_path "${1#*=}"; no_local_nspr=1 ;;
|
||||
--system-nspr) set_nspr_path "/usr/include/nspr/:"; no_local_nspr=1 ;;
|
||||
--enable-libpkix) gyp_params+=(-Ddisable_libpkix=0) ;;
|
||||
--enable-fips) gyp_params+=(-Ddisable_fips=0) ;;
|
||||
*) show_help; exit 2 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "$opt_build" = 1 ]; then
|
||||
target=Release
|
||||
else
|
||||
target=Debug
|
||||
fi
|
||||
if [ "$build_64" = 1 ]; then
|
||||
nspr_params+=(--enable-64bit)
|
||||
elif [ ! "$armhf" = 1 ]; then
|
||||
gyp_params+=(-Dtarget_arch=ia32)
|
||||
fi
|
||||
if [ "$fuzz" = 1 ]; then
|
||||
source "$cwd"/coreconf/fuzz.sh
|
||||
fi
|
||||
|
||||
# set paths
|
||||
target_dir="$cwd"/out/$target
|
||||
mkdir -p "$target_dir"
|
||||
dist_dir="$cwd"/../dist
|
||||
dist_dir=$(mkdir -p "$dist_dir"; cd "$dist_dir"; pwd -P)
|
||||
gyp_params+=(-Dnss_dist_dir="$dist_dir")
|
||||
|
||||
# -c = clean first
|
||||
if [ "$clean" = 1 -o "$clean_only" = 1 ]; then
|
||||
nspr_clean
|
||||
rm -rf "$cwd"/out
|
||||
rm -rf "$dist_dir"
|
||||
# -cc = only clean, don't build
|
||||
if [ "$clean_only" = 1 ]; then
|
||||
echo "Cleaned"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# This saves a canonical representation of arguments that we are passing to gyp
|
||||
# or the NSPR build so that we can work out if a rebuild is needed.
|
||||
# Caveat: This can fail for arguments that are position-dependent.
|
||||
# e.g., "-e 2 -f 1" and "-e 1 -f 2" canonicalize the same.
|
||||
check_config()
|
||||
{
|
||||
local newconf="$1".new oldconf="$1"
|
||||
shift
|
||||
mkdir -p $(dirname "$newconf")
|
||||
echo CC="$CC" >"$newconf"
|
||||
echo CCC="$CCC" >>"$newconf"
|
||||
echo CXX="$CXX" >>"$newconf"
|
||||
for i in "$@"; do echo $i; done | sort >>"$newconf"
|
||||
|
||||
# Note: The following diff fails if $oldconf isn't there as well, which
|
||||
# happens if we don't have a previous successful build.
|
||||
! diff -q "$newconf" "$oldconf" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
gyp_config="$cwd"/out/gyp_config
|
||||
nspr_config="$cwd"/out/$target/nspr_config
|
||||
|
||||
# If we don't have a build directory make sure that we rebuild.
|
||||
if [ ! -d "$target_dir" ]; then
|
||||
rebuild_nspr=1
|
||||
rebuild_gyp=1
|
||||
elif [ ! -d "$dist_dir"/$target ]; then
|
||||
rebuild_nspr=1
|
||||
fi
|
||||
|
||||
# Update NSPR ${C,CXX,LD}FLAGS.
|
||||
nspr_set_flags $sanitizer_flags
|
||||
|
||||
if check_config "$nspr_config" "${nspr_params[@]}" \
|
||||
nspr_cflags="$nspr_cflags" \
|
||||
nspr_cxxflags="$nspr_cxxflags" \
|
||||
nspr_ldflags="$nspr_ldflags"; then
|
||||
rebuild_nspr=1
|
||||
fi
|
||||
|
||||
# Forward sanitizer flags.
|
||||
if [ ! -z "$sanitizer_flags" ]; then
|
||||
gyp_params+=(-Dsanitizer_flags="$sanitizer_flags")
|
||||
fi
|
||||
|
||||
if check_config "$gyp_config" "${gyp_params[@]}"; then
|
||||
rebuild_gyp=1
|
||||
fi
|
||||
|
||||
# save the chosen target
|
||||
mkdir -p "$dist_dir"
|
||||
echo $target > "$dist_dir"/latest
|
||||
|
||||
if [[ "$rebuild_nspr" = 1 && "$no_local_nspr" = 0 ]]; then
|
||||
nspr_build "${nspr_params[@]}"
|
||||
mv -f "$nspr_config".new "$nspr_config"
|
||||
fi
|
||||
if [ "$rebuild_gyp" = 1 ]; then
|
||||
if ! hash ${GYP} 2> /dev/null; then
|
||||
echo "Please install gyp" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
# These extra arguments aren't used in determining whether to rebuild.
|
||||
obj_dir="$dist_dir"/$target
|
||||
gyp_params+=(-Dnss_dist_obj_dir=$obj_dir)
|
||||
if [ "$no_local_nspr" = 0 ]; then
|
||||
set_nspr_path "$obj_dir/include/nspr:$obj_dir/lib"
|
||||
fi
|
||||
|
||||
run_verbose run_scanbuild ${GYP} -f ninja "${gyp_params[@]}" "$cwd"/nss.gyp
|
||||
|
||||
mv -f "$gyp_config".new "$gyp_config"
|
||||
fi
|
||||
|
||||
# Run ninja.
|
||||
if hash ninja 2>/dev/null; then
|
||||
ninja=ninja
|
||||
elif hash ninja-build 2>/dev/null; then
|
||||
ninja=ninja-build
|
||||
else
|
||||
echo "Please install ninja" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
run_scanbuild $ninja -C "$target_dir" "${ninja_params[@]}"
|
||||
@@ -16,10 +16,14 @@ endif
|
||||
|
||||
ifeq ($(NSS_BUILD_WITHOUT_SOFTOKEN),1)
|
||||
BLTEST_SRCDIR =
|
||||
ECPERF_SRCDIR =
|
||||
FREEBL_ECTEST_SRCDIR =
|
||||
FIPSTEST_SRCDIR =
|
||||
SHLIBSIGN_SRCDIR =
|
||||
else
|
||||
BLTEST_SRCDIR = bltest
|
||||
ECPERF_SRCDIR = ecperf
|
||||
FREEBL_ECTEST_SRCDIR = fbectest
|
||||
FIPSTEST_SRCDIR = fipstest
|
||||
SHLIBSIGN_SRCDIR = shlibsign
|
||||
endif
|
||||
|
||||
@@ -18,53 +18,79 @@
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
void dumpbytes(unsigned char *buf, int len)
|
||||
void
|
||||
dumpbytes(unsigned char *buf, int len)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < len; i++) {
|
||||
if ((i !=0) && ((i & 0xf) == 0)) {
|
||||
printf("\n");
|
||||
}
|
||||
printf("\\%03o",buf[i]);
|
||||
for (i = 0; i < len; i++) {
|
||||
if ((i != 0) && ((i & 0xf) == 0)) {
|
||||
printf("\n");
|
||||
}
|
||||
printf("\\%03o", buf[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
char *getTrustString(unsigned int trust)
|
||||
int
|
||||
hasPositiveTrust(unsigned int trust)
|
||||
{
|
||||
if (trust & CERTDB_TRUSTED) {
|
||||
if (trust & CERTDB_TRUSTED_CA) {
|
||||
return "CKT_NSS_TRUSTED_DELEGATOR";
|
||||
} else {
|
||||
return "CKT_NSS_TRUSTED";
|
||||
}
|
||||
if (trust & CERTDB_TRUSTED_CA) {
|
||||
return PR_TRUE;
|
||||
} else {
|
||||
return PR_FALSE;
|
||||
}
|
||||
} else {
|
||||
if (trust & CERTDB_TRUSTED_CA) {
|
||||
return "CKT_NSS_TRUSTED_DELEGATOR";
|
||||
} else if (trust & CERTDB_VALID_CA) {
|
||||
return "CKT_NSS_VALID_DELEGATOR";
|
||||
} else if (trust & CERTDB_TERMINAL_RECORD) {
|
||||
return "CKT_NSS_NOT_TRUSTED";
|
||||
} else {
|
||||
return "CKT_NSS_MUST_VERIFY_TRUST";
|
||||
}
|
||||
if (trust & CERTDB_TRUSTED_CA) {
|
||||
return PR_TRUE;
|
||||
} else if (trust & CERTDB_VALID_CA) {
|
||||
return PR_TRUE;
|
||||
} else if (trust & CERTDB_TERMINAL_RECORD) {
|
||||
return PR_FALSE;
|
||||
} else {
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
char *
|
||||
getTrustString(unsigned int trust)
|
||||
{
|
||||
if (trust & CERTDB_TRUSTED) {
|
||||
if (trust & CERTDB_TRUSTED_CA) {
|
||||
return "CKT_NSS_TRUSTED_DELEGATOR";
|
||||
} else {
|
||||
return "CKT_NSS_TRUSTED";
|
||||
}
|
||||
} else {
|
||||
if (trust & CERTDB_TRUSTED_CA) {
|
||||
return "CKT_NSS_TRUSTED_DELEGATOR";
|
||||
} else if (trust & CERTDB_VALID_CA) {
|
||||
return "CKT_NSS_VALID_DELEGATOR";
|
||||
} else if (trust & CERTDB_TERMINAL_RECORD) {
|
||||
return "CKT_NSS_NOT_TRUSTED";
|
||||
} else {
|
||||
return "CKT_NSS_MUST_VERIFY_TRUST";
|
||||
}
|
||||
}
|
||||
return "CKT_NSS_TRUST_UNKNOWN"; /* not reached */
|
||||
}
|
||||
|
||||
static const SEC_ASN1Template serialTemplate[] = {
|
||||
{ SEC_ASN1_INTEGER, offsetof(CERTCertificate,serialNumber) },
|
||||
{ SEC_ASN1_INTEGER, offsetof(CERTCertificate, serialNumber) },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
void print_crl_info(CERTName *name, SECItem *serial)
|
||||
void
|
||||
print_crl_info(CERTName *name, SECItem *serial)
|
||||
{
|
||||
PRBool saveWrapeState = SECU_GetWrapEnabled();
|
||||
SECU_EnableWrap(PR_FALSE);
|
||||
|
||||
SECU_PrintNameQuotesOptional(stdout, name, "# Issuer", 0, PR_FALSE);
|
||||
printf("\n");
|
||||
|
||||
|
||||
SECU_PrintInteger(stdout, serial, "# Serial Number", 0);
|
||||
|
||||
SECU_EnableWrap(saveWrapeState);
|
||||
@@ -77,79 +103,80 @@ ConvertCRLEntry(SECItem *sdder, PRInt32 crlentry, char *nickname)
|
||||
PLArenaPool *arena = NULL;
|
||||
CERTSignedCrl *newCrl = NULL;
|
||||
CERTCrlEntry *entry;
|
||||
|
||||
|
||||
CERTName *name = NULL;
|
||||
SECItem *derName = NULL;
|
||||
SECItem *serial = NULL;
|
||||
|
||||
|
||||
rv = SEC_ERROR_NO_MEMORY;
|
||||
arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
|
||||
if (!arena)
|
||||
return rv;
|
||||
return rv;
|
||||
|
||||
newCrl = CERT_DecodeDERCrlWithFlags(arena, sdder, SEC_CRL_TYPE,
|
||||
CRL_DECODE_DEFAULT_OPTIONS);
|
||||
CRL_DECODE_DEFAULT_OPTIONS);
|
||||
if (!newCrl)
|
||||
return SECFailure;
|
||||
|
||||
return SECFailure;
|
||||
|
||||
name = &newCrl->crl.name;
|
||||
derName = &newCrl->crl.derName;
|
||||
|
||||
|
||||
if (newCrl->crl.entries != NULL) {
|
||||
PRInt32 iv = 0;
|
||||
while ((entry = newCrl->crl.entries[iv++]) != NULL) {
|
||||
if (crlentry == iv) {
|
||||
serial = &entry->serialNumber;
|
||||
break;
|
||||
}
|
||||
}
|
||||
PRInt32 iv = 0;
|
||||
while ((entry = newCrl->crl.entries[iv++]) != NULL) {
|
||||
if (crlentry == iv) {
|
||||
serial = &entry->serialNumber;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!name || !derName || !serial)
|
||||
return SECFailure;
|
||||
|
||||
printf("\n# Distrust \"%s\"\n",nickname);
|
||||
return SECFailure;
|
||||
|
||||
printf("\n# Distrust \"%s\"\n", nickname);
|
||||
print_crl_info(name, serial);
|
||||
|
||||
printf("CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST\n");
|
||||
printf("CKA_TOKEN CK_BBOOL CK_TRUE\n");
|
||||
printf("CKA_PRIVATE CK_BBOOL CK_FALSE\n");
|
||||
printf("CKA_MODIFIABLE CK_BBOOL CK_FALSE\n");
|
||||
printf("CKA_LABEL UTF8 \"%s\"\n",nickname);
|
||||
|
||||
printf("CKA_LABEL UTF8 \"%s\"\n", nickname);
|
||||
|
||||
printf("CKA_ISSUER MULTILINE_OCTAL\n");
|
||||
dumpbytes(derName->data,derName->len);
|
||||
dumpbytes(derName->data, derName->len);
|
||||
printf("END\n");
|
||||
printf("CKA_SERIAL_NUMBER MULTILINE_OCTAL\n");
|
||||
printf("\\002\\%03o", serial->len); /* 002: type integer; len >=3 digits */
|
||||
dumpbytes(serial->data,serial->len);
|
||||
dumpbytes(serial->data, serial->len);
|
||||
printf("END\n");
|
||||
|
||||
|
||||
printf("CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_NOT_TRUSTED\n");
|
||||
printf("CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_NOT_TRUSTED\n");
|
||||
printf("CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED\n");
|
||||
printf("CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE\n");
|
||||
|
||||
PORT_FreeArena (arena, PR_FALSE);
|
||||
PORT_FreeArena(arena, PR_FALSE);
|
||||
return rv;
|
||||
}
|
||||
|
||||
void print_info(SECItem *sdder, CERTCertificate *c)
|
||||
void
|
||||
print_info(SECItem *sdder, CERTCertificate *c)
|
||||
{
|
||||
PRBool saveWrapeState = SECU_GetWrapEnabled();
|
||||
SECU_EnableWrap(PR_FALSE);
|
||||
|
||||
SECU_PrintNameQuotesOptional(stdout, &c->issuer, "# Issuer", 0, PR_FALSE);
|
||||
printf("\n");
|
||||
|
||||
|
||||
SECU_PrintInteger(stdout, &c->serialNumber, "# Serial Number", 0);
|
||||
|
||||
SECU_PrintNameQuotesOptional(stdout, &c->subject, "# Subject", 0, PR_FALSE);
|
||||
printf("\n");
|
||||
|
||||
SECU_PrintTimeChoice(stdout, &c->validity.notBefore, "# Not Valid Before", 0);
|
||||
SECU_PrintTimeChoice(stdout, &c->validity.notAfter, "# Not Valid After ", 0);
|
||||
|
||||
SECU_PrintTimeChoice(stdout, &c->validity.notAfter, "# Not Valid After ", 0);
|
||||
|
||||
SECU_PrintFingerprints(stdout, sdder, "# Fingerprint", 0);
|
||||
|
||||
SECU_EnableWrap(saveWrapeState);
|
||||
@@ -169,43 +196,48 @@ ConvertCertificate(SECItem *sdder, char *nickname, CERTCertTrust *trust,
|
||||
|
||||
cert = CERT_DecodeDERCertificate(sdder, PR_FALSE, nickname);
|
||||
if (!cert) {
|
||||
return SECFailure;
|
||||
return SECFailure;
|
||||
}
|
||||
serial = SEC_ASN1EncodeItem(NULL,NULL,cert,serialTemplate);
|
||||
serial = SEC_ASN1EncodeItem(NULL, NULL, cert, serialTemplate);
|
||||
if (!serial) {
|
||||
return SECFailure;
|
||||
return SECFailure;
|
||||
}
|
||||
|
||||
|
||||
if (!excludeCert) {
|
||||
printf("\n#\n# Certificate \"%s\"\n#\n",nickname);
|
||||
print_info(sdder, cert);
|
||||
printf("CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE\n");
|
||||
printf("CKA_TOKEN CK_BBOOL CK_TRUE\n");
|
||||
printf("CKA_PRIVATE CK_BBOOL CK_FALSE\n");
|
||||
printf("CKA_MODIFIABLE CK_BBOOL CK_FALSE\n");
|
||||
printf("CKA_LABEL UTF8 \"%s\"\n",nickname);
|
||||
printf("CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509\n");
|
||||
printf("CKA_SUBJECT MULTILINE_OCTAL\n");
|
||||
dumpbytes(cert->derSubject.data,cert->derSubject.len);
|
||||
printf("END\n");
|
||||
printf("CKA_ID UTF8 \"0\"\n");
|
||||
printf("CKA_ISSUER MULTILINE_OCTAL\n");
|
||||
dumpbytes(cert->derIssuer.data,cert->derIssuer.len);
|
||||
printf("END\n");
|
||||
printf("CKA_SERIAL_NUMBER MULTILINE_OCTAL\n");
|
||||
dumpbytes(serial->data,serial->len);
|
||||
printf("END\n");
|
||||
printf("CKA_VALUE MULTILINE_OCTAL\n");
|
||||
dumpbytes(sdder->data,sdder->len);
|
||||
printf("END\n");
|
||||
printf("\n#\n# Certificate \"%s\"\n#\n", nickname);
|
||||
print_info(sdder, cert);
|
||||
printf("CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE\n");
|
||||
printf("CKA_TOKEN CK_BBOOL CK_TRUE\n");
|
||||
printf("CKA_PRIVATE CK_BBOOL CK_FALSE\n");
|
||||
printf("CKA_MODIFIABLE CK_BBOOL CK_FALSE\n");
|
||||
printf("CKA_LABEL UTF8 \"%s\"\n", nickname);
|
||||
printf("CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509\n");
|
||||
printf("CKA_SUBJECT MULTILINE_OCTAL\n");
|
||||
dumpbytes(cert->derSubject.data, cert->derSubject.len);
|
||||
printf("END\n");
|
||||
printf("CKA_ID UTF8 \"0\"\n");
|
||||
printf("CKA_ISSUER MULTILINE_OCTAL\n");
|
||||
dumpbytes(cert->derIssuer.data, cert->derIssuer.len);
|
||||
printf("END\n");
|
||||
printf("CKA_SERIAL_NUMBER MULTILINE_OCTAL\n");
|
||||
dumpbytes(serial->data, serial->len);
|
||||
printf("END\n");
|
||||
printf("CKA_VALUE MULTILINE_OCTAL\n");
|
||||
dumpbytes(sdder->data, sdder->len);
|
||||
printf("END\n");
|
||||
if (hasPositiveTrust(trust->sslFlags) ||
|
||||
hasPositiveTrust(trust->emailFlags) ||
|
||||
hasPositiveTrust(trust->objectSigningFlags)) {
|
||||
printf("CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE\n");
|
||||
}
|
||||
}
|
||||
|
||||
if ((trust->sslFlags | trust->emailFlags | trust->objectSigningFlags)
|
||||
== CERTDB_TERMINAL_RECORD)
|
||||
trust_info = "Distrust";
|
||||
|
||||
if ((trust->sslFlags | trust->emailFlags | trust->objectSigningFlags) ==
|
||||
CERTDB_TERMINAL_RECORD)
|
||||
trust_info = "Distrust";
|
||||
else
|
||||
trust_info = "Trust for";
|
||||
|
||||
trust_info = "Trust for";
|
||||
|
||||
printf("\n# %s \"%s\"\n", trust_info, nickname);
|
||||
print_info(sdder, cert);
|
||||
|
||||
@@ -213,32 +245,32 @@ ConvertCertificate(SECItem *sdder, char *nickname, CERTCertTrust *trust,
|
||||
printf("CKA_TOKEN CK_BBOOL CK_TRUE\n");
|
||||
printf("CKA_PRIVATE CK_BBOOL CK_FALSE\n");
|
||||
printf("CKA_MODIFIABLE CK_BBOOL CK_FALSE\n");
|
||||
printf("CKA_LABEL UTF8 \"%s\"\n",nickname);
|
||||
|
||||
printf("CKA_LABEL UTF8 \"%s\"\n", nickname);
|
||||
|
||||
if (!excludeHash) {
|
||||
PK11_HashBuf(SEC_OID_SHA1, sha1_hash, sdder->data, sdder->len);
|
||||
printf("CKA_CERT_SHA1_HASH MULTILINE_OCTAL\n");
|
||||
dumpbytes(sha1_hash,SHA1_LENGTH);
|
||||
printf("END\n");
|
||||
PK11_HashBuf(SEC_OID_MD5, md5_hash, sdder->data, sdder->len);
|
||||
printf("CKA_CERT_MD5_HASH MULTILINE_OCTAL\n");
|
||||
dumpbytes(md5_hash,MD5_LENGTH);
|
||||
printf("END\n");
|
||||
PK11_HashBuf(SEC_OID_SHA1, sha1_hash, sdder->data, sdder->len);
|
||||
printf("CKA_CERT_SHA1_HASH MULTILINE_OCTAL\n");
|
||||
dumpbytes(sha1_hash, SHA1_LENGTH);
|
||||
printf("END\n");
|
||||
PK11_HashBuf(SEC_OID_MD5, md5_hash, sdder->data, sdder->len);
|
||||
printf("CKA_CERT_MD5_HASH MULTILINE_OCTAL\n");
|
||||
dumpbytes(md5_hash, MD5_LENGTH);
|
||||
printf("END\n");
|
||||
}
|
||||
|
||||
printf("CKA_ISSUER MULTILINE_OCTAL\n");
|
||||
dumpbytes(cert->derIssuer.data,cert->derIssuer.len);
|
||||
dumpbytes(cert->derIssuer.data, cert->derIssuer.len);
|
||||
printf("END\n");
|
||||
printf("CKA_SERIAL_NUMBER MULTILINE_OCTAL\n");
|
||||
dumpbytes(serial->data,serial->len);
|
||||
dumpbytes(serial->data, serial->len);
|
||||
printf("END\n");
|
||||
|
||||
|
||||
printf("CKA_TRUST_SERVER_AUTH CK_TRUST %s\n",
|
||||
getTrustString(trust->sslFlags));
|
||||
getTrustString(trust->sslFlags));
|
||||
printf("CKA_TRUST_EMAIL_PROTECTION CK_TRUST %s\n",
|
||||
getTrustString(trust->emailFlags));
|
||||
getTrustString(trust->emailFlags));
|
||||
printf("CKA_TRUST_CODE_SIGNING CK_TRUST %s\n",
|
||||
getTrustString(trust->objectSigningFlags));
|
||||
getTrustString(trust->objectSigningFlags));
|
||||
#ifdef notdef
|
||||
printf("CKA_TRUST_CLIENT_AUTH CK_TRUST CKT_NSS_TRUSTED\n");
|
||||
printf("CKA_TRUST_DIGITAL_SIGNATURE CK_TRUST CKT_NSS_TRUSTED_DELEGATOR\n");
|
||||
@@ -248,111 +280,110 @@ ConvertCertificate(SECItem *sdder, char *nickname, CERTCertTrust *trust,
|
||||
printf("CKA_TRUST_KEY_AGREEMENT CK_TRUST CKT_NSS_TRUSTED_DELEGATOR\n");
|
||||
printf("CKA_TRUST_KEY_CERT_SIGN CK_TRUST CKT_NSS_TRUSTED_DELEGATOR\n");
|
||||
#endif
|
||||
|
||||
|
||||
step_up = (trust->sslFlags & CERTDB_GOVT_APPROVED_CA);
|
||||
printf("CKA_TRUST_STEP_UP_APPROVED CK_BBOOL %s\n",
|
||||
step_up ? "CK_TRUE" : "CK_FALSE");
|
||||
step_up ? "CK_TRUE" : "CK_FALSE");
|
||||
|
||||
PORT_Free(sdder->data);
|
||||
return(rv);
|
||||
|
||||
return (rv);
|
||||
}
|
||||
|
||||
void printheader() {
|
||||
void
|
||||
printheader()
|
||||
{
|
||||
printf("# \n"
|
||||
"# This Source Code Form is subject to the terms of the Mozilla Public\n"
|
||||
"# License, v. 2.0. If a copy of the MPL was not distributed with this\n"
|
||||
"# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
|
||||
"#\n"
|
||||
"CVS_ID \"@(#) $RCSfile$ $Revision$ $Date$\"\n"
|
||||
"\n"
|
||||
"#\n"
|
||||
"# certdata.txt\n"
|
||||
"#\n"
|
||||
"# This file contains the object definitions for the certs and other\n"
|
||||
"# information \"built into\" NSS.\n"
|
||||
"#\n"
|
||||
"# Object definitions:\n"
|
||||
"#\n"
|
||||
"# Certificates\n"
|
||||
"#\n"
|
||||
"# -- Attribute -- -- type -- -- value --\n"
|
||||
"# CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE\n"
|
||||
"# CKA_TOKEN CK_BBOOL CK_TRUE\n"
|
||||
"# CKA_PRIVATE CK_BBOOL CK_FALSE\n"
|
||||
"# CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"
|
||||
"# CKA_LABEL UTF8 (varies)\n"
|
||||
"# CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509\n"
|
||||
"# CKA_SUBJECT DER+base64 (varies)\n"
|
||||
"# CKA_ID byte array (varies)\n"
|
||||
"# CKA_ISSUER DER+base64 (varies)\n"
|
||||
"# CKA_SERIAL_NUMBER DER+base64 (varies)\n"
|
||||
"# CKA_VALUE DER+base64 (varies)\n"
|
||||
"# CKA_NSS_EMAIL ASCII7 (unused here)\n"
|
||||
"#\n"
|
||||
"# Trust\n"
|
||||
"#\n"
|
||||
"# -- Attribute -- -- type -- -- value --\n"
|
||||
"# CKA_CLASS CK_OBJECT_CLASS CKO_TRUST\n"
|
||||
"# CKA_TOKEN CK_BBOOL CK_TRUE\n"
|
||||
"# CKA_PRIVATE CK_BBOOL CK_FALSE\n"
|
||||
"# CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"
|
||||
"# CKA_LABEL UTF8 (varies)\n"
|
||||
"# CKA_ISSUER DER+base64 (varies)\n"
|
||||
"# CKA_SERIAL_NUMBER DER+base64 (varies)\n"
|
||||
"# CKA_CERT_HASH binary+base64 (varies)\n"
|
||||
"# CKA_EXPIRES CK_DATE (not used here)\n"
|
||||
"# CKA_TRUST_DIGITAL_SIGNATURE CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_NON_REPUDIATION CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_KEY_ENCIPHERMENT CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_DATA_ENCIPHERMENT CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_KEY_AGREEMENT CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_KEY_CERT_SIGN CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_CRL_SIGN CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_SERVER_AUTH CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_CLIENT_AUTH CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_CODE_SIGNING CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_EMAIL_PROTECTION CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_IPSEC_END_SYSTEM CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_IPSEC_TUNNEL CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_IPSEC_USER CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_TIME_STAMPING CK_TRUST (varies)\n"
|
||||
"# (other trust attributes can be defined)\n"
|
||||
"#\n"
|
||||
"\n"
|
||||
"#\n"
|
||||
"# The object to tell NSS that this is a root list and we don't\n"
|
||||
"# have to go looking for others.\n"
|
||||
"#\n"
|
||||
"BEGINDATA\n"
|
||||
"CKA_CLASS CK_OBJECT_CLASS CKO_NSS_BUILTIN_ROOT_LIST\n"
|
||||
"CKA_TOKEN CK_BBOOL CK_TRUE\n"
|
||||
"CKA_PRIVATE CK_BBOOL CK_FALSE\n"
|
||||
"CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"
|
||||
"CKA_LABEL UTF8 \"Mozilla Builtin Roots\"\n");
|
||||
"# This Source Code Form is subject to the terms of the Mozilla Public\n"
|
||||
"# License, v. 2.0. If a copy of the MPL was not distributed with this\n"
|
||||
"# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
|
||||
"#\n"
|
||||
"# certdata.txt\n"
|
||||
"#\n"
|
||||
"# This file contains the object definitions for the certs and other\n"
|
||||
"# information \"built into\" NSS.\n"
|
||||
"#\n"
|
||||
"# Object definitions:\n"
|
||||
"#\n"
|
||||
"# Certificates\n"
|
||||
"#\n"
|
||||
"# -- Attribute -- -- type -- -- value --\n"
|
||||
"# CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE\n"
|
||||
"# CKA_TOKEN CK_BBOOL CK_TRUE\n"
|
||||
"# CKA_PRIVATE CK_BBOOL CK_FALSE\n"
|
||||
"# CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"
|
||||
"# CKA_LABEL UTF8 (varies)\n"
|
||||
"# CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509\n"
|
||||
"# CKA_SUBJECT DER+base64 (varies)\n"
|
||||
"# CKA_ID byte array (varies)\n"
|
||||
"# CKA_ISSUER DER+base64 (varies)\n"
|
||||
"# CKA_SERIAL_NUMBER DER+base64 (varies)\n"
|
||||
"# CKA_VALUE DER+base64 (varies)\n"
|
||||
"# CKA_NSS_EMAIL ASCII7 (unused here)\n"
|
||||
"#\n"
|
||||
"# Trust\n"
|
||||
"#\n"
|
||||
"# -- Attribute -- -- type -- -- value --\n"
|
||||
"# CKA_CLASS CK_OBJECT_CLASS CKO_TRUST\n"
|
||||
"# CKA_TOKEN CK_BBOOL CK_TRUE\n"
|
||||
"# CKA_PRIVATE CK_BBOOL CK_FALSE\n"
|
||||
"# CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"
|
||||
"# CKA_LABEL UTF8 (varies)\n"
|
||||
"# CKA_ISSUER DER+base64 (varies)\n"
|
||||
"# CKA_SERIAL_NUMBER DER+base64 (varies)\n"
|
||||
"# CKA_CERT_HASH binary+base64 (varies)\n"
|
||||
"# CKA_EXPIRES CK_DATE (not used here)\n"
|
||||
"# CKA_TRUST_DIGITAL_SIGNATURE CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_NON_REPUDIATION CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_KEY_ENCIPHERMENT CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_DATA_ENCIPHERMENT CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_KEY_AGREEMENT CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_KEY_CERT_SIGN CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_CRL_SIGN CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_SERVER_AUTH CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_CLIENT_AUTH CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_CODE_SIGNING CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_EMAIL_PROTECTION CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_IPSEC_END_SYSTEM CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_IPSEC_TUNNEL CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_IPSEC_USER CK_TRUST (varies)\n"
|
||||
"# CKA_TRUST_TIME_STAMPING CK_TRUST (varies)\n"
|
||||
"# (other trust attributes can be defined)\n"
|
||||
"#\n"
|
||||
"\n"
|
||||
"#\n"
|
||||
"# The object to tell NSS that this is a root list and we don't\n"
|
||||
"# have to go looking for others.\n"
|
||||
"#\n"
|
||||
"BEGINDATA\n"
|
||||
"CKA_CLASS CK_OBJECT_CLASS CKO_NSS_BUILTIN_ROOT_LIST\n"
|
||||
"CKA_TOKEN CK_BBOOL CK_TRUE\n"
|
||||
"CKA_PRIVATE CK_BBOOL CK_FALSE\n"
|
||||
"CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"
|
||||
"CKA_LABEL UTF8 \"Mozilla Builtin Roots\"\n");
|
||||
}
|
||||
|
||||
static void Usage(char *progName)
|
||||
static void
|
||||
Usage(char *progName)
|
||||
{
|
||||
fprintf(stderr, "%s -t trust -n nickname [-i certfile] [-c] [-h]\n", progName);
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"\tRead a der-encoded cert from certfile or stdin, and output\n"
|
||||
"\tit to stdout in a format suitable for the builtin root module.\n"
|
||||
"\tExample: %s -n MyCA -t \"C,C,C\" -i myca.der >> certdata.txt\n",
|
||||
progName);
|
||||
fprintf(stderr, "%s -D -n label [-i certfile]\n", progName);
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"\tRead a der-encoded cert from certfile or stdin, and output\n"
|
||||
"\ta distrust record.\n"
|
||||
"\t(-D is equivalent to -t p,p,p -c -h)\n");
|
||||
"\t(-D is equivalent to -t p,p,p -c -h)\n");
|
||||
fprintf(stderr, "%s -C -e crl-entry-number -n label [-i crlfile]\n", progName);
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"\tRead a CRL from crlfile or stdin, and output\n"
|
||||
"\ta distrust record (issuer+serial).\n"
|
||||
"\t(-C implies -c -h)\n");
|
||||
"\t(-C implies -c -h)\n");
|
||||
fprintf(stderr, "%-15s trust flags (cCTpPuw).\n", "-t trust");
|
||||
fprintf(stderr, "%-15s nickname to assign to builtin cert, or\n",
|
||||
"-n nickname");
|
||||
fprintf(stderr, "%-15s nickname to assign to builtin cert, or\n",
|
||||
"-n nickname");
|
||||
fprintf(stderr, "%-15s a label for the distrust record.\n", "");
|
||||
fprintf(stderr, "%-15s exclude the certificate (only add a trust record)\n", "-c");
|
||||
fprintf(stderr, "%-15s exclude hash from trust record\n", "-h");
|
||||
@@ -376,18 +407,19 @@ enum {
|
||||
};
|
||||
|
||||
static secuCommandFlag addbuiltin_options[] =
|
||||
{
|
||||
{ /* opt_Input */ 'i', PR_TRUE, 0, PR_FALSE },
|
||||
{ /* opt_Nickname */ 'n', PR_TRUE, 0, PR_FALSE },
|
||||
{ /* opt_Trust */ 't', PR_TRUE, 0, PR_FALSE },
|
||||
{ /* opt_Distrust */ 'D', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_ExcludeCert */ 'c', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_ExcludeHash */ 'h', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_DistrustCRL */ 'C', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_CRLEnry */ 'e', PR_TRUE, 0, PR_FALSE },
|
||||
};
|
||||
{
|
||||
{ /* opt_Input */ 'i', PR_TRUE, 0, PR_FALSE },
|
||||
{ /* opt_Nickname */ 'n', PR_TRUE, 0, PR_FALSE },
|
||||
{ /* opt_Trust */ 't', PR_TRUE, 0, PR_FALSE },
|
||||
{ /* opt_Distrust */ 'D', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_ExcludeCert */ 'c', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_ExcludeHash */ 'h', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_DistrustCRL */ 'C', PR_FALSE, 0, PR_FALSE },
|
||||
{ /* opt_CRLEnry */ 'e', PR_TRUE, 0, PR_FALSE },
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
SECStatus rv;
|
||||
char *nickname = NULL;
|
||||
@@ -401,44 +433,43 @@ int main(int argc, char **argv)
|
||||
PRBool decodeTrust = PR_FALSE;
|
||||
|
||||
secuCommand addbuiltin = { 0 };
|
||||
addbuiltin.numOptions = sizeof(addbuiltin_options)/sizeof(secuCommandFlag);
|
||||
addbuiltin.numOptions = sizeof(addbuiltin_options) / sizeof(secuCommandFlag);
|
||||
addbuiltin.options = addbuiltin_options;
|
||||
|
||||
progName = strrchr(argv[0], '/');
|
||||
progName = progName ? progName+1 : argv[0];
|
||||
progName = progName ? progName + 1 : argv[0];
|
||||
|
||||
rv = SECU_ParseCommandLine(argc, argv, progName, &addbuiltin);
|
||||
|
||||
if (rv != SECSuccess)
|
||||
Usage(progName);
|
||||
|
||||
Usage(progName);
|
||||
|
||||
if (addbuiltin.options[opt_Trust].activated)
|
||||
++mutuallyExclusiveOpts;
|
||||
++mutuallyExclusiveOpts;
|
||||
if (addbuiltin.options[opt_Distrust].activated)
|
||||
++mutuallyExclusiveOpts;
|
||||
++mutuallyExclusiveOpts;
|
||||
if (addbuiltin.options[opt_DistrustCRL].activated)
|
||||
++mutuallyExclusiveOpts;
|
||||
++mutuallyExclusiveOpts;
|
||||
|
||||
if (mutuallyExclusiveOpts != 1) {
|
||||
fprintf(stderr, "%s: you must specify exactly one of -t or -D or -C\n",
|
||||
progName);
|
||||
Usage(progName);
|
||||
}
|
||||
|
||||
|
||||
if (addbuiltin.options[opt_DistrustCRL].activated) {
|
||||
if (!addbuiltin.options[opt_CRLEnry].activated) {
|
||||
fprintf(stderr, "%s: you must specify the CRL entry number.\n",
|
||||
progName);
|
||||
Usage(progName);
|
||||
}
|
||||
else {
|
||||
crlentry = atoi(addbuiltin.options[opt_CRLEnry].arg);
|
||||
if (crlentry < 1) {
|
||||
fprintf(stderr, "%s: The CRL entry number must be > 0.\n",
|
||||
progName);
|
||||
Usage(progName);
|
||||
}
|
||||
}
|
||||
if (!addbuiltin.options[opt_CRLEnry].activated) {
|
||||
fprintf(stderr, "%s: you must specify the CRL entry number.\n",
|
||||
progName);
|
||||
Usage(progName);
|
||||
} else {
|
||||
crlentry = atoi(addbuiltin.options[opt_CRLEnry].arg);
|
||||
if (crlentry < 1) {
|
||||
fprintf(stderr, "%s: The CRL entry number must be > 0.\n",
|
||||
progName);
|
||||
Usage(progName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!addbuiltin.options[opt_Nickname].activated) {
|
||||
@@ -448,27 +479,27 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (addbuiltin.options[opt_Input].activated) {
|
||||
infile = PR_Open(addbuiltin.options[opt_Input].arg, PR_RDONLY, 00660);
|
||||
if (!infile) {
|
||||
fprintf(stderr, "%s: failed to open input file.\n", progName);
|
||||
exit(1);
|
||||
}
|
||||
infile = PR_Open(addbuiltin.options[opt_Input].arg, PR_RDONLY, 00660);
|
||||
if (!infile) {
|
||||
fprintf(stderr, "%s: failed to open input file.\n", progName);
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
#if defined(WIN32)
|
||||
/* If we're going to read binary data from stdin, we must put stdin
|
||||
/* If we're going to read binary data from stdin, we must put stdin
|
||||
** into O_BINARY mode or else incoming \r\n's will become \n's,
|
||||
** and latin-1 characters will be altered.
|
||||
*/
|
||||
|
||||
int smrv = _setmode(_fileno(stdin), _O_BINARY);
|
||||
if (smrv == -1) {
|
||||
fprintf(stderr,
|
||||
"%s: Cannot change stdin to binary mode. Use -i option instead.\n",
|
||||
progName);
|
||||
exit(1);
|
||||
}
|
||||
int smrv = _setmode(_fileno(stdin), _O_BINARY);
|
||||
if (smrv == -1) {
|
||||
fprintf(stderr,
|
||||
"%s: Cannot change stdin to binary mode. Use -i option instead.\n",
|
||||
progName);
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
infile = PR_STDIN;
|
||||
infile = PR_STDIN;
|
||||
}
|
||||
|
||||
#if defined(WIN32)
|
||||
@@ -476,70 +507,68 @@ int main(int argc, char **argv)
|
||||
** carriage returns.
|
||||
*/
|
||||
{
|
||||
int smrv = _setmode(_fileno(stdout), _O_BINARY);
|
||||
if (smrv == -1) {
|
||||
fprintf(stderr, "%s: Cannot change stdout to binary mode.\n", progName);
|
||||
exit(1);
|
||||
}
|
||||
int smrv = _setmode(_fileno(stdout), _O_BINARY);
|
||||
if (smrv == -1) {
|
||||
fprintf(stderr, "%s: Cannot change stdout to binary mode.\n", progName);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
nickname = strdup(addbuiltin.options[opt_Nickname].arg);
|
||||
|
||||
|
||||
NSS_NoDB_Init(NULL);
|
||||
|
||||
if (addbuiltin.options[opt_Distrust].activated ||
|
||||
addbuiltin.options[opt_DistrustCRL].activated) {
|
||||
addbuiltin.options[opt_ExcludeCert].activated = PR_TRUE;
|
||||
addbuiltin.options[opt_ExcludeHash].activated = PR_TRUE;
|
||||
addbuiltin.options[opt_ExcludeCert].activated = PR_TRUE;
|
||||
addbuiltin.options[opt_ExcludeHash].activated = PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (addbuiltin.options[opt_Distrust].activated) {
|
||||
trusts = strdup("p,p,p");
|
||||
decodeTrust = PR_TRUE;
|
||||
}
|
||||
else if (addbuiltin.options[opt_Trust].activated) {
|
||||
decodeTrust = PR_TRUE;
|
||||
} else if (addbuiltin.options[opt_Trust].activated) {
|
||||
trusts = strdup(addbuiltin.options[opt_Trust].arg);
|
||||
decodeTrust = PR_TRUE;
|
||||
decodeTrust = PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (decodeTrust) {
|
||||
rv = CERT_DecodeTrustString(&trust, trusts);
|
||||
if (rv) {
|
||||
fprintf(stderr, "%s: incorrectly formatted trust string.\n", progName);
|
||||
Usage(progName);
|
||||
}
|
||||
rv = CERT_DecodeTrustString(&trust, trusts);
|
||||
if (rv) {
|
||||
fprintf(stderr, "%s: incorrectly formatted trust string.\n", progName);
|
||||
Usage(progName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (addbuiltin.options[opt_Trust].activated &&
|
||||
addbuiltin.options[opt_ExcludeHash].activated) {
|
||||
if ((trust.sslFlags | trust.emailFlags | trust.objectSigningFlags)
|
||||
!= CERTDB_TERMINAL_RECORD) {
|
||||
fprintf(stderr, "%s: Excluding the hash only allowed with distrust.\n", progName);
|
||||
Usage(progName);
|
||||
}
|
||||
if ((trust.sslFlags | trust.emailFlags | trust.objectSigningFlags) !=
|
||||
CERTDB_TERMINAL_RECORD) {
|
||||
fprintf(stderr, "%s: Excluding the hash only allowed with distrust.\n", progName);
|
||||
Usage(progName);
|
||||
}
|
||||
}
|
||||
|
||||
SECU_FileToItem(&derItem, infile);
|
||||
|
||||
|
||||
/*printheader();*/
|
||||
|
||||
|
||||
if (addbuiltin.options[opt_DistrustCRL].activated) {
|
||||
rv = ConvertCRLEntry(&derItem, crlentry, nickname);
|
||||
rv = ConvertCRLEntry(&derItem, crlentry, nickname);
|
||||
} else {
|
||||
rv = ConvertCertificate(&derItem, nickname, &trust,
|
||||
addbuiltin.options[opt_ExcludeCert].activated,
|
||||
addbuiltin.options[opt_ExcludeHash].activated);
|
||||
if (rv) {
|
||||
fprintf(stderr, "%s: failed to convert certificate.\n", progName);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
rv = ConvertCertificate(&derItem, nickname, &trust,
|
||||
addbuiltin.options[opt_ExcludeCert].activated,
|
||||
addbuiltin.options[opt_ExcludeHash].activated);
|
||||
if (rv) {
|
||||
fprintf(stderr, "%s: failed to convert certificate.\n", progName);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (NSS_Shutdown() != SECSuccess) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return(SECSuccess);
|
||||
return (SECSuccess);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# 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/.
|
||||
{
|
||||
'includes': [
|
||||
'../../coreconf/config.gypi',
|
||||
'../../cmd/platlibs.gypi'
|
||||
],
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'addbuiltin',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'addbuiltin.c'
|
||||
],
|
||||
'dependencies': [
|
||||
'<(DEPTH)/exports.gyp:nss_exports'
|
||||
]
|
||||
}
|
||||
],
|
||||
'variables': {
|
||||
'module': 'nss'
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#if defined(XP_WIN) || (defined(__sun) && !defined(SVR4))
|
||||
#if !defined(WIN32)
|
||||
extern int fread(char *, size_t, size_t, FILE*);
|
||||
extern int fwrite(char *, size_t, size_t, FILE*);
|
||||
extern int fread(char *, size_t, size_t, FILE *);
|
||||
extern int fwrite(char *, size_t, size_t, FILE *);
|
||||
extern int fprintf(FILE *, char *, ...);
|
||||
#endif
|
||||
#endif
|
||||
@@ -20,16 +20,16 @@ extern int fprintf(FILE *, char *, ...);
|
||||
#include "io.h"
|
||||
#endif
|
||||
|
||||
static PRInt32
|
||||
output_binary (void *arg, const unsigned char *obuf, PRInt32 size)
|
||||
static PRInt32
|
||||
output_binary(void *arg, const unsigned char *obuf, PRInt32 size)
|
||||
{
|
||||
FILE *outFile = arg;
|
||||
int nb;
|
||||
|
||||
nb = fwrite(obuf, 1, size, outFile);
|
||||
if (nb != size) {
|
||||
PORT_SetError(SEC_ERROR_IO);
|
||||
return -1;
|
||||
PORT_SetError(SEC_ERROR_IO);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return nb;
|
||||
@@ -38,12 +38,11 @@ output_binary (void *arg, const unsigned char *obuf, PRInt32 size)
|
||||
static PRBool
|
||||
isBase64Char(char c)
|
||||
{
|
||||
return ((c >= 'A' && c <= 'Z')
|
||||
|| (c >= 'a' && c <= 'z')
|
||||
|| (c >= '0' && c <= '9')
|
||||
|| c == '+'
|
||||
|| c == '/'
|
||||
|| c == '=');
|
||||
return ((c >= 'A' && c <= 'Z') ||
|
||||
(c >= 'a' && c <= 'z') ||
|
||||
(c >= '0' && c <= '9') ||
|
||||
c == '+' || c == '/' ||
|
||||
c == '=');
|
||||
}
|
||||
|
||||
static SECStatus
|
||||
@@ -56,57 +55,61 @@ decode_file(FILE *outFile, FILE *inFile)
|
||||
|
||||
cx = NSSBase64Decoder_Create(output_binary, outFile);
|
||||
if (!cx) {
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (feof(inFile)) break;
|
||||
if (!fgets(ibuf, sizeof(ibuf), inFile)) {
|
||||
if (ferror(inFile)) {
|
||||
PORT_SetError(SEC_ERROR_IO);
|
||||
goto loser;
|
||||
}
|
||||
/* eof */
|
||||
break;
|
||||
}
|
||||
for (ptr = ibuf; *ptr; ++ptr) {
|
||||
char c = *ptr;
|
||||
if (c == '\n' || c == '\r') {
|
||||
break; /* found end of line */
|
||||
}
|
||||
if (!isBase64Char(c)) {
|
||||
ptr = ibuf; /* ignore line */
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ibuf == ptr) {
|
||||
continue; /* skip empty or non-base64 line */
|
||||
}
|
||||
if (feof(inFile))
|
||||
break;
|
||||
if (!fgets(ibuf, sizeof(ibuf), inFile)) {
|
||||
if (ferror(inFile)) {
|
||||
PORT_SetError(SEC_ERROR_IO);
|
||||
goto loser;
|
||||
}
|
||||
/* eof */
|
||||
break;
|
||||
}
|
||||
for (ptr = ibuf; *ptr; ++ptr) {
|
||||
char c = *ptr;
|
||||
if (c == '\n' || c == '\r') {
|
||||
break; /* found end of line */
|
||||
}
|
||||
if (!isBase64Char(c)) {
|
||||
ptr = ibuf; /* ignore line */
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ibuf == ptr) {
|
||||
continue; /* skip empty or non-base64 line */
|
||||
}
|
||||
|
||||
status = NSSBase64Decoder_Update(cx, ibuf, ptr-ibuf);
|
||||
if (status != SECSuccess) goto loser;
|
||||
status = NSSBase64Decoder_Update(cx, ibuf, ptr - ibuf);
|
||||
if (status != SECSuccess)
|
||||
goto loser;
|
||||
}
|
||||
|
||||
return NSSBase64Decoder_Destroy(cx, PR_FALSE);
|
||||
|
||||
loser:
|
||||
(void) NSSBase64Decoder_Destroy(cx, PR_TRUE);
|
||||
loser:
|
||||
(void)NSSBase64Decoder_Destroy(cx, PR_TRUE);
|
||||
return status;
|
||||
}
|
||||
|
||||
static void Usage(char *progName)
|
||||
static void
|
||||
Usage(char *progName)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: %s [-i input] [-o output]\n",
|
||||
progName);
|
||||
"Usage: %s [-i input] [-o output]\n",
|
||||
progName);
|
||||
fprintf(stderr, "%-20s Define an input file to use (default is stdin)\n",
|
||||
"-i input");
|
||||
"-i input");
|
||||
fprintf(stderr, "%-20s Define an output file to use (default is stdout)\n",
|
||||
"-o output");
|
||||
"-o output");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char *progName;
|
||||
SECStatus rv;
|
||||
@@ -117,54 +120,55 @@ int main(int argc, char **argv)
|
||||
inFile = 0;
|
||||
outFile = 0;
|
||||
progName = strrchr(argv[0], '/');
|
||||
progName = progName ? progName+1 : argv[0];
|
||||
progName = progName ? progName + 1 : argv[0];
|
||||
|
||||
/* Parse command line arguments */
|
||||
optstate = PL_CreateOptState(argc, argv, "?hi:o:");
|
||||
while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
|
||||
switch (optstate->option) {
|
||||
case '?':
|
||||
case 'h':
|
||||
Usage(progName);
|
||||
break;
|
||||
switch (optstate->option) {
|
||||
case '?':
|
||||
case 'h':
|
||||
Usage(progName);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
inFile = fopen(optstate->value, "r");
|
||||
if (!inFile) {
|
||||
fprintf(stderr, "%s: unable to open \"%s\" for reading\n",
|
||||
progName, optstate->value);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
inFile = fopen(optstate->value, "r");
|
||||
if (!inFile) {
|
||||
fprintf(stderr, "%s: unable to open \"%s\" for reading\n",
|
||||
progName, optstate->value);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
outFile = fopen(optstate->value, "wb");
|
||||
if (!outFile) {
|
||||
fprintf(stderr, "%s: unable to open \"%s\" for writing\n",
|
||||
progName, optstate->value);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'o':
|
||||
outFile = fopen(optstate->value, "wb");
|
||||
if (!outFile) {
|
||||
fprintf(stderr, "%s: unable to open \"%s\" for writing\n",
|
||||
progName, optstate->value);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!inFile) inFile = stdin;
|
||||
if (!inFile)
|
||||
inFile = stdin;
|
||||
if (!outFile) {
|
||||
#if defined(WIN32)
|
||||
int smrv = _setmode(_fileno(stdout), _O_BINARY);
|
||||
if (smrv == -1) {
|
||||
fprintf(stderr,
|
||||
"%s: Cannot change stdout to binary mode. Use -o option instead.\n",
|
||||
progName);
|
||||
return smrv;
|
||||
}
|
||||
int smrv = _setmode(_fileno(stdout), _O_BINARY);
|
||||
if (smrv == -1) {
|
||||
fprintf(stderr,
|
||||
"%s: Cannot change stdout to binary mode. Use -o option instead.\n",
|
||||
progName);
|
||||
return smrv;
|
||||
}
|
||||
#endif
|
||||
outFile = stdout;
|
||||
outFile = stdout;
|
||||
}
|
||||
rv = decode_file(outFile, inFile);
|
||||
if (rv != SECSuccess) {
|
||||
fprintf(stderr, "%s: lossage: error=%d errno=%d\n",
|
||||
progName, PORT_GetError(), errno);
|
||||
return -1;
|
||||
fprintf(stderr, "%s: lossage: error=%d errno=%d\n",
|
||||
progName, PORT_GetError(), errno);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# 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/.
|
||||
{
|
||||
'includes': [
|
||||
'../../coreconf/config.gypi',
|
||||
'../../cmd/platlibs.gypi'
|
||||
],
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'atob',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'atob.c'
|
||||
],
|
||||
'dependencies': [
|
||||
'<(DEPTH)/exports.gyp:dbm_exports',
|
||||
'<(DEPTH)/exports.gyp:nss_exports'
|
||||
]
|
||||
}
|
||||
],
|
||||
'target_defaults': {
|
||||
'defines': [
|
||||
'NSPR20'
|
||||
]
|
||||
},
|
||||
'variables': {
|
||||
'module': 'nss'
|
||||
}
|
||||
}
|
||||
+2069
-1902
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
||||
# 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/.
|
||||
{
|
||||
'includes': [
|
||||
'../../coreconf/config.gypi',
|
||||
'../../cmd/platlibs.gypi'
|
||||
],
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'bltest',
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'blapitest.c'
|
||||
],
|
||||
'dependencies': [
|
||||
'<(DEPTH)/exports.gyp:dbm_exports',
|
||||
'<(DEPTH)/exports.gyp:nss_exports',
|
||||
'<(DEPTH)/lib/sqlite/sqlite.gyp:sqlite3'
|
||||
]
|
||||
}
|
||||
],
|
||||
'target_defaults': {
|
||||
'include_dirs': [
|
||||
'../../nss/lib/softoken'
|
||||
],
|
||||
'defines': [
|
||||
'NSS_USE_STATIC_LIBS'
|
||||
]
|
||||
},
|
||||
'variables': {
|
||||
'module': 'nss',
|
||||
'use_static_libs': 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,789 @@
|
||||
/* 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/. */
|
||||
|
||||
/* Vectors from pkcs1v15sign-vectors.txt */
|
||||
|
||||
struct pkcs1_test_vector {
|
||||
unsigned char *n;
|
||||
unsigned long n_len;
|
||||
unsigned char *e;
|
||||
unsigned long e_len;
|
||||
unsigned char *d;
|
||||
unsigned long d_len;
|
||||
unsigned char *p;
|
||||
unsigned long p_len;
|
||||
unsigned char *q;
|
||||
unsigned long q_len;
|
||||
};
|
||||
|
||||
struct pkcs1_test_vector PKCS1_VECTORS[15] = {
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88,
|
||||
0x5f, 0x2a, 0x4b, 0xbe, 0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac,
|
||||
|
||||
0x3c, 0x56, 0x8c, 0x8f, 0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02,
|
||||
|
||||
0x66, 0xc8, 0xc6, 0xa3, 0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1,
|
||||
0x12, 0x31, 0x88, 0x44, 0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f,
|
||||
0xee, 0x89, 0x6a, 0x10, 0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7,
|
||||
0x34, 0xe4, 0x47, 0x27, 0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53,
|
||||
0x26, 0x83, 0x10, 0x9c, 0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c,
|
||||
0x31, 0xb4, 0xbd, 0x2f, 0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52,
|
||||
0xce, 0xe3, 0x4f, 0x9e, 0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22,
|
||||
0xad, 0x79, 0xc6, 0xdc, 0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3,
|
||||
0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
},
|
||||
{
|
||||
(unsigned char[]){
|
||||
0xa5, 0x6e, 0x4a, 0x0e, 0x70, 0x10, 0x17, 0x58, 0x9a, 0x51,
|
||||
0x87, 0xdc, 0x7e, 0xa8, 0x41, 0xd1, 0x56, 0xf2, 0xec, 0x0e,
|
||||
0x36, 0xad, 0x52, 0xa4, 0x4d, 0xfe, 0xb1, 0xe6, 0x1f, 0x7a,
|
||||
0xd9, 0x91, 0xd8, 0xc5, 0x10, 0x56, 0xff, 0xed, 0xb1, 0x62,
|
||||
0xb4, 0xc0, 0xf2, 0x83, 0xa1, 0x2a, 0x88, 0xa3, 0x94, 0xdf,
|
||||
0xf5, 0x26, 0xab, 0x72, 0x91, 0xcb, 0xb3, 0x07, 0xce, 0xab,
|
||||
0xfc, 0xe0, 0xb1, 0xdf, 0xd5, 0xcd, 0x95, 0x08, 0x09, 0x6d,
|
||||
0x5b, 0x2b, 0x8b, 0x6d, 0xf5, 0xd6, 0x71, 0xef, 0x63, 0x77,
|
||||
0xc0, 0x92, 0x1c, 0xb2, 0x3c, 0x27, 0x0a, 0x70, 0xe2, 0x59,
|
||||
0x8e, 0x6f, 0xf8, 0x9d, 0x19, 0xf1, 0x05, 0xac, 0xc2, 0xd3,
|
||||
0xf0, 0xcb, 0x35, 0xf2, 0x92, 0x80, 0xe1, 0x38, 0x6b, 0x6f,
|
||||
0x64, 0xc4, 0xef, 0x22, 0xe1, 0xe1, 0xf2, 0x0d, 0x0c, 0xe8,
|
||||
0xcf, 0xfb, 0x22, 0x49, 0xbd, 0x9a, 0x21, 0x37 },
|
||||
128,
|
||||
(unsigned char[]){ 0x01, 0x00, 0x01 }, 3,
|
||||
(unsigned char[]){
|
||||
0x33, 0xa5, 0x04, 0x2a, 0x90, 0xb2, 0x7d, 0x4f, 0x54, 0x51,
|
||||
0xca, 0x9b, 0xbb, 0xd0, 0xb4, 0x47, 0x71, 0xa1, 0x01, 0xaf,
|
||||
0x88, 0x43, 0x40, 0xae, 0xf9, 0x88, 0x5f, 0x2a, 0x4b, 0xbe,
|
||||
0x92, 0xe8, 0x94, 0xa7, 0x24, 0xac, 0x3c, 0x56, 0x8c, 0x8f,
|
||||
0x97, 0x85, 0x3a, 0xd0, 0x7c, 0x02, 0x66, 0xc8, 0xc6, 0xa3,
|
||||
0xca, 0x09, 0x29, 0xf1, 0xe8, 0xf1, 0x12, 0x31, 0x88, 0x44,
|
||||
0x29, 0xfc, 0x4d, 0x9a, 0xe5, 0x5f, 0xee, 0x89, 0x6a, 0x10,
|
||||
0xce, 0x70, 0x7c, 0x3e, 0xd7, 0xe7, 0x34, 0xe4, 0x47, 0x27,
|
||||
0xa3, 0x95, 0x74, 0x50, 0x1a, 0x53, 0x26, 0x83, 0x10, 0x9c,
|
||||
0x2a, 0xba, 0xca, 0xba, 0x28, 0x3c, 0x31, 0xb4, 0xbd, 0x2f,
|
||||
0x53, 0xc3, 0xee, 0x37, 0xe3, 0x52, 0xce, 0xe3, 0x4f, 0x9e,
|
||||
0x50, 0x3b, 0xd8, 0x0c, 0x06, 0x22, 0xad, 0x79, 0xc6, 0xdc,
|
||||
0xee, 0x88, 0x35, 0x47, 0xc6, 0xa3, 0xb3, 0x25 },
|
||||
128,
|
||||
(unsigned char[]){
|
||||
0xb6, 0x9d, 0xca, 0x1c, 0xf7, 0xd4, 0xd7, 0xec, 0x81, 0xe7,
|
||||
0x5b, 0x90, 0xfc, 0xca, 0x87, 0x4a, 0xbc, 0xde, 0x12, 0x3f,
|
||||
0xd2, 0x70, 0x01, 0x80, 0xaa, 0x90, 0x47, 0x9b, 0x6e, 0x48,
|
||||
0xde, 0x8d, 0x67, 0xed, 0x24, 0xf9, 0xf1, 0x9d, 0x85, 0xba,
|
||||
0x27, 0x58, 0x74, 0xf5, 0x42, 0xcd, 0x20, 0xdc, 0x72, 0x3e,
|
||||
0x69, 0x63, 0x36, 0x4a, 0x1f, 0x94, 0x25, 0x45, 0x2b, 0x26,
|
||||
0x9a, 0x67, 0x99, 0xfd },
|
||||
64,
|
||||
(unsigned char[]){
|
||||
0xe7, 0xe8, 0x94, 0x27, 0x20, 0xa8, 0x77, 0x51, 0x72, 0x73,
|
||||
0xa3, 0x56, 0x05, 0x3e, 0xa2, 0xa1, 0xbc, 0x0c, 0x94, 0xaa,
|
||||
0x72, 0xd5, 0x5c, 0x6e, 0x86, 0x29, 0x6b, 0x2d, 0xfc, 0x96,
|
||||
0x79, 0x48, 0xc0, 0xa7, 0x2c, 0xbc, 0xcc, 0xa7, 0xea, 0xcb,
|
||||
0x35, 0x70, 0x6e, 0x09, 0xa1, 0xdf, 0x55, 0xa1, 0x53, 0x5b,
|
||||
0xd9, 0xb3, 0xcc, 0x34, 0x16, 0x0b, 0x3b, 0x6d, 0xcd, 0x3e,
|
||||
0xda, 0x8e, 0x64, 0x43 },
|
||||
64,
|
||||
}
|
||||
};
|
||||
@@ -2,67 +2,77 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int tohex(int c)
|
||||
int
|
||||
tohex(int c)
|
||||
{
|
||||
if ((c >= '0') && (c <= '9')) {
|
||||
if ((c >= '0') && (c <= '9')) {
|
||||
return c - '0';
|
||||
}
|
||||
if ((c >= 'a') && (c <= 'f')) {
|
||||
}
|
||||
if ((c >= 'a') && (c <= 'f')) {
|
||||
return c - 'a' + 10;
|
||||
}
|
||||
if ((c >= 'A') && (c <= 'F')) {
|
||||
}
|
||||
if ((c >= 'A') && (c <= 'F')) {
|
||||
return c - 'A' + 10;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int isspace(int c)
|
||||
int
|
||||
isspace(int c)
|
||||
{
|
||||
if (c <= ' ') return 1;
|
||||
if (c == '\n') return 1;
|
||||
if (c == '\t') return 1;
|
||||
if (c == ':') return 1;
|
||||
if (c == ';') return 1;
|
||||
if (c == ',') return 1;
|
||||
return 0;
|
||||
if (c <= ' ')
|
||||
return 1;
|
||||
if (c == '\n')
|
||||
return 1;
|
||||
if (c == '\t')
|
||||
return 1;
|
||||
if (c == ':')
|
||||
return 1;
|
||||
if (c == ';')
|
||||
return 1;
|
||||
if (c == ',')
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void verify_nibble(int nibble, int current)
|
||||
void
|
||||
verify_nibble(int nibble, int current)
|
||||
{
|
||||
if (nibble != 0) {
|
||||
fprintf(stderr,"count mismatch %d (nibbles=0x%x)\n",nibble,current);
|
||||
if (nibble != 0) {
|
||||
fprintf(stderr, "count mismatch %d (nibbles=0x%x)\n", nibble, current);
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
int current = 0;
|
||||
int nibble = 0;
|
||||
int skip = 0;
|
||||
int c;
|
||||
int current = 0;
|
||||
int nibble = 0;
|
||||
int skip = 0;
|
||||
|
||||
if (argv[1]) {
|
||||
if (argv[1]) {
|
||||
skip = atoi(argv[1]);
|
||||
}
|
||||
}
|
||||
|
||||
#define NIBBLE_COUNT 2
|
||||
while ((c=getchar()) != EOF) {
|
||||
if (isspace(c)) {
|
||||
verify_nibble(nibble,current);
|
||||
continue;
|
||||
}
|
||||
if (skip) {
|
||||
skip--;
|
||||
continue;
|
||||
}
|
||||
current = current << 4 | tohex(c);
|
||||
nibble++;
|
||||
if (nibble == NIBBLE_COUNT) {
|
||||
putchar(current);
|
||||
nibble = 0;
|
||||
current = 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
while ((c = getchar()) != EOF) {
|
||||
if (isspace(c)) {
|
||||
verify_nibble(nibble, current);
|
||||
continue;
|
||||
}
|
||||
if (skip) {
|
||||
skip--;
|
||||
continue;
|
||||
}
|
||||
current = current << 4 | tohex(c);
|
||||
nibble++;
|
||||
if (nibble == NIBBLE_COUNT) {
|
||||
putchar(current);
|
||||
nibble = 0;
|
||||
current = 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
PQRSタチツテトナニヌ
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user