Merge ~lucaskanashiro/ubuntu/+source/nss:merge-focal into ubuntu/+source/nss:ubuntu/devel

Proposed by Lucas Kanashiro
Status: Superseded
Proposed branch: ~lucaskanashiro/ubuntu/+source/nss:merge-focal
Merge into: ubuntu/+source/nss:ubuntu/devel
Diff against target: 212443 lines (+105527/-55021) (has conflicts)
243 files modified
debian/changelog (+21/-0)
debian/libnss3.symbols (+1/-0)
nss/.hg_archival.txt (+3/-3)
nss/.taskcluster.yml (+1/-1)
nss/Makefile (+1/-0)
nss/automation/abi-check/expected-report-libnss3.so.txt (+31/-2)
nss/automation/abi-check/expected-report-libsmime3.so.txt (+11/-0)
nss/automation/abi-check/expected-report-libssl3.so.txt (+7/-19)
nss/automation/abi-check/previous-nss-release (+1/-1)
nss/automation/release/nspr-version.txt (+1/-1)
nss/automation/taskcluster/docker-gcc-4.4/Dockerfile (+1/-0)
nss/automation/taskcluster/docker-hacl/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc (+143/-0)
nss/automation/taskcluster/docker-hacl/Dockerfile (+2/-1)
nss/automation/taskcluster/docker-hacl/setup.sh (+7/-3)
nss/automation/taskcluster/graph/src/extend.js (+127/-28)
nss/automation/taskcluster/graph/src/queue.js (+9/-1)
nss/automation/taskcluster/graph/src/try_syntax.js (+12/-1)
nss/automation/taskcluster/scripts/build.sh (+6/-0)
nss/automation/taskcluster/scripts/build_gyp.sh (+7/-1)
nss/automation/taskcluster/scripts/build_nspr.sh (+6/-0)
nss/automation/taskcluster/scripts/build_softoken.sh (+3/-2)
nss/automation/taskcluster/scripts/check_abi.sh (+6/-0)
nss/automation/taskcluster/scripts/gen_coverage_report.sh (+6/-0)
nss/automation/taskcluster/scripts/run_coverity.sh (+7/-1)
nss/automation/taskcluster/scripts/run_scan_build.sh (+6/-0)
nss/automation/taskcluster/windows/build.sh (+6/-0)
nss/automation/taskcluster/windows/build_gyp.sh (+7/-1)
nss/build.sh (+70/-40)
nss/cmd/addbuiltin/addbuiltin.c (+62/-27)
nss/cmd/httpserv/httpserv.c (+1/-1)
nss/cmd/lib/Makefile (+1/-0)
nss/cmd/lib/derprint.c (+3/-1)
nss/cmd/lib/lib.gyp (+2/-1)
nss/cmd/lib/manifest.mn (+2/-0)
nss/cmd/lib/pk11table.c (+2/-0)
nss/cmd/lib/secpwd.c (+1/-1)
nss/cmd/lib/secutil.c (+208/-28)
nss/cmd/lib/secutil.h (+14/-0)
nss/cmd/p7env/p7env.c (+2/-2)
nss/cmd/pk11importtest/pk11importtest.c (+3/-1)
nss/cmd/pk11mode/pk11mode.c (+1/-1)
nss/cmd/pk12util/pk12util.c (+1/-0)
nss/cmd/platlibs.mk (+2/-2)
nss/cmd/selfserv/selfserv.c (+36/-6)
nss/cmd/shlibsign/shlibsign.c (+1/-1)
nss/cmd/strsclnt/strsclnt.c (+34/-7)
nss/cmd/symkeyutil/symkeyutil.c (+1/-1)
nss/cmd/tstclnt/tstclnt.c (+38/-3)
nss/cmd/vfyserv/vfyserv.c (+6/-1)
nss/coreconf/UNIX.mk (+1/-3)
nss/coreconf/WIN32.mk (+3/-10)
nss/coreconf/config.gypi (+1/-0)
nss/coreconf/nspr.sh (+18/-3)
nss/cpputil/freebl_scoped_ptrs.h (+33/-0)
nss/cpputil/nss_scoped_ptrs.h (+18/-17)
nss/cpputil/scoped_ptrs_util.h (+5/-0)
nss/cpputil/tls_parser.h (+1/-0)
nss/fuzz/fuzz.gyp (+1/-0)
nss/gtests/common/testvectors/curve25519-vectors.h (+63/-3)
nss/gtests/common/testvectors/kw-vectors.h (+1940/-0)
nss/gtests/der_gtest/der_quickder_unittest.cc (+38/-13)
nss/gtests/freebl_gtest/cmac_unittests.cc (+187/-0)
nss/gtests/freebl_gtest/freebl_gtest.gyp (+2/-0)
nss/gtests/freebl_gtest/mpi_unittest.cc (+1/-1)
nss/gtests/mozpkix_gtest/mozpkix_gtest.gyp (+1/-0)
nss/gtests/mozpkix_gtest/pkixder_input_tests.cpp (+4/-2)
nss/gtests/mozpkix_gtest/pkixder_universal_types_tests.cpp (+50/-0)
nss/gtests/pk11_gtest/manifest.mn (+5/-1)
nss/gtests/pk11_gtest/pk11_aes_cmac_unittest.cc (+91/-0)
nss/gtests/pk11_gtest/pk11_aes_gcm_unittest.cc (+60/-49)
nss/gtests/pk11_gtest/pk11_aeskeywrap_unittest.cc (+90/-100)
nss/gtests/pk11_gtest/pk11_aeskeywrappad_unittest.cc (+415/-0)
nss/gtests/pk11_gtest/pk11_cbc_unittest.cc (+217/-0)
nss/gtests/pk11_gtest/pk11_curve25519_unittest.cc (+67/-23)
nss/gtests/pk11_gtest/pk11_der_private_key_import_unittest.cc (+67/-15)
nss/gtests/pk11_gtest/pk11_ecdsa_unittest.cc (+5/-0)
nss/gtests/pk11_gtest/pk11_ecdsa_vectors.h (+32/-0)
nss/gtests/pk11_gtest/pk11_find_certs_unittest.cc (+311/-111)
nss/gtests/pk11_gtest/pk11_gtest.gyp (+8/-2)
nss/gtests/pk11_gtest/pk11_import_unittest.cc (+25/-141)
nss/gtests/pk11_gtest/pk11_key_unittest.cc (+80/-0)
nss/gtests/pk11_gtest/pk11_keygen.cc (+143/-0)
nss/gtests/pk11_gtest/pk11_keygen.h (+34/-0)
nss/gtests/pk11_gtest/pk11_seed_cbc_unittest.cc (+71/-0)
nss/gtests/pk11_gtest/pk11_signature_test.h (+3/-0)
nss/gtests/softoken_gtest/manifest.mn (+10/-1)
nss/gtests/softoken_gtest/softoken_gtest.cc (+187/-0)
nss/gtests/softoken_gtest/softoken_gtest.gyp (+6/-0)
nss/gtests/softoken_gtest/softoken_nssckbi_testlib_gtest.cc (+124/-0)
nss/gtests/ssl_gtest/libssl_internals.c (+19/-0)
nss/gtests/ssl_gtest/libssl_internals.h (+2/-1)
nss/gtests/ssl_gtest/manifest.mn (+1/-0)
nss/gtests/ssl_gtest/ssl_0rtt_unittest.cc (+41/-0)
nss/gtests/ssl_gtest/ssl_auth_unittest.cc (+153/-8)
nss/gtests/ssl_gtest/ssl_cert_ext_unittest.cc (+2/-2)
nss/gtests/ssl_gtest/ssl_cipherorder_unittest.cc (+241/-0)
nss/gtests/ssl_gtest/ssl_ciphersuite_unittest.cc (+19/-0)
nss/gtests/ssl_gtest/ssl_extension_unittest.cc (+1/-1)
nss/gtests/ssl_gtest/ssl_fuzz_unittest.cc (+1/-1)
nss/gtests/ssl_gtest/ssl_gtest.gyp (+1/-0)
nss/gtests/ssl_gtest/ssl_record_unittest.cc (+36/-0)
nss/gtests/ssl_gtest/ssl_recordsize_unittest.cc (+3/-2)
nss/gtests/ssl_gtest/ssl_renegotiation_unittest.cc (+23/-0)
nss/gtests/ssl_gtest/ssl_resumption_unittest.cc (+105/-13)
nss/gtests/ssl_gtest/tls_agent.cc (+21/-17)
nss/gtests/ssl_gtest/tls_agent.h (+7/-6)
nss/gtests/ssl_gtest/tls_esni_unittest.cc (+1/-1)
nss/gtests/ssl_gtest/tls_subcerts_unittest.cc (+243/-33)
nss/help.txt (+6/-0)
nss/lib/certdb/certdb.c (+6/-20)
nss/lib/certdb/certt.h (+15/-0)
nss/lib/certdb/stanpcertdb.c (+11/-12)
nss/lib/certhigh/certvfy.c (+43/-23)
nss/lib/ckfw/builtins/README (+62/-1)
nss/lib/ckfw/builtins/certdata.txt (+313/-630)
nss/lib/ckfw/builtins/manifest.mn (+2/-0)
nss/lib/ckfw/builtins/nssckbi.h (+2/-2)
nss/lib/ckfw/builtins/testlib/Makefile (+52/-0)
nss/lib/ckfw/builtins/testlib/builtins-testlib.gyp (+64/-0)
nss/lib/ckfw/builtins/testlib/certdata-testlib.txt (+479/-0)
nss/lib/ckfw/builtins/testlib/config.mk (+38/-0)
nss/lib/ckfw/builtins/testlib/manifest.mn (+25/-0)
nss/lib/ckfw/builtins/testlib/nssckbi-testlib.rc (+52/-0)
nss/lib/ckfw/builtins/testlib/testcert_err_distrust.txt (+50/-0)
nss/lib/ckfw/builtins/testlib/testcert_no_distrust.txt (+50/-0)
nss/lib/ckfw/builtins/testlib/testcert_ok_distrust.txt (+50/-0)
nss/lib/ckfw/manifest.mn (+1/-1)
nss/lib/freebl/Makefile (+29/-1)
nss/lib/freebl/aes-armv8.c (+1168/-0)
nss/lib/freebl/aes-armv8.h (+103/-0)
nss/lib/freebl/aeskeywrap.c (+2/-1)
nss/lib/freebl/blapi.h (+1/-0)
nss/lib/freebl/blinit.c (+49/-1)
nss/lib/freebl/chacha20poly1305.c (+5/-0)
nss/lib/freebl/cmac.c (+322/-0)
nss/lib/freebl/cmac.h (+47/-0)
nss/lib/freebl/ctr.c (+12/-0)
nss/lib/freebl/drbg.c (+90/-9)
nss/lib/freebl/ec.c (+1/-1)
nss/lib/freebl/ecl/curve25519_32.c (+4/-0)
nss/lib/freebl/exports.gyp (+1/-0)
nss/lib/freebl/freebl.gyp (+68/-0)
nss/lib/freebl/freebl_base.gypi (+1/-0)
nss/lib/freebl/gcm-aarch64.c (+96/-0)
nss/lib/freebl/gcm.c (+27/-2)
nss/lib/freebl/gcm.h (+6/-0)
nss/lib/freebl/intel-aes.h (+3/-3)
nss/lib/freebl/intel-gcm-wrap.c (+31/-0)
nss/lib/freebl/ldvector.c (+10/-1)
nss/lib/freebl/loader.c (+51/-0)
nss/lib/freebl/loader.h (+15/-1)
nss/lib/freebl/manifest.mn (+3/-0)
nss/lib/freebl/mpi/README (+1/-0)
nss/lib/freebl/mpi/mpcpucache.c (+1/-1)
nss/lib/freebl/mpi/mpi.c (+30/-12)
nss/lib/freebl/mpi/mpi.h (+10/-1)
nss/lib/freebl/pqg.c (+4/-4)
nss/lib/freebl/rijndael.c (+17/-4)
nss/lib/freebl/rsapkcs.c (+13/-10)
nss/lib/freebl/seed.c (+26/-7)
nss/lib/freebl/verified/FStar.c (+1/-1)
nss/lib/freebl/verified/FStar.h (+1/-1)
nss/lib/freebl/verified/Hacl_Chacha20.c (+1/-1)
nss/lib/freebl/verified/Hacl_Chacha20.h (+1/-1)
nss/lib/freebl/verified/Hacl_Chacha20_Vec128.c (+1/-1)
nss/lib/freebl/verified/Hacl_Chacha20_Vec128.h (+1/-1)
nss/lib/freebl/verified/Hacl_Curve25519.c (+1/-1)
nss/lib/freebl/verified/Hacl_Curve25519.h (+1/-1)
nss/lib/freebl/verified/Hacl_Poly1305_32.c (+1/-1)
nss/lib/freebl/verified/Hacl_Poly1305_32.h (+1/-1)
nss/lib/freebl/verified/Hacl_Poly1305_64.c (+1/-1)
nss/lib/freebl/verified/Hacl_Poly1305_64.h (+1/-1)
nss/lib/freebl/verified/kremlib.h (+1/-1)
nss/lib/freebl/verified/kremlib_base.h (+1/-1)
nss/lib/freebl/verified/vec128.h (+1/-1)
nss/lib/jar/jarfile.c (+26/-18)
nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapdefaultclient.c (+3/-2)
nss/lib/mozpkix/include/pkix/pkixder.h (+11/-0)
nss/lib/mozpkix/lib/pkixcert.cpp (+7/-12)
nss/lib/mozpkix/test-lib/pkixtestnss.cpp (+6/-5)
nss/lib/nss/nss.def (+7/-1)
nss/lib/nss/nss.h (+2/-2)
nss/lib/pk11wrap/debug_module.c (+2/-0)
nss/lib/pk11wrap/pk11cert.c (+87/-0)
nss/lib/pk11wrap/pk11load.c (+4/-6)
nss/lib/pk11wrap/pk11mech.c (+4/-0)
nss/lib/pk11wrap/pk11pk12.c (+4/-0)
nss/lib/pk11wrap/pk11pub.h (+8/-0)
nss/lib/pki/pki3hack.c (+42/-13)
nss/lib/smime/cmssiginfo.c (+82/-25)
nss/lib/softoken/fipstokn.c (+24/-4)
nss/lib/softoken/legacydb/lgattr.c (+1/-1)
nss/lib/softoken/pkcs11.c (+18/-8)
nss/lib/softoken/pkcs11c.c (+323/-69)
nss/lib/softoken/pkcs11i.h (+2/-2)
nss/lib/softoken/pkcs11u.c (+5/-18)
nss/lib/softoken/sdb.c (+1/-1)
nss/lib/softoken/softkver.h (+2/-2)
nss/lib/softoken/tlsprf.c (+1/-1)
nss/lib/sqlite/Makefile (+2/-0)
nss/lib/sqlite/README (+1/-1)
nss/lib/sqlite/sqlite.gyp (+9/-1)
nss/lib/sqlite/sqlite3.c (+90169/-52437)
nss/lib/sqlite/sqlite3.h (+3773/-611)
nss/lib/ssl/ssl3con.c (+283/-154)
nss/lib/ssl/ssl3ext.c (+3/-0)
nss/lib/ssl/ssl3exthandle.c (+8/-3)
nss/lib/ssl/sslexp.h (+39/-0)
nss/lib/ssl/sslimpl.h (+10/-6)
nss/lib/ssl/sslsock.c (+115/-0)
nss/lib/ssl/sslt.h (+7/-1)
nss/lib/ssl/tls13con.c (+23/-16)
nss/lib/ssl/tls13esni.c (+1/-1)
nss/lib/ssl/tls13subcerts.c (+184/-11)
nss/lib/util/nssutil.h (+2/-2)
nss/lib/util/pkcs11n.h (+2/-0)
nss/lib/util/pkcs11t.h (+3/-0)
nss/lib/util/quickder.c (+1/-1)
nss/lib/util/utilmod.c (+4/-1)
nss/mach (+11/-3)
nss/nss.gyp (+3/-0)
nss/tests/all.sh (+3/-9)
nss/tests/cert/cert.sh (+1/-1)
nss/tests/common/certsetup.sh (+9/-2)
nss/tests/common/cleanup.sh (+9/-2)
nss/tests/fips/cavs_scripts/aes.sh (+2/-0)
nss/tests/fips/cavs_scripts/aesgcm.sh (+2/-0)
nss/tests/fips/cavs_scripts/dsa.sh (+2/-0)
nss/tests/fips/cavs_scripts/ecdsa.sh (+2/-0)
nss/tests/fips/cavs_scripts/hmac.sh (+3/-0)
nss/tests/fips/cavs_scripts/ike.sh (+2/-0)
nss/tests/fips/cavs_scripts/kas.sh (+2/-0)
nss/tests/fips/cavs_scripts/rng.sh (+3/-0)
nss/tests/fips/cavs_scripts/rsa.sh (+2/-0)
nss/tests/fips/cavs_scripts/sha.sh (+2/-0)
nss/tests/fips/cavs_scripts/tdea.sh (+2/-0)
nss/tests/fips/cavs_scripts/tls.sh (+3/-0)
nss/tests/policy/policy.sh (+1/-1)
nss/tests/smime/smime.sh (+213/-22)
nss/tests/ssl/ssl.sh (+64/-9)
nss/tests/ssl_gtests/ssl_gtests.sh (+1/-0)
nss/tests/tlsfuzzer/config.json.in (+20/-0)
nss/tests/tlsfuzzer/tlsfuzzer.sh (+3/-3)
Conflict in debian/changelog
Reviewer Review Type Date Requested Status
Canonical Server Pending
Canonical Server Core Reviewers Pending
Review via email: mp+374996@code.launchpad.net

This proposal has been superseded by a proposal from 2019-11-04.

Description of the change

Merge version 2:3.47-1 from Debian. The delta from version 2:3.45-1ubuntu2 was applied on top of this new release:

* d/libnss3.links: make freebl3 available as library
* d/control: add dh-exec to Build-Depends
* d/rules: make mkdir tolerate debian/tmp existing (due to dh-exec)
* Disable reading fips_enabled flag in FIPS mode. libnss is not a FIPS certified library.

According to upstream release notes the library in this new release is compatible with the version we have in the archive, so the version bump should not be a problem.

To post a comment you must log in.

Unmerged commits

3d3a453... by Lucas Kanashiro

update-maintainer

21cd5df... by Lucas Kanashiro

reconstruct-changelog

fb66659... by Lucas Kanashiro

merge-changelogs

40d0445... by Lucas Kanashiro

    - Disable reading fips_enabled flag in FIPS mode. libnss is
      not a FIPS certified library. (LP: #1837734)

4ad6ffe... by Lucas Kanashiro

    - d/rules: make mkdir tolerate debian/tmp existing (due to dh-exec)

b59cfb2... by Lucas Kanashiro

    - d/control: add dh-exec to Build-Depends

459c5ba... by Lucas Kanashiro

    - d/libnss3.links: make freebl3 available as library (LP: #1744328)

02f7959... by Mike Hommey <email address hidden>

Import patches-unapplied version 2:3.47-1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: f4b87b1e16a7e93b79bb7b251d3b51f01766f2ae

New changelog entries:
  * New upstream release.
  * debian/libnss3.symbols: Add NSS_3_47 symbol version.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 27fda7e..7e08155 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,24 @@
1<<<<<<< debian/changelog
2=======
3nss (2:3.47-1ubuntu1) focal; urgency=medium
4
5 * Merge with Debian unstable. Remaining changes:
6 - d/libnss3.links: make freebl3 available as library (LP #1744328)
7 - d/control: add dh-exec to Build-Depends
8 - d/rules: make mkdir tolerate debian/tmp existing (due to dh-exec)
9 - Disable reading fips_enabled flag in FIPS mode. libnss is
10 not a FIPS certified library. (LP #1837734)
11
12 -- Lucas Kanashiro <lucas.kanashiro@canonical.com> Thu, 31 Oct 2019 16:18:35 -0300
13
14nss (2:3.47-1) unstable; urgency=medium
15
16 * New upstream release.
17 * debian/libnss3.symbols: Add NSS_3_47 symbol version.
18
19 -- Mike Hommey <glandium@debian.org> Wed, 23 Oct 2019 11:19:59 +0900
20
21>>>>>>> debian/changelog
1nss (2:3.45-1ubuntu2) eoan; urgency=medium22nss (2:3.45-1ubuntu2) eoan; urgency=medium
223
3 * Disable reading fips_enabled flag in FIPS mode. libnss is24 * Disable reading fips_enabled flag in FIPS mode. libnss is
diff --git a/debian/libnss3.symbols b/debian/libnss3.symbols
index e4da3e8..4bc778e 100644
--- a/debian/libnss3.symbols
+++ b/debian/libnss3.symbols
@@ -59,6 +59,7 @@ libnss3.so libnss3 #MINVER#
59 (symver)NSS_3.43 2:3.44.059 (symver)NSS_3.43 2:3.44.0
60 (symver)NSS_3.44 2:3.44.060 (symver)NSS_3.44 2:3.44.0
61 (symver)NSS_3.45 2:3.4561 (symver)NSS_3.45 2:3.45
62 (symver)NSS_3.47 2:3.47
62 (symver)NSS_3.5 2:3.13.4-2~63 (symver)NSS_3.5 2:3.13.4-2~
63 (symver)NSS_3.6 2:3.13.4-2~64 (symver)NSS_3.6 2:3.13.4-2~
64 (symver)NSS_3.7 2:3.13.4-2~65 (symver)NSS_3.7 2:3.13.4-2~
diff --git a/nss/.hg_archival.txt b/nss/.hg_archival.txt
index 7c3f115..032d2c2 100644
--- a/nss/.hg_archival.txt
+++ b/nss/.hg_archival.txt
@@ -1,4 +1,4 @@
1repo: 9949429068caa6bb8827a8ceeaa7c605d722f47f1repo: 9949429068caa6bb8827a8ceeaa7c605d722f47f
2node: 93ad9d963f4c773ea210b20af50198331ccd86392node: 7ccb4ade557739620b060c173d8660c502e53034
3branch: NSS_3_45_BRANCH3branch: NSS_3_47_BRANCH
4tag: NSS_3_45_RTM4tag: NSS_3_47_RTM
diff --git a/nss/.taskcluster.yml b/nss/.taskcluster.yml
index 4d5117e..05bade9 100644
--- a/nss/.taskcluster.yml
+++ b/nss/.taskcluster.yml
@@ -55,7 +55,7 @@ tasks:
55 image: djmitche/nss-decision:0.0.355 image: djmitche/nss-decision:0.0.3
5656
57 env:57 env:
58 TC_OWNER: "${push.owner}"58 TC_OWNER: "${ownerEmail}"
59 TC_SOURCE: "${repository.url}"59 TC_SOURCE: "${repository.url}"
60 TC_PROJECT: ${repository.project}60 TC_PROJECT: ${repository.project}
61 TC_SCHEDULER_ID: "${schedulerId}"61 TC_SCHEDULER_ID: "${schedulerId}"
diff --git a/nss/Makefile b/nss/Makefile
index 4a80ebd..2dc8de1 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -135,6 +135,7 @@ endif
135135
136build_nspr: $(NSPR_CONFIG_STATUS)136build_nspr: $(NSPR_CONFIG_STATUS)
137 $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)137 $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
138 $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)/pr/tests
138139
139install_nspr: build_nspr140install_nspr: build_nspr
140 $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) install141 $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) install
diff --git a/nss/automation/abi-check/expected-report-libnss3.so.txt b/nss/automation/abi-check/expected-report-libnss3.so.txt
index 76d0de6..ee06510 100644
--- a/nss/automation/abi-check/expected-report-libnss3.so.txt
+++ b/nss/automation/abi-check/expected-report-libnss3.so.txt
@@ -1,4 +1,33 @@
1
21 Added function:11 Added function:
32
4 'function SECStatus PK11_FindRawCertsWithSubject(PK11SlotInfo*, SECItem*, CERTCertificateList**)' {PK11_FindRawCertsWithSubject@@NSS_3.45}3 'function CERTCertList* PK11_GetCertsMatchingPrivateKey(SECKEYPrivateKey*)' {PK11_GetCertsMatchingPrivateKey@@NSS_3.47}
4
53 functions with some indirect sub-type change:
6
7 [C]'function SECStatus CERT_AddCertToListHead(CERTCertList*, CERTCertificate*)' at certdb.c:2631:1 has some indirect sub-type changes:
8 parameter 2 of type 'CERTCertificate*' has sub-type changes:
9 in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
10 underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
11 type size changed from 6016 to 6080 (in bits)
12 1 data member insertion:
13 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
14 no data member changes (2 filtered);
15
16 [C]'function SECStatus CERT_CacheOCSPResponseFromSideChannel(CERTCertDBHandle*, CERTCertificate*, PRTime, const SECItem*, void*)' at ocsp.c:5102:1 has some indirect sub-type changes:
17 parameter 2 of type 'CERTCertificate*' has sub-type changes:
18 in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
19 underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
20 type size changed from 6016 to 6080 (in bits)
21 1 data member insertion:
22 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
23 no data member change (1 filtered);
24
25 [C]'function CERTCertificateList* CERT_CertChainFromCert(CERTCertificate*, SECCertUsage, PRBool)' at certhigh.c:1030:1 has some indirect sub-type changes:
26 parameter 1 of type 'CERTCertificate*' has sub-type changes:
27 in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
28 underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
29 type size changed from 6016 to 6080 (in bits)
30 1 data member insertion:
31 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
32 no data member changes (2 filtered);
33
diff --git a/nss/automation/abi-check/expected-report-libsmime3.so.txt b/nss/automation/abi-check/expected-report-libsmime3.so.txt
index e69de29..b57a98a 100644
--- a/nss/automation/abi-check/expected-report-libsmime3.so.txt
+++ b/nss/automation/abi-check/expected-report-libsmime3.so.txt
@@ -0,0 +1,11 @@
11 function with some indirect sub-type change:
2
3 [C]'function CERTCertificate* CERT_ConvertAndDecodeCertificate(char*)' at certread.c:219:1 has some indirect sub-type changes:
4 return type changed:
5 in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
6 underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
7 type size changed from 6016 to 6080 (in bits)
8 1 data member insertion:
9 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
10
11
diff --git a/nss/automation/abi-check/expected-report-libssl3.so.txt b/nss/automation/abi-check/expected-report-libssl3.so.txt
index 9f2f796..2c3aff4 100644
--- a/nss/automation/abi-check/expected-report-libssl3.so.txt
+++ b/nss/automation/abi-check/expected-report-libssl3.so.txt
@@ -1,22 +1,10 @@
11 function with some indirect sub-type change:
12
22 functions with some indirect sub-type change:3 [C]'function SECStatus NSS_CmpCertChainWCANames(CERTCertificate*, CERTDistNames*)' at cmpcert.c:25:1 has some indirect sub-type changes:
34 parameter 1 of type 'CERTCertificate*' has sub-type changes:
4 [C]'function SECStatus SSL_ConfigServerCert(PRFileDesc*, CERTCertificate*, SECKEYPrivateKey*, const SSLExtraServerCertData*, unsigned int)' at sslcert.c:640:1 has some indirect sub-type changes:5 in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
5 parameter 4 of type 'const SSLExtraServerCertData*' has sub-type changes:6 underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
6 in pointed to type 'const SSLExtraServerCertData':7 type size changed from 6016 to 6080 (in bits)
7 in unqualified underlying type 'typedef SSLExtraServerCertData' at sslt.h:291:1:
8 underlying type 'struct SSLExtraServerCertDataStr' at sslt.h:256:1 changed:
9 type size changed from 256 to 384 (in bits)
10 2 data member insertions:
11 'const SECItem* SSLExtraServerCertDataStr::delegCred', at offset 256 (in bits) at sslt.h:283:1
12 'const SECKEYPrivateKey* SSLExtraServerCertDataStr::delegCredPrivKey', at offset 320 (in bits) at sslt.h:290:1
13
14 [C]'function SECStatus SSL_GetChannelInfo(PRFileDesc*, SSLChannelInfo*, PRUintn)' at sslinfo.c:13:1 has some indirect sub-type changes:
15 parameter 2 of type 'SSLChannelInfo*' has sub-type changes:
16 in pointed to type 'typedef SSLChannelInfo' at sslt.h:357:1:
17 underlying type 'struct SSLChannelInfoStr' at sslt.h:272:1 changed:
18 type size hasn't changed
19 1 data member insertion:8 1 data member insertion:
20 'PRBool SSLChannelInfoStr::peerDelegCred', at offset 928 (in bits) at sslt.h:353:19 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
21
2210
diff --git a/nss/automation/abi-check/previous-nss-release b/nss/automation/abi-check/previous-nss-release
index c6d6c97..3215111 100644
--- a/nss/automation/abi-check/previous-nss-release
+++ b/nss/automation/abi-check/previous-nss-release
@@ -1 +1 @@
1NSS_3_44_BRANCH1NSS_3_46_BRANCH
diff --git a/nss/automation/release/nspr-version.txt b/nss/automation/release/nspr-version.txt
index b91871c..7ae4833 100644
--- a/nss/automation/release/nspr-version.txt
+++ b/nss/automation/release/nspr-version.txt
@@ -1,4 +1,4 @@
14.2114.23
22
3# The first line of this file must contain the human readable NSPR3# The first line of this file must contain the human readable NSPR
4# version number, which is the minimum required version of NSPR4# version number, which is the minimum required version of NSPR
diff --git a/nss/automation/taskcluster/docker-gcc-4.4/Dockerfile b/nss/automation/taskcluster/docker-gcc-4.4/Dockerfile
index 6953832..55344e5 100644
--- a/nss/automation/taskcluster/docker-gcc-4.4/Dockerfile
+++ b/nss/automation/taskcluster/docker-gcc-4.4/Dockerfile
@@ -9,6 +9,7 @@ RUN apt-get update \
9 gcc-4.4 \9 gcc-4.4 \
10 locales \10 locales \
11 make \11 make \
12 patch \
12 mercurial \13 mercurial \
13 zlib1g-dev \14 zlib1g-dev \
14 && rm -rf /var/lib/apt/lists/* \15 && rm -rf /var/lib/apt/lists/* \
diff --git a/nss/automation/taskcluster/docker-hacl/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc b/nss/automation/taskcluster/docker-hacl/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc
15new file mode 10064416new file mode 100644
index 0000000..513dcd4
--- /dev/null
+++ b/nss/automation/taskcluster/docker-hacl/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc
@@ -0,0 +1,143 @@
1-----BEGIN PGP PUBLIC KEY BLOCK-----
2
3mQINBFS+1SABEACnmkESkY7eZq0GhDjbkWpKmURGk9+ycsfAhA44NqUvf4tk1GPM
45SkJ/fYedYZJaDVhIp98fHgucD0O+vjOzghtgwtITusYjiPHPFBd/MN+MQqSEAP+
5LUa/kjHLjgyXxKhFUIDGVaDWL5tKOA7/AQKl1TyJ8lz89NHQoUHFsF/hu10+qhJe
6V65d32MXFehIUSvegh8DrPuExrliSiORO4HOhuc6151dWA4YBWVg4rX5kfKrGMMT
7pTWnSSZtgoRhkKW2Ey8cmZUqPuUJIfWyeNVu1e4SFtAivLvu/Ymz2WBJcNA1ZlTr
8RCOR5SIRgZ453pQnI/Bzna2nnJ/TV1gGJIGRahj/ini0cs2x1CILfS/YJQ3rWGGo
9OxwG0BVmPk0cmLVtyTq8gUPwxcPUd6WcBKhot3TDMlrffZACnQwQjlVjk5S1dEEz
10atUfpEuNitU9WOM4jr/gjv36ZNCOWm95YwLhsuci/NddBN8HXhyvs+zYTVZEXa2W
11l/FqOdQsQqZBcJjjWckGKhESdd7934+cesGD3O8KaeSGxww7slJrS0+6QJ8oBoAB
12P/WCn/y2AiY2syEKp3wYIGJyAbsm542zMZ4nc7pYfSu49mcyhQQICmqN5QvOyYUx
13OSqwbAOUNtlOyeRLZNIKoXtTqWDEu5aEiDROTw6Rkq+dIcxPNgOLdeQ3HwARAQAB
14tCFIYW5zIFdlbm5ib3JnIDxoYW5zQGNocm9taXVtLm9yZz6JARwEEAECAAYFAlT2
15MQAACgkQVfXNcLtaBWnDKgf/fjusXk+kh1zuyn5eOCe16+2vV1lmXZrDIGdJtXDW
16ZtHKele1Yv1BA3kUi5tKQi+VOOrvHL0+TMjFWFiCy1sYJS9qgkS08kReI2nAnhZ7
17INdqEVxtVk1TTOhtYjOPy6txwujoICuPv5F4rHVhn1LPKGTLtYD2LOwf/8eKYQox
1851gaJ8dNxpcHE/iFOIDXdebJPufo3EhqDRihchxb8AVLhrNss7pGGG/tVfichmHK
19djPT2KfSh14pq1ahFOz0zH4nmTu7CCLnLAdRBHuhL8HVDbi0vKBtCiSmQggdxvoj
20u+hpXiiDFQoCjLh0zVCwtFqWDZbnKMTBNNF26aTmQ+2fiYkBMwQQAQgAHRYhBB/m
21NI7eqCWiKXDlxI3TBA8SPMP0BQJbcLU1AAoJEI3TBA8SPMP021sH/jD1m7azNCN6
22DVL1iDJT6uIIYCTylygH5XI46CRoWaz/LwdFnUqWHHTcQxJ5pIkWV9KF+SIgMT42
23brdZZmNvvSdX0odjFKqj5UR6w+wDN+uZ6Q40zu4pNoNzbk7pRpbFf1XIfGB1liyu
24m28EJ58IXu/0AV7FiDAHGGBqppK/cwQN8pGLwmz1n6YELtXeFmtOGnusO6iLYOE7
253ByFCCqJB6twT5+7dDqFYqqQJgQ6jDTy19dDZ1vDhDttL+2Rn0OYXqPw7gy/1D2p
26Y1cM9PgPBsR4EXhbtV0uKUNomk8tM/HnGMFT0KirI/tSwEP3v9g5YH992mrvNuIV
27TkyQn0jGeMeJATMEEAEIAB0WIQRswFHTwdmkr54mDFjT45SsdE4uuwUCW3haCQAK
28CRDT45SsdE4uu4JjCACppkreiMrpJSREKbUscdOvFxFRYzkTFeSCwX9Ih7r5ENpa
29zjczfIqCCfWzioV6y4K0V04y8CXt/5S5a9vfW801pBUdF9nG4X8YbUn/xSe+8A9m
30MsfDjMNcF7Cp5czVoSS4/4oHm9mQUMYQsn3AwwCPDKFORRRv5Eb0om9JawKtt++7
31ZW0fOgDkvOCm14SN0UtVc4mxTx6iyxdMDgrKinBZVjxEh5oeqUyXh5TYM+XyWFVh
32/gDUvUWwLI0GUWNTyOyUQU1oPVp+sWqrEe1BXLVCKFVWaSTtgJtJ5FyP+z2uzRcv
33aanPOj/ohHAo8VBq9QbefYVAkShNBEuJkATnXhcGiQEzBBABCAAdFiEEvlzFWRM6
344JjNAb2a+j2ZL9Cqr7wFAlkBCcIACgkQ+j2ZL9Cqr7yB9AgArj+0+i0DCo1nm4MF
35TLnW1Y9GF/Hq/mBva1MhkT0j3BzENK3xgqrqac8KqupsporNEmJ0ZbZzilJdZImb
36o4X5BFdmmnjMiGaH6GAiPqRBBHGvLV2r2pG467J4tOMWO3XipFRf7FibbfhAU1lV
37/GLWYTSwLqwWwBE8u5rriEvDngWUJw2Yd4Yqwduef7O6F+JfsGPRXFomR3387II0
388AXo/C+P5cl64llaxV6BmkJhQ6ydL0/KwSkHVdlXugk1sPtV/qOyPQ5L1Ibqbsvh
39lLq/jhHlUUNLFjlQ2lrS9bhHGw9OIHTMJvS8RDrk0yAmoHAyRWNgbFN7aA62vBhq
40pcUVzokBMwQQAQgAHRYhBPZ+fW6ADyQOg+vIZ/9qyaZGTfCcBQJa+ZAwAAoJEP9q
41yaZGTfCcKMgH/jRxGfYhhGnlMnDLAEpYC+TGSDLMgmg9cOZbonqyMv+7Kts+pV03
42KUr9SPV+VtGtOxRNiqwFt6V2MHcwPJfTXuH/bBW/HCCpr6UlOVWqIiCNK0Gnpcj5
43rRt5unjG9CwsgyaK9QPI8bGin/c6m8BjwmEdfJ01ATLiUb8WuDHQy9OCyrEAnzSq
44FD5ZtFmAFxvzm2x1nwb5HPuqkOqbRatp8aRJzTxIeSJPpgLw0PawHKGN3Ckp7REc
45g26P1spkPe7SIVRsobH3al4uw7mgs7wiDWN3t8CdmuHAzmB2UrsR84JMTb45GboO
46Bc1CX8xZcHyNaDEpyWHav+P8nZqwfBm+cLiJAjMEEAEIAB0WIQSawVDb4dGOtiX0
47+gWyD0lU8+/LPwUCW/4O9QAKCRCyD0lU8+/LPyI7EACWtj0GEb1VT02gKwtKwgFn
48RJ2pz8vYm188wgJwCJaL04d2D/VwE0jMvmfH80hSKgSLPAVMG06RIOb/tGhHsQKU
49zBlHiAFmfjlJo1FC/Mp44RrERRsFAWBg0/URIs4vP8+5Vl+5m70sZrQpKeq+6TLM
501dQ0Ohz+QkQ04Z+DTroChWU8/7Uw0E3CqGGKYqPvDh54T1q4s8FoN0no8ZUlt/O+
51r/3c7awr85ZnxqtnHIcuMbVyIZ+gOqXdrLa85yZITsh4zQrjYuyTEg7dpziReyiZ
52+rkpdIdFKl8YeD+d0JWzVm7kq9D4K3+x9C509z0IgJUT3bhsX/N0Yf/QUtUW5oxI
53T7fod86B/Q2M7zBTttFhd1vAjiSjEalK48SjTzWqTDYVIkea1+f1kZK5A0QlthqG
54P2zy5GUjZVzOiCSOhyEOvAorU3zKD2s84VFKlayZEqlHJh8u5U59TWBdkW3qZUJd
55ewW31xt0s8IovYSgOwX3wbsClQs6eVwNuCZT2yQAgAyXA5iFztBvDRQ0qmetvzV2
56Ay9SrjvkQ3qr/eZmbMErEwEUxIO4b1rctCQ6jcbyVxMTAZAfaDoVKWEMXNiF2KSw
57F9SSzGPIZDgiEXUlgaJBlUIYSFxrPuE+da0CM5RixyYIinU6AER6crl9C4C9XL6a
58u3jf+5MTGxviRGn2oQzSCYkCMwQQAQgAHRYhBKeHFU4z7cw4HFbYuaxFYRTTj42I
59BQJboq6kAAoJEKxFYRTTj42IWIAP/3rc9GjDTM4nI6Oi4OzLkwm/I2Vr7LUKG8oX
608E4Nj3amvNGupzGySjB+vrM6APrMSScXunvM0f19LV84EnNrUQ3KFZcSC6r5WC0B
612+TVRYGpY+6R9AQpqnuxicW0sa/AlV9WSEb4fDavCel2nW0arH4wkkCzTThUxoBB
62X4I9nf4ZzGoUnnDAwTD9rN0gpI6Td/7faa3t99dRLb6AHJ1KhvyiiV3lr0xtTssD
63xVHo0SpzQTnOcRJnYf/2rTny8bVfROPWieh6HuEiP7SxT1HyeTr4WSAjSCoG95O2
64b3OgSMl0Z82FRMoJYmxID/V5YqH7015SjCxKdYhEZVp9YwWruEJIH8r6MGbWYNAl
65REnyDvfGzAF0L0+gAUymDRmtp1jeXLo+HmLgVEUWegafs1TPfCWS/H9n10Upjmuq
66akituzacz6Kjleq9qbnl81Xmh4AKmOILRwE7Pmcbl8HATOrmi5EaKffjMdWFzOWh
673U4/VsNDujqSTXD88EjGcpLiIiYefGy0sURJbIMTkfXVt3ruHLyuvhsRE/2QEAi7
68gWB0zuBV8iGBaag+6RQkxGdpemPiogzuDijqZHoUXlp7Q6IYLanXeweyivdrSyTB
694HOECDbWEPZwk6tCxnuklW5iJndxBmxjSxefIMGU7G2JS9quppCVFCrKUjIWnf7b
70gXnNji5JiQIzBBABCAAdFiEExZuSbLy7rtFhdiOuHt8NuZ2LeoQFAluirpUACgkQ
71Ht8NuZ2LeoR/gQ/6A71JxUavzyBlCXlMy2Hx2+gOfy68b8UWl7DwKTOBSoZOzPC7
72dVCSTzoK8dRELqsp7CkFImWcEwLJWMptuH2I1nK+Ua8bvxJSMJnOlPxYE8Wz5EK3
73SQ2mQvifRezQTe8zjdpxEDSR6xocSiigvJow4X+Mivrxxj8sMgu1KA1ud2VGX/IR
74wMbwuBTH9YydgvzmFzTxdlJHEYmsI8koHrVWPHm//QqqPBn+qz2z9uAzDmGAiDYg
75qtQijo5IJC8ZjxgdcTfCkN6he+GhHtOhyP/KF/FcRHY83DoNCtqexQZWGuKtbd8o
76nQYtmemRFob5kR7GxuNdAqF74oQfXcvXZNtHSuN3VtLqkB4fzW+21JBJCsP3XCzd
77nKjR4erXNrQycmp3shSoJbnVvdbDwaVlWhDen1DvJb0Lj2sO3PQPcwVQbf5XHWR/
78ZCf2OQTfVgwFEB4/0Twv70XwYIui2Ry9hmTPbD4Nn+UXbMQ3SOp90tj/e2yY/MFt
79FvcIYcJTk9LM5IsnKgh+fSWDmdS3HD5Kjv2EPUHTNalruwwfmhS+ScJwM4XqHTJY
80JkB16j/Xv2FTF+6KlbA1zdOVycPzoFKjAENYccQBVo2B+WQac7dFDqGEVNal9z66
81DyU4ciAHl6PsbuN7DWeuScLoqq5jwx61bZgn71mUOYC1/47ypat2BKCOXZ2JAjME
82EgEIAB0WIQSm5op4O95BdGcqQkHwXKpE5VGK/wUCWie53AAKCRDwXKpE5VGK/3rM
83D/9jcYKOjYaPJh3Q7wNC1HjjUa73eo5GvJqyXbsXufIh/RAYgQkD08P5JgzfXvQ0
84zOQTtDlDTVG8VMFoBYeMJVDd0k9LBbaljxcttMPfOll+AlQGAL7iQIqTAndknkJL
85CFdl0ypa5GVsl1tzqmNC5fuMJ3vBoRtYbMitlHQkO0vLjZ7yl9fz+7YkREpEo/d5
86Ya8t4+L6el6lrETYaiGCTxHcbYD7VdiJxpxFQlpgl+XKtobrj70RocGQ5JwUNilC
87nRJKUb33lbmntwDwQ1y1AjCnhB++3GHjJDXBPgYFDCSZPCndKeOXhxmB2psFf41i
888foJPJXuh1vWOqArdwseFCRM6W2deF1utZmROMSkUo6IC8dYlucO/hjpjhG+C8Zv
89QiM5uLylD3IPMX9wCz1tAhMNs3v4pEPo/4A//1cdLkor9cQVLFj3+TkS888EWZdj
90Y8mUTIXU6yL1DXcj8CfDPS29fMpDorDpK1swl4pN5qgGfsL5BSAXUf1AZDWbxnEY
91xf5rakfHDzrfbtbTSSfrBxS8gdW2vBKM+3nL21BeP8hQ0tkLA7bn2fNGz3aCOw46
92XeVJdBk1gVTwazspylqrh1ljr0hQEN4gs/8kM645BRdD0IyAFFcI44VmuVwd8+2g
935miAGmVKSqN77w2cgMRnF7xpUsanv+3zKzaTnG+2liTeCokCPgQTAQIAKAUCVL7V
94IAIbAwUJBaOagAYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQD8MELjRa0F1m
95RhAAj9X+/4iiQsN888dNW/H1wEFFTd/1vqb2j0sHP3t02LkEPN5Ii9u71TSD2gSD
96WTu1Eb46nRDcapFNv5M0vXcWrEt7PK9b51Kuj4KpP5IjJHpTl2g7umaYQWC8fqcY
97TJTH0guMSCzZlsP0xGLbAj3cG6X5OPzCO+IxEafXmE//SfS9w46n1OC57ca1Y0Fp
98WXfjA0sJrcozgNchsptu3jg/oEteYJoxDAzNO45O4geNONq5D9PUQPb+H5Vv5zpy
99MI7iUJhVnTOFvnoUgRS7v6pWiA3flh5FelK8tYPCzEfvxfe7EB5GO7MaJEO3ZLni
100COaAZ3Nfn6Tt28tCOgd052W4FeGWow7iYCS1Wgd30bq/FNgnl+tKv2woxmWt4jJv
101ioBHQ4PbUnap2RCmBFaG7llRkrKP8nhWSUdwSS3OmDwAfxTTXjPaESK9EX9OV9Xo
102or07thq+7OMs+2cyiy2jSfIau0SELy/tVioZBhoB7hzAJUB8sGHOxMPlVDFdUr3x
103F/cgCclWANhw2xvgPim1wQ0XpeZe6w9RpmjZR7ReMYwxn8APBDP/e9R5aLDUQAep
1042hrJUPK38D0L69RnpWQsR9hZ2hEOrMV2M6ChlvhwHbGSdJ2CcqG5Jx4ZAP23DK3A
105N26TB88H9F7IMrM0REZeu7KzvYwCWlpg0zMXXKQ/2vovoe2JAlUEEwECAD8CGwMG
106CwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAFiEEtsj5goK5ROOw1cJTD8MELjRa0F0F
107Alpd+i0FCQ8FJo0ACgkQD8MELjRa0F3X3A//dBQLm6GmXlQFjxZbukTw0lZsevFR
108M/6ljZTxp7bsC+HFzYoaCKv6rikaWzytxk//SOaLKrB4Z9HjAlpBMtyLl2Hk7tcZ
109bPpFafNmQ+4KgWNjLXCvt9se8BGrQvGQUrbE6YowbXa2YIgxIVEncFzIECAsp/+N
110xbMcZN5/X1PJxKi/N22gP4nn47muN6L3pKez3CXgWnhGYSc7BuD5ALWYH7yMYUem
111d4jlXfu5xkBIqirj1arIYC9wmF4ldbLNDPuracc8LmXcSqa5Rpao0s4iVzAD+tkX
112vE/73m3rhepwBXxrfk0McXuI9aucf5h4/KkIBzZsaJ6JM1tzlrJzzjaBKJF9OI5T
113jA0qTxdGzdPztS8gPaPcMkRFfh9ti0ZDx4VeF3s8sOtmMRHeGEWfxqUAbBUbwFsa
114JDu/+8/VO4KijfcuUi8tqJ/JHeosCuGE7TM93LwJu6ZcqMYOPDROE/hsnGm0ZU92
115xedu+07/X1ESHkSFPoaSHD5/DCNa/tXIyJZ8X7gF3eoDP5mSmrJqIqsOBR9WOVYv
116dI8i0GHTXbrZj8WXdoS+N8wlyMLLbAS2jvTe7M5RoqbLz4ABOUUnLVoEE0CiccVZ
117bW75BPxOfaD0szbinAeX6HDPI7St0MbKrRPjuDXjD0JVkLqFINtZfYLGMLss4tgn
118suefr0Bo9ISwG3u5Ag0EVL7VIAEQAOxBxrQesChjrCqKjY5PnSsSYpeb4froucrC
119898AFw2DgN/Zz+W7wtSTbtz/GRcCurjzZvN7o2rCuNk0j0+s1sgZZm2BdldlabLy
120+UF/kSW1rb5qhfXcGGubu48OMdtSfok9lOc0Q1L4HNlGE4lUBkZzmI7Ykqfl+Bwr
121m9rpi54g4ua9PIiiHIAmMoZIcbtOG1KaDr6CoXRk/3g2ZiGUwhq3jFGroiBsKEap
1222FJ1bh5NJk2Eg8pV7fMOF7hUQKBZrNOtIPu8hA5WEgku3U3VYjRSI3SDi6QXnDL+
123xHxajiWpKtF3JjZh8y/CCTD8PyP34YjfZuFmkdske5cdx6H0V2UCiH453ncgFVdQ
124DXkY4n+0MTzhy2xu0IVVnBxYDYNhi+3MjTHJd9C4xMi9t+5IuEvDAPhgfZjDpQak
125EPz6hVmgj0mlKIgRilBRK9/kOxky9utBpGk3jEJGru/hKNloFNspoYtY6zATAr8E
126cOgoCFQE0nIktcg3wF9+OCEnV28/a7XZwUZ7Gl/qfOHtdr374wo8kd8R3V8d2G9q
1275w0/uCV9NNQ0fGWZDPDoYt6wnPL6gZv/nJM8oZY+u0rC24WwScZIniaryC4JHDas
128Ahr2S2CtgCvBgslK6f3gD16KHxPZMBpX73TzOYIhMEP/vXgVJbUD6dYht+U9c4Oh
129EDJown0dABEBAAGJAjwEGAECACYCGwwWIQS2yPmCgrlE47DVwlMPwwQuNFrQXQUC
130Wl36SwUJDwUmqwAKCRAPwwQuNFrQXT1/D/9YpRDNgaJl3YVDtVZoeQwh7BQ6ULZT
131eXFPogYkF2j3VWg8s9UmAs4sg/4a+9KLSantXjX+JFsRv0lQe5Gr/Vl8VQ4LKEXB
132fiGmSivjIZ7eopdd3YP2w6G5T3SA4d2CQfsg4rnJPnXIjzKNiSOi368ybnt9fL0Y
1332r2aqLTmP6Y7issDUO+J1TW1XHm349JPR0Hl4cTuNnWm4JuX2m2CJEc5XBlDAha9
134pUVs+J5C2D0UFFkyeOzeJPwy6x5ApWHm84n8AjhQSpu1qRKxKXdwei6tkQWWMHui
135+TgSY/zCkmD9/oY15Ei5avJ4WgIbTLJUoZMi70riPmU8ThjpzA7S+Nk0g7rMPq+X
136l1whjKU/u0udlsrIJjzkh6ftqKUmIkbxYTpjhnEujNrEr5m2S6Z6x3y9E5QagBMR
137dxRhfk+HbyACcP/p9rXOzl4M291DoKeAAH70GHniGxyNs9rAoMr/hD5XW/Wrz3dc
138KMc2s555E6MZILE2ZiolcRn+bYOMPZtWlbx98t8uqMf49gY4FGQBZAwPglMrx7mr
139m7HTIiXahThQGOJg6izJDAD5RwSEGlAcL28T8KAuM6CLLkhlBfQwiKsUBNnh9r8w
140V3lB+pV0GhL+3i077gTYfZBRwLzjFdhm9xUKEaZ6rN1BX9lzix4eSNK5nln0jUq1
14167H2IH//2sf8dw==
142=fTDu
143-----END PGP PUBLIC KEY BLOCK-----
0\ No newline at end of file144\ No newline at end of file
diff --git a/nss/automation/taskcluster/docker-hacl/Dockerfile b/nss/automation/taskcluster/docker-hacl/Dockerfile
index 50f2be2..168be1c 100644
--- a/nss/automation/taskcluster/docker-hacl/Dockerfile
+++ b/nss/automation/taskcluster/docker-hacl/Dockerfile
@@ -9,9 +9,10 @@ ENV haclrepo https://github.com/mitls/hacl-star.git
99
10# Define versions of dependencies10# Define versions of dependencies
11ENV opamv 4.05.011ENV opamv 4.05.0
12ENV haclversion 1da331f9ef30e13269e45ae73bbe4a4bca679ae612ENV haclversion 1442c015dab97cdf203ae238b1f3aeccf511bd1e
1313
14# Install required packages and set versions14# Install required packages and set versions
15ADD B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc /tmp/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc
15ADD setup.sh /tmp/setup.sh16ADD setup.sh /tmp/setup.sh
16RUN bash /tmp/setup.sh17RUN bash /tmp/setup.sh
1718
diff --git a/nss/automation/taskcluster/docker-hacl/setup.sh b/nss/automation/taskcluster/docker-hacl/setup.sh
index f5f8bd7..491342e 100644
--- a/nss/automation/taskcluster/docker-hacl/setup.sh
+++ b/nss/automation/taskcluster/docker-hacl/setup.sh
@@ -12,9 +12,13 @@ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 200
12# Get clang-format-3.912# Get clang-format-3.9
13curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz13curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
14curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig14curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig
15# Verify the signature.15
16gpg --keyserver pool.sks-keyservers.net --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D16# Verify the signature. The key used for verification was fetched via:
17gpg --verify *.tar.xz.sig17# gpg --keyserver pgp.key-server.io --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D
18# Use a local copy to workaround bug 1565013.
19gpg --no-default-keyring --keyring tmp.keyring --import /tmp/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc
20gpg --no-default-keyring --keyring tmp.keyring --verify clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig
21
18# Install into /usr/local/.22# Install into /usr/local/.
19tar xJvf *.tar.xz -C /usr/local --strip-components=123tar xJvf *.tar.xz -C /usr/local --strip-components=1
20# Cleanup.24# Cleanup.
diff --git a/nss/automation/taskcluster/graph/src/extend.js b/nss/automation/taskcluster/graph/src/extend.js
index d7bd3f5..5b22ef8 100644
--- a/nss/automation/taskcluster/graph/src/extend.js
+++ b/nss/automation/taskcluster/graph/src/extend.js
@@ -121,12 +121,26 @@ queue.map(task => {
121 }121 }
122 }122 }
123123
124 // We don't run FIPS SSL tests
125 if (task.tests == "ssl") {124 if (task.tests == "ssl") {
126 if (!task.env) {125 if (!task.env) {
127 task.env = {};126 task.env = {};
128 }127 }
129 task.env.NSS_SSL_TESTS = "crl iopr policy";128
129 // Stress tests to not include other SSL tests
130 if (task.symbol == "stress") {
131 task.env.NSS_SSL_TESTS = "normal_normal";
132 } else {
133 task.env.NSS_SSL_TESTS = "crl iopr policy normal_normal";
134 }
135
136 // FIPS runs
137 if (task.collection == "fips") {
138 task.env.NSS_SSL_TESTS += " fips_fips fips_normal normal_fips";
139 }
140
141 if (task.platform == "mac") {
142 task.maxRunTime = 7200;
143 }
130 }144 }
131145
132 // Windows is slow.146 // Windows is slow.
@@ -135,6 +149,9 @@ queue.map(task => {
135 task.maxRunTime = 7200;149 task.maxRunTime = 7200;
136 }150 }
137151
152 if (task.platform == "mac" && task.tests == "tools") {
153 task.maxRunTime = 7200;
154 }
138 return task;155 return task;
139});156});
140157
@@ -317,12 +334,7 @@ async function scheduleMac(name, base, args = "") {
317 });334 });
318335
319 // Build base definition.336 // Build base definition.
320 let build_base = merge(mac_base, {337 let build_base_without_command_symbol = merge(mac_base, {
321 command: [
322 MAC_CHECKOUT_CMD,
323 ["bash", "-c",
324 "nss/automation/taskcluster/scripts/build_gyp.sh " + args]
325 ],
326 provisioner: "localprovisioner",338 provisioner: "localprovisioner",
327 workerType: "nss-macos-10-12",339 workerType: "nss-macos-10-12",
328 platform: "mac",340 platform: "mac",
@@ -333,6 +345,35 @@ async function scheduleMac(name, base, args = "") {
333 path: "public"345 path: "public"
334 }],346 }],
335 kind: "build",347 kind: "build",
348 });
349
350 let gyp_cmd = "nss/automation/taskcluster/scripts/build_gyp.sh ";
351
352 if (!("collection" in base) ||
353 (base.collection != "make" &&
354 base.collection != "asan" &&
355 base.collection != "fips" &&
356 base.collection != "fuzz")) {
357 let nspr_gyp = gyp_cmd + "--nspr-only --nspr-test-build ";
358 // TODO (bug 1385039): nspr_gyp += "--nspr-test-run ";
359 let nspr_build = merge(build_base_without_command_symbol, {
360 command: [
361 MAC_CHECKOUT_CMD,
362 ["bash", "-c",
363 nspr_gyp + args]
364 ],
365 symbol: "NSPR"
366 });
367 // The task that tests NSPR.
368 let nspr_task_build = queue.scheduleTask(merge(nspr_build, {name}));
369 }
370
371 let build_base = merge(build_base_without_command_symbol, {
372 command: [
373 MAC_CHECKOUT_CMD,
374 ["bash", "-c",
375 gyp_cmd + args]
376 ],
336 symbol: "B"377 symbol: "B"
337 });378 });
338379
@@ -366,25 +407,55 @@ async function scheduleMac(name, base, args = "") {
366/*****************************************************************************/407/*****************************************************************************/
367408
368async function scheduleLinux(name, overrides, args = "") {409async function scheduleLinux(name, overrides, args = "") {
410 let checkout_and_gyp = "bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh ";
411 let artifacts_and_kind = {
412 artifacts: {
413 public: {
414 expires: 24 * 7,
415 type: "directory",
416 path: "/home/worker/artifacts"
417 }
418 },
419 kind: "build",
420 };
421
422 if (!("collection" in overrides) ||
423 (overrides.collection != "make" &&
424 overrides.collection != "asan" &&
425 overrides.collection != "fips" &&
426 overrides.collection != "fuzz")) {
427 let nspr_gyp = checkout_and_gyp + "--nspr-only --nspr-test-build ";
428 // TODO (bug 1385039): nspr_gyp += "--nspr-test-run ";
429
430 let nspr_base = merge({
431 command: [
432 "/bin/bash",
433 "-c",
434 nspr_gyp + args
435 ],
436 }, overrides);
437 let nspr_without_symbol = merge(nspr_base, artifacts_and_kind);
438 let nspr_build = merge(nspr_without_symbol, {
439 symbol: "NSPR",
440 });
441 // The task that tests NSPR.
442 let nspr_task_build = queue.scheduleTask(merge(nspr_build, {name}));
443 }
444
369 // Construct a base definition. This takes |overrides| second because445 // Construct a base definition. This takes |overrides| second because
370 // callers expect to be able to overwrite the |command| key.446 // callers expect to be able to overwrite the |command| key.
371 let base = merge({447 let base = merge({
372 command: [448 command: [
373 "/bin/bash",449 "/bin/bash",
374 "-c",450 "-c",
375 "bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh " + args451 checkout_and_gyp + args
376 ],452 ],
377 }, overrides);453 }, overrides);
454
455 let base_without_symbol = merge(base, artifacts_and_kind);
456
378 // The base for building.457 // The base for building.
379 let build_base = merge(base, {458 let build_base = merge(base_without_symbol, {
380 artifacts: {
381 public: {
382 expires: 24 * 7,
383 type: "directory",
384 path: "/home/worker/artifacts"
385 }
386 },
387 kind: "build",
388 symbol: "B",459 symbol: "B",
389 });460 });
390461
@@ -567,7 +638,7 @@ async function scheduleFuzzing() {
567 "/bin/bash",638 "/bin/bash",
568 "-c",639 "-c",
569 "bin/checkout.sh && " +640 "bin/checkout.sh && " +
570 "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz"641 "nss/automation/taskcluster/scripts/build_gyp.sh --fuzz"
571 ],642 ],
572 artifacts: {643 artifacts: {
573 public: {644 public: {
@@ -594,7 +665,7 @@ async function scheduleFuzzing() {
594 "/bin/bash",665 "/bin/bash",
595 "-c",666 "-c",
596 "bin/checkout.sh && " +667 "bin/checkout.sh && " +
597 "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz=tls"668 "nss/automation/taskcluster/scripts/build_gyp.sh --fuzz=tls"
598 ],669 ],
599 }));670 }));
600671
@@ -672,7 +743,7 @@ async function scheduleFuzzing32() {
672 "/bin/bash",743 "/bin/bash",
673 "-c",744 "-c",
674 "bin/checkout.sh && " +745 "bin/checkout.sh && " +
675 "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz -t ia32"746 "nss/automation/taskcluster/scripts/build_gyp.sh --fuzz -t ia32"
676 ],747 ],
677 artifacts: {748 artifacts: {
678 public: {749 public: {
@@ -699,7 +770,7 @@ async function scheduleFuzzing32() {
699 "/bin/bash",770 "/bin/bash",
700 "-c",771 "-c",
701 "bin/checkout.sh && " +772 "bin/checkout.sh && " +
702 "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz=tls -t ia32"773 "nss/automation/taskcluster/scripts/build_gyp.sh --fuzz=tls -t ia32"
703 ],774 ],
704 }));775 }));
705776
@@ -771,21 +842,45 @@ async function scheduleWindows(name, base, build_script) {
771 }842 }
772 });843 });
773844
774 // Build base definition.845 let artifacts_and_kind = {
775 let build_base = merge(base, {
776 command: [
777 WINDOWS_CHECKOUT_CMD,
778 `bash -c 'nss/automation/taskcluster/windows/${build_script}'`
779 ],
780 artifacts: [{846 artifacts: [{
781 expires: 24 * 7,847 expires: 24 * 7,
782 type: "directory",848 type: "directory",
783 path: "public\\build"849 path: "public\\build"
784 }],850 }],
785 kind: "build",851 kind: "build",
852 };
853
854 let build_without_command_symbol = merge(base, artifacts_and_kind);
855
856 // Build base definition.
857 let build_base = merge(build_without_command_symbol, {
858 command: [
859 WINDOWS_CHECKOUT_CMD,
860 `bash -c 'nss/automation/taskcluster/windows/${build_script}'`
861 ],
786 symbol: "B"862 symbol: "B"
787 });863 });
788864
865 if (!("collection" in base) ||
866 (base.collection != "make" &&
867 base.collection != "asan" &&
868 base.collection != "fips" &&
869 base.collection != "fuzz")) {
870 let nspr_gyp =
871 `bash -c 'nss/automation/taskcluster/windows/${build_script} --nspr-only --nspr-test-build'`;
872 // TODO (bug 1385039): add --nspr-test-run
873 let nspr_build = merge(build_without_command_symbol, {
874 command: [
875 WINDOWS_CHECKOUT_CMD,
876 nspr_gyp
877 ],
878 symbol: "NSPR"
879 });
880 // The task that tests NSPR.
881 let task_build = queue.scheduleTask(merge(nspr_build, {name}));
882 }
883
789 // Make builds run FIPS tests, which need an extra FIPS build.884 // Make builds run FIPS tests, which need an extra FIPS build.
790 if (base.collection == "make") {885 if (base.collection == "make") {
791 let extra_build = queue.scheduleTask(merge(build_base, {886 let extra_build = queue.scheduleTask(merge(build_base, {
@@ -951,6 +1046,10 @@ function scheduleTests(task_build, task_cert, test_base) {
951 queue.scheduleTask(merge(ssl_base, {1046 queue.scheduleTask(merge(ssl_base, {
952 name: "SSL tests (upgradedb)", symbol: "upgradedb", cycle: "upgradedb"1047 name: "SSL tests (upgradedb)", symbol: "upgradedb", cycle: "upgradedb"
953 }));1048 }));
1049 queue.scheduleTask(merge(ssl_base, {
1050 name: "SSL tests (stress)", symbol: "stress", cycle: "sharedb",
1051 env: {NSS_SSL_RUN: "stress"}
1052 }));
954}1053}
9551054
956/*****************************************************************************/1055/*****************************************************************************/
diff --git a/nss/automation/taskcluster/graph/src/queue.js b/nss/automation/taskcluster/graph/src/queue.js
index 0b7ade9..0dc6bbb 100644
--- a/nss/automation/taskcluster/graph/src/queue.js
+++ b/nss/automation/taskcluster/graph/src/queue.js
@@ -114,6 +114,14 @@ function convertTask(def) {
114 if (def.cycle) {114 if (def.cycle) {
115 env.NSS_CYCLES = def.cycle;115 env.NSS_CYCLES = def.cycle;
116 }116 }
117 if (def.kind === "build") {
118 // Disable leak checking during builds (bug 1579290).
119 if (env.ASAN_OPTIONS) {
120 env.ASAN_OPTIONS += ":detect_leaks=0";
121 } else {
122 env.ASAN_OPTIONS = "detect_leaks=0";
123 }
124 }
117125
118 let payload = {126 let payload = {
119 env,127 env,
@@ -143,7 +151,7 @@ function convertTask(def) {
143 }151 }
144152
145 let extra = Object.assign({153 let extra = Object.assign({
146 treeherder: parseTreeherder(def)154 treeherder: parseTreeherder(def)
147 }, parameters);155 }, parameters);
148156
149 return {157 return {
diff --git a/nss/automation/taskcluster/graph/src/try_syntax.js b/nss/automation/taskcluster/graph/src/try_syntax.js
index 700032a..ca0b848 100644
--- a/nss/automation/taskcluster/graph/src/try_syntax.js
+++ b/nss/automation/taskcluster/graph/src/try_syntax.js
@@ -183,6 +183,17 @@ export async function initFilter() {
183183
184 // Add try syntax filter.184 // Add try syntax filter.
185 if (match) {185 if (match) {
186 queue.filter(filter(parseOptions(match[1])));186 let match1 = match[1];
187 queue.filter(filter(parseOptions(match1)));
188
189 if (match1.includes("--nspr-patch")) {
190 queue.map(task => {
191 if (!task.env) {
192 task.env = {};
193 }
194 task.env.ALLOW_NSPR_PATCH = "1";
195 return task;
196 });
197 }
187 }198 }
188}199}
diff --git a/nss/automation/taskcluster/scripts/build.sh b/nss/automation/taskcluster/scripts/build.sh
index 649fdaa..42ac822 100755
--- a/nss/automation/taskcluster/scripts/build.sh
+++ b/nss/automation/taskcluster/scripts/build.sh
@@ -13,6 +13,12 @@ fi
13# Clone NSPR if needed.13# Clone NSPR if needed.
14hg_clone https://hg.mozilla.org/projects/nspr ./nspr default14hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
1515
16if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
17 pushd nspr
18 cat ../nss/nspr.patch | patch -p1
19 popd
20fi
21
16# Build.22# Build.
17make -C nss nss_build_all23make -C nss nss_build_all
1824
diff --git a/nss/automation/taskcluster/scripts/build_gyp.sh b/nss/automation/taskcluster/scripts/build_gyp.sh
index fb3a33a..e19a636 100755
--- a/nss/automation/taskcluster/scripts/build_gyp.sh
+++ b/nss/automation/taskcluster/scripts/build_gyp.sh
@@ -5,8 +5,14 @@ source $(dirname "$0")/tools.sh
5# Clone NSPR if needed.5# Clone NSPR if needed.
6hg_clone https://hg.mozilla.org/projects/nspr ./nspr default6hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
77
8if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
9 pushd nspr
10 cat ../nss/nspr.patch | patch -p1
11 popd
12fi
13
8# Build.14# Build.
9nss/build.sh -g -v "$@"15nss/build.sh -g -v --enable-libpkix "$@"
1016
11# Package.17# Package.
12if [[ $(uname) = "Darwin" ]]; then18if [[ $(uname) = "Darwin" ]]; then
diff --git a/nss/automation/taskcluster/scripts/build_nspr.sh b/nss/automation/taskcluster/scripts/build_nspr.sh
index 4d19034..b104e43 100755
--- a/nss/automation/taskcluster/scripts/build_nspr.sh
+++ b/nss/automation/taskcluster/scripts/build_nspr.sh
@@ -7,6 +7,12 @@ source $(dirname $0)/tools.sh
7# Clone NSPR if needed.7# Clone NSPR if needed.
8hg_clone https://hg.mozilla.org/projects/nspr nspr default8hg_clone https://hg.mozilla.org/projects/nspr nspr default
99
10if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
11 pushd nspr
12 cat ../nss/nspr.patch | patch -p1
13 popd
14fi
15
10# Build.16# Build.
11rm -rf dist17rm -rf dist
12make -C nss build_nspr18make -C nss build_nspr
diff --git a/nss/automation/taskcluster/scripts/build_softoken.sh b/nss/automation/taskcluster/scripts/build_softoken.sh
index e5aaecc..5f60456 100755
--- a/nss/automation/taskcluster/scripts/build_softoken.sh
+++ b/nss/automation/taskcluster/scripts/build_softoken.sh
@@ -20,8 +20,9 @@ export NSS_BUILD_SOFTOKEN_ONLY=1
20rm -rf dist20rm -rf dist
21make -C nss-softoken nss_build_all21make -C nss-softoken nss_build_all
2222
23mv dist/private/nss/blapi.h dist/public/nss23for i in blapi alghmac cmac; do
24mv dist/private/nss/alghmac.h dist/public/nss24 mv "dist/private/nss/${i}.h" dist/public/nss
25done
2526
26# Package.27# Package.
27test -d artifacts || mkdir artifacts28test -d artifacts || mkdir artifacts
diff --git a/nss/automation/taskcluster/scripts/check_abi.sh b/nss/automation/taskcluster/scripts/check_abi.sh
index caa5cca..5cd587a 100755
--- a/nss/automation/taskcluster/scripts/check_abi.sh
+++ b/nss/automation/taskcluster/scripts/check_abi.sh
@@ -20,6 +20,12 @@ set_env()
20 done20 done
21 fi21 fi
2222
23 if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
24 pushd nspr
25 cat ../nss/nspr.patch | patch -p1
26 popd
27 fi
28
23 cd nss29 cd nss
24 ./build.sh -v -c30 ./build.sh -v -c
25 cd ..31 cd ..
diff --git a/nss/automation/taskcluster/scripts/gen_coverage_report.sh b/nss/automation/taskcluster/scripts/gen_coverage_report.sh
index 3907c72..dc7d77d 100755
--- a/nss/automation/taskcluster/scripts/gen_coverage_report.sh
+++ b/nss/automation/taskcluster/scripts/gen_coverage_report.sh
@@ -5,6 +5,12 @@ source $(dirname "$0")/tools.sh
5# Clone NSPR.5# Clone NSPR.
6hg_clone https://hg.mozilla.org/projects/nspr ./nspr default6hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
77
8if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
9 pushd nspr
10 cat ../nss/nspr.patch | patch -p1
11 popd
12fi
13
8out=/home/worker/artifacts14out=/home/worker/artifacts
9mkdir -p $out15mkdir -p $out
1016
diff --git a/nss/automation/taskcluster/scripts/run_coverity.sh b/nss/automation/taskcluster/scripts/run_coverity.sh
index 4d008f4..4b09f53 100755
--- a/nss/automation/taskcluster/scripts/run_coverity.sh
+++ b/nss/automation/taskcluster/scripts/run_coverity.sh
@@ -5,6 +5,12 @@ source $(dirname "$0")/tools.sh
5# Clone NSPR if needed.5# Clone NSPR if needed.
6if [ ! -d "nspr" ]; then6if [ ! -d "nspr" ]; then
7 hg_clone https://hg.mozilla.org/projects/nspr ./nspr default7 hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
8
9 if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
10 pushd nspr
11 cat ../nss/nspr.patch | patch -p1
12 popd
13 fi
8fi14fi
915
10# Build and run Coverity16# Build and run Coverity
@@ -12,4 +18,4 @@ cd nss
12./mach static-analysis18./mach static-analysis
1319
14# Return the exit code of the Coverity Analysis20# Return the exit code of the Coverity Analysis
15exit $?
16\ No newline at end of file21\ No newline at end of file
22exit $?
diff --git a/nss/automation/taskcluster/scripts/run_scan_build.sh b/nss/automation/taskcluster/scripts/run_scan_build.sh
index 014530b..0e4fcbd 100755
--- a/nss/automation/taskcluster/scripts/run_scan_build.sh
+++ b/nss/automation/taskcluster/scripts/run_scan_build.sh
@@ -5,6 +5,12 @@ source $(dirname "$0")/tools.sh
5# Clone NSPR if needed.5# Clone NSPR if needed.
6if [ ! -d "nspr" ]; then6if [ ! -d "nspr" ]; then
7 hg_clone https://hg.mozilla.org/projects/nspr ./nspr default7 hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
8
9 if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
10 pushd nspr
11 cat ../nss/nspr.patch | patch -p1
12 popd
13 fi
8fi14fi
915
10# Build.16# Build.
diff --git a/nss/automation/taskcluster/windows/build.sh b/nss/automation/taskcluster/windows/build.sh
index eebb415..f878a3d 100644
--- a/nss/automation/taskcluster/windows/build.sh
+++ b/nss/automation/taskcluster/windows/build.sh
@@ -12,6 +12,12 @@ source "$(dirname "$0")/setup.sh"
12# Clone NSPR.12# Clone NSPR.
13hg_clone https://hg.mozilla.org/projects/nspr nspr default13hg_clone https://hg.mozilla.org/projects/nspr nspr default
1414
15if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
16 pushd nspr
17 cat ../nss/nspr.patch | patch -p1
18 popd
19fi
20
15# Build.21# Build.
16make -C nss nss_build_all22make -C nss nss_build_all
1723
diff --git a/nss/automation/taskcluster/windows/build_gyp.sh b/nss/automation/taskcluster/windows/build_gyp.sh
index c0f38f9..1a78d44 100644
--- a/nss/automation/taskcluster/windows/build_gyp.sh
+++ b/nss/automation/taskcluster/windows/build_gyp.sh
@@ -31,8 +31,14 @@ export PATH="${PATH}:${PWD}/ninja/bin:${PWD}/gyp/test-env/Scripts"
31# Clone NSPR.31# Clone NSPR.
32hg_clone https://hg.mozilla.org/projects/nspr nspr default32hg_clone https://hg.mozilla.org/projects/nspr nspr default
3333
34if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
35 pushd nspr
36 cat ../nss/nspr.patch | patch -p1
37 popd
38fi
39
34# Build with gyp.40# Build with gyp.
35./nss/build.sh -g -v "$@"41./nss/build.sh -g -v --enable-libpkix "$@"
3642
37# Package.43# Package.
387z a public/build/dist.7z dist447z a public/build/dist.7z dist
diff --git a/nss/build.sh b/nss/build.sh
index 0b6fec8..7595d76 100755
--- a/nss/build.sh
+++ b/nss/build.sh
@@ -13,14 +13,16 @@
13set -e13set -e
1414
15cwd=$(cd $(dirname $0); pwd -P)15cwd=$(cd $(dirname $0); pwd -P)
16source "$cwd"/coreconf/nspr.sh16dist_dir="$cwd/../dist"
17source "$cwd"/coreconf/sanitizers.sh17argsfile="$dist_dir/build_args"
18source "$cwd/coreconf/nspr.sh"
19source "$cwd/coreconf/sanitizers.sh"
18GYP=${GYP:-gyp}20GYP=${GYP:-gyp}
1921
20# Usage info22# Usage info
21show_help()23show_help()
22{24{
23 cat "$cwd"/help.txt25 cat "$cwd/help.txt"
24}26}
2527
26run_verbose()28run_verbose()
@@ -35,6 +37,14 @@ run_verbose()
35 exec 3>&-37 exec 3>&-
36}38}
3739
40# The prehistoric bash on Mac doesn't support @Q quoting.
41# The consequences aren't that serious, unless there are odd arrangements of spaces.
42if /usr/bin/env bash -c 'x=1;echo "${x@Q}"' >/dev/null 2>&1; then
43 Q() { echo "${@@Q}"; }
44else
45 Q() { echo "$@"; }
46fi
47
38if [ -n "$CCC" ] && [ -z "$CXX" ]; then48if [ -n "$CCC" ] && [ -z "$CXX" ]; then
39 export CXX="$CCC"49 export CXX="$CCC"
40fi50fi
@@ -44,6 +54,9 @@ build_64=0
44clean=054clean=0
45rebuild_gyp=055rebuild_gyp=0
46rebuild_nspr=056rebuild_nspr=0
57build_nspr_tests=0
58run_nspr_tests=0
59exit_after_nspr=0
47target=Debug60target=Debug
48verbose=061verbose=0
49fuzz=062fuzz=0
@@ -56,7 +69,7 @@ gyp_params=(--depth="$cwd" --generator-output=".")
56ninja_params=()69ninja_params=()
5770
58# Assume that the target architecture is the same as the host by default.71# Assume that the target architecture is the same as the host by default.
59host_arch=$(python "$cwd"/coreconf/detect_host_arch.py)72host_arch=$(python "$cwd/coreconf/detect_host_arch.py")
60target_arch=$host_arch73target_arch=$host_arch
6174
62# Assume that MSVC is wanted if this is running on windows.75# Assume that MSVC is wanted if this is running on windows.
@@ -66,8 +79,17 @@ if [ "${platform%-*}" = "MINGW32_NT" -o "${platform%-*}" = "MINGW64_NT" ]; then
66fi79fi
6780
68# Parse command line arguments.81# Parse command line arguments.
82all_args=("$@")
69while [ $# -gt 0 ]; do83while [ $# -gt 0 ]; do
70 case "$1" in84 case "$1" in
85 --rebuild)
86 if [[ ! -e "$argsfile" ]]; then
87 echo "Unable to rebuild" 1>&2
88 exit 2
89 fi
90 IFS=$'\r\n' GLOBIGNORE='*' command eval 'previous_args=($(<"$argsfile"))'
91 exec /usr/bin/env bash -c "$(Q "$0")"' "$@"' "$0" "${previous_args[@]}"
92 ;;
71 -c) clean=1 ;;93 -c) clean=1 ;;
72 -cc) clean_only=1 ;;94 -cc) clean_only=1 ;;
73 -v) ninja_params+=(-v); verbose=1 ;;95 -v) ninja_params+=(-v); verbose=1 ;;
@@ -98,6 +120,9 @@ while [ $# -gt 0 ]; do
98 --static) gyp_params+=(-Dstatic_libs=1) ;;120 --static) gyp_params+=(-Dstatic_libs=1) ;;
99 --ct-verif) gyp_params+=(-Dct_verif=1) ;;121 --ct-verif) gyp_params+=(-Dct_verif=1) ;;
100 --nspr) nspr_clean; rebuild_nspr=1 ;;122 --nspr) nspr_clean; rebuild_nspr=1 ;;
123 --nspr-test-build) build_nspr_tests=1 ;;
124 --nspr-test-run) run_nspr_tests=1 ;;
125 --nspr-only) exit_after_nspr=1 ;;
101 --with-nspr=?*) set_nspr_path "${1#*=}"; no_local_nspr=1 ;;126 --with-nspr=?*) set_nspr_path "${1#*=}"; no_local_nspr=1 ;;
102 --system-nspr) set_nspr_path "/usr/include/nspr/:"; no_local_nspr=1 ;;127 --system-nspr) set_nspr_path "/usr/include/nspr/:"; no_local_nspr=1 ;;
103 --system-sqlite) gyp_params+=(-Duse_system_sqlite=1) ;;128 --system-sqlite) gyp_params+=(-Duse_system_sqlite=1) ;;
@@ -105,7 +130,7 @@ while [ $# -gt 0 ]; do
105 --enable-libpkix) gyp_params+=(-Ddisable_libpkix=0) ;;130 --enable-libpkix) gyp_params+=(-Ddisable_libpkix=0) ;;
106 --mozpkix-only) gyp_params+=(-Dmozpkix_only=1 -Ddisable_tests=1 -Dsign_libs=0) ;;131 --mozpkix-only) gyp_params+=(-Dmozpkix_only=1 -Ddisable_tests=1 -Dsign_libs=0) ;;
107 --disable-keylog) sslkeylogfile=0 ;;132 --disable-keylog) sslkeylogfile=0 ;;
108 -D*) gyp_params+=("$1") ;;133 -D*) gyp_params+=("$1") ;;
109 *) show_help; exit 2 ;;134 *) show_help; exit 2 ;;
110 esac135 esac
111 shift136 shift
@@ -123,7 +148,7 @@ gyp_params+=(-Denable_sslkeylogfile="$sslkeylogfile")
123148
124# Do special setup.149# Do special setup.
125if [ "$fuzz" = 1 ]; then150if [ "$fuzz" = 1 ]; then
126 source "$cwd"/coreconf/fuzz.sh151 source "$cwd/coreconf/fuzz.sh"
127fi152fi
128nspr_set_flags $sanitizer_flags153nspr_set_flags $sanitizer_flags
129if [ ! -z "$sanitizer_flags" ]; then154if [ ! -z "$sanitizer_flags" ]; then
@@ -131,20 +156,13 @@ if [ ! -z "$sanitizer_flags" ]; then
131fi156fi
132157
133if [ "$msvc" = 1 ]; then158if [ "$msvc" = 1 ]; then
134 source "$cwd"/coreconf/msvc.sh159 source "$cwd/coreconf/msvc.sh"
135fi160fi
136161
137# Setup build paths.
138target_dir="$cwd"/out/$target
139mkdir -p "$target_dir"
140dist_dir="$cwd"/../dist
141dist_dir=$(mkdir -p "$dist_dir"; cd "$dist_dir"; pwd -P)
142gyp_params+=(-Dnss_dist_dir="$dist_dir")
143
144# -c = clean first162# -c = clean first
145if [ "$clean" = 1 -o "$clean_only" = 1 ]; then163if [ "$clean" = 1 -o "$clean_only" = 1 ]; then
146 nspr_clean164 nspr_clean
147 rm -rf "$cwd"/out165 rm -rf "$cwd/out"
148 rm -rf "$dist_dir"166 rm -rf "$dist_dir"
149 # -cc = only clean, don't build167 # -cc = only clean, don't build
150 if [ "$clean_only" = 1 ]; then168 if [ "$clean_only" = 1 ]; then
@@ -153,6 +171,12 @@ if [ "$clean" = 1 -o "$clean_only" = 1 ]; then
153 fi171 fi
154fi172fi
155173
174# Setup build paths.
175target_dir="$cwd/out/$target"
176mkdir -p "$target_dir"
177dist_dir=$(mkdir -p "$dist_dir"; cd "$dist_dir"; pwd -P)
178gyp_params+=(-Dnss_dist_dir="$dist_dir")
179
156# This saves a canonical representation of arguments that we are passing to gyp180# This saves a canonical representation of arguments that we are passing to gyp
157# or the NSPR build so that we can work out if a rebuild is needed.181# or the NSPR build so that we can work out if a rebuild is needed.
158# Caveat: This can fail for arguments that are position-dependent.182# Caveat: This can fail for arguments that are position-dependent.
@@ -162,66 +186,72 @@ check_config()
162 local newconf="$1".new oldconf="$1"186 local newconf="$1".new oldconf="$1"
163 shift187 shift
164 mkdir -p $(dirname "$newconf")188 mkdir -p $(dirname "$newconf")
165 echo CC="$CC" >"$newconf"189 echo CC="$(Q "$CC")" >"$newconf"
166 echo CCC="$CCC" >>"$newconf"190 echo CCC="$(Q "$CCC")" >>"$newconf"
167 echo CXX="$CXX" >>"$newconf"191 echo CXX="$(Q "$CXX")" >>"$newconf"
168 echo target_arch="$target_arch" >>"$newconf"192 echo target_arch="$(Q "$target_arch")" >>"$newconf"
169 for i in "$@"; do echo $i; done | sort >>"$newconf"193 for i in "$@"; do echo "$i"; done | sort >>"$newconf"
170194
171 # Note: The following diff fails if $oldconf isn't there as well, which195 # Note: The following diff fails if $oldconf isn't there as well, which
172 # happens if we don't have a previous successful build.196 # happens if we don't have a previous successful build.
173 ! diff -q "$newconf" "$oldconf" >/dev/null 2>&1197 ! diff -q "$newconf" "$oldconf" >/dev/null 2>&1
174}198}
175199
176gyp_config="$cwd"/out/gyp_config200gyp_config="$cwd/out/gyp_config"
177nspr_config="$cwd"/out/$target/nspr_config201nspr_config="$cwd/out/$target/nspr_config"
178202
179# Now check what needs to be rebuilt.203# Now check what needs to be rebuilt.
180# If we don't have a build directory make sure that we rebuild.204# If we don't have a build directory make sure that we rebuild.
181if [ ! -d "$target_dir" ]; then205if [ ! -d "$target_dir" ]; then
182 rebuild_nspr=1206 rebuild_nspr=1
183 rebuild_gyp=1207 rebuild_gyp=1
184elif [ ! -d "$dist_dir"/$target ]; then208elif [ ! -d "$dist_dir/$target" ]; then
185 rebuild_nspr=1209 rebuild_nspr=1
186fi210fi
187211
188if check_config "$nspr_config" \212if check_config "$nspr_config" \
189 nspr_cflags="$nspr_cflags" \213 nspr_cflags="$(Q "$nspr_cflags")" \
190 nspr_cxxflags="$nspr_cxxflags" \214 nspr_cxxflags="$(Q "$nspr_cxxflags")" \
191 nspr_ldflags="$nspr_ldflags"; then215 nspr_ldflags="$(Q "$nspr_ldflags")"; then
192 rebuild_nspr=1216 rebuild_nspr=1
193fi217fi
194218
195if check_config "$gyp_config" "${gyp_params[@]}"; then219if check_config "$gyp_config" "$(Q "${gyp_params[@]}")"; then
196 rebuild_gyp=1220 rebuild_gyp=1
197fi221fi
198222
199# Save the chosen target.223# Save the chosen target.
200mkdir -p "$dist_dir"224echo "$target" > "$dist_dir/latest"
201echo $target > "$dist_dir"/latest225for i in "${all_args[@]}"; do echo "$i"; done > "$argsfile"
202226
203# Build.227# Build.
204# NSPR.228# NSPR.
205if [[ "$rebuild_nspr" = 1 && "$no_local_nspr" = 0 ]]; then229if [[ "$rebuild_nspr" = 1 && "$no_local_nspr" = 0 ]]; then
230 nspr_clean
206 nspr_build231 nspr_build
207 mv -f "$nspr_config".new "$nspr_config"232 mv -f "$nspr_config.new" "$nspr_config"
233fi
234
235if [ "$exit_after_nspr" = 1 ]; then
236 exit 0
208fi237fi
238
209# gyp.239# gyp.
210if [ "$rebuild_gyp" = 1 ]; then240if [ "$rebuild_gyp" = 1 ]; then
211 if ! hash ${GYP} 2> /dev/null; then241 if ! hash "$GYP" 2> /dev/null; then
212 echo "Please install gyp" 1>&2242 echo "Building NSS requires an installation of gyp: https://gyp.gsrc.io/" 1>&2
213 exit 1243 exit 3
214 fi244 fi
215 # These extra arguments aren't used in determining whether to rebuild.245 # These extra arguments aren't used in determining whether to rebuild.
216 obj_dir="$dist_dir"/$target246 obj_dir="$dist_dir/$target"
217 gyp_params+=(-Dnss_dist_obj_dir=$obj_dir)247 gyp_params+=(-Dnss_dist_obj_dir="$obj_dir")
218 if [ "$no_local_nspr" = 0 ]; then248 if [ "$no_local_nspr" = 0 ]; then
219 set_nspr_path "$obj_dir/include/nspr:$obj_dir/lib"249 set_nspr_path "$obj_dir/include/nspr:$obj_dir/lib"
220 fi250 fi
221251
222 run_verbose run_scanbuild ${GYP} -f ninja "${gyp_params[@]}" "$cwd"/nss.gyp252 run_verbose run_scanbuild ${GYP} -f ninja "${gyp_params[@]}" "$cwd/nss.gyp"
223253
224 mv -f "$gyp_config".new "$gyp_config"254 mv -f "$gyp_config.new" "$gyp_config"
225fi255fi
226256
227# ninja.257# ninja.
@@ -230,7 +260,7 @@ if hash ninja-build 2>/dev/null; then
230elif hash ninja 2>/dev/null; then260elif hash ninja 2>/dev/null; then
231 ninja=ninja261 ninja=ninja
232else262else
233 echo "Please install ninja" 1>&2263 echo "Building NSS requires an installation of ninja: https://ninja-build.org/" 1>&2
234 exit 1264 exit 3
235fi265fi
236run_scanbuild $ninja -C "$target_dir" "${ninja_params[@]}"266run_scanbuild "$ninja" -C "$target_dir" "${ninja_params[@]}"
diff --git a/nss/cmd/addbuiltin/addbuiltin.c b/nss/cmd/addbuiltin/addbuiltin.c
index 8316720..5655888 100644
--- a/nss/cmd/addbuiltin/addbuiltin.c
+++ b/nss/cmd/addbuiltin/addbuiltin.c
@@ -230,6 +230,8 @@ ConvertCertificate(SECItem *sdder, char *nickname, CERTCertTrust *trust,
230 hasPositiveTrust(trust->objectSigningFlags)) {230 hasPositiveTrust(trust->objectSigningFlags)) {
231 printf("CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE\n");231 printf("CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE\n");
232 }232 }
233 printf("CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE\n");
234 printf("CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE\n");
233 }235 }
234236
235 if ((trust->sslFlags | trust->emailFlags | trust->objectSigningFlags) ==237 if ((trust->sslFlags | trust->emailFlags | trust->objectSigningFlags) ==
@@ -306,19 +308,21 @@ printheader()
306 "#\n"308 "#\n"
307 "# Certificates\n"309 "# Certificates\n"
308 "#\n"310 "#\n"
309 "# -- Attribute -- -- type -- -- value --\n"311 "# -- Attribute -- -- type -- -- value --\n"
310 "# CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE\n"312 "# CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE\n"
311 "# CKA_TOKEN CK_BBOOL CK_TRUE\n"313 "# CKA_TOKEN CK_BBOOL CK_TRUE\n"
312 "# CKA_PRIVATE CK_BBOOL CK_FALSE\n"314 "# CKA_PRIVATE CK_BBOOL CK_FALSE\n"
313 "# CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"315 "# CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"
314 "# CKA_LABEL UTF8 (varies)\n"316 "# CKA_LABEL UTF8 (varies)\n"
315 "# CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509\n"317 "# CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509\n"
316 "# CKA_SUBJECT DER+base64 (varies)\n"318 "# CKA_SUBJECT DER+base64 (varies)\n"
317 "# CKA_ID byte array (varies)\n"319 "# CKA_ID byte array (varies)\n"
318 "# CKA_ISSUER DER+base64 (varies)\n"320 "# CKA_ISSUER DER+base64 (varies)\n"
319 "# CKA_SERIAL_NUMBER DER+base64 (varies)\n"321 "# CKA_SERIAL_NUMBER DER+base64 (varies)\n"
320 "# CKA_VALUE DER+base64 (varies)\n"322 "# CKA_VALUE DER+base64 (varies)\n"
321 "# CKA_NSS_EMAIL ASCII7 (unused here)\n"323 "# CKA_NSS_EMAIL ASCII7 (unused here)\n"
324 "# CKA_NSS_SERVER_DISTRUST_AFTER DER+base64 (varies)\n"
325 "# CKA_NSS_EMAIL_DISTRUST_AFTER DER+base64 (varies)\n"
322 "#\n"326 "#\n"
323 "# Trust\n"327 "# Trust\n"
324 "#\n"328 "#\n"
@@ -392,6 +396,12 @@ Usage(char *progName)
392 fprintf(stderr, "%-15s a CRL entry number, as shown by \"crlutil -S\"\n", "-e");396 fprintf(stderr, "%-15s a CRL entry number, as shown by \"crlutil -S\"\n", "-e");
393 fprintf(stderr, "%-15s input file to read (default stdin)\n", "-i file");397 fprintf(stderr, "%-15s input file to read (default stdin)\n", "-i file");
394 fprintf(stderr, "%-15s (pipe through atob if the cert is b64-encoded)\n", "");398 fprintf(stderr, "%-15s (pipe through atob if the cert is b64-encoded)\n", "");
399 fprintf(stderr, "%-15s convert a timestamp to DER, and output.\n", "-d timestamp");
400 fprintf(stderr, "%-15s useful to fill server and email distrust fields\n", "");
401 fprintf(stderr, "%-15s Example: %s -d 1561939200\n", "", progName);
402 fprintf(stderr, "%-15s NOTE: The informed timestamp are interpreted as seconds\n", "");
403 fprintf(stderr, "%-15s since unix epoch.\n", "");
404 fprintf(stderr, "%-15s TIP: date -d \"2019-07-01 00:00:00 UTC\" +%%s\n", "");
395 exit(-1);405 exit(-1);
396}406}
397407
@@ -403,20 +413,21 @@ enum {
403 opt_ExcludeCert,413 opt_ExcludeCert,
404 opt_ExcludeHash,414 opt_ExcludeHash,
405 opt_DistrustCRL,415 opt_DistrustCRL,
406 opt_CRLEnry416 opt_CRLEntry,
417 opt_ConvertDate
407};418};
408419
409static secuCommandFlag addbuiltin_options[] =420static secuCommandFlag addbuiltin_options[] = {
410 {421 { /* opt_Input */ 'i', PR_TRUE, 0, PR_FALSE },
411 { /* opt_Input */ 'i', PR_TRUE, 0, PR_FALSE },422 { /* opt_Nickname */ 'n', PR_TRUE, 0, PR_FALSE },
412 { /* opt_Nickname */ 'n', PR_TRUE, 0, PR_FALSE },423 { /* opt_Trust */ 't', PR_TRUE, 0, PR_FALSE },
413 { /* opt_Trust */ 't', PR_TRUE, 0, PR_FALSE },424 { /* opt_Distrust */ 'D', PR_FALSE, 0, PR_FALSE },
414 { /* opt_Distrust */ 'D', PR_FALSE, 0, PR_FALSE },425 { /* opt_ExcludeCert */ 'c', PR_FALSE, 0, PR_FALSE },
415 { /* opt_ExcludeCert */ 'c', PR_FALSE, 0, PR_FALSE },426 { /* opt_ExcludeHash */ 'h', PR_FALSE, 0, PR_FALSE },
416 { /* opt_ExcludeHash */ 'h', PR_FALSE, 0, PR_FALSE },427 { /* opt_DistrustCRL */ 'C', PR_FALSE, 0, PR_FALSE },
417 { /* opt_DistrustCRL */ 'C', PR_FALSE, 0, PR_FALSE },428 { /* opt_CRLEntry */ 'e', PR_TRUE, 0, PR_FALSE },
418 { /* opt_CRLEnry */ 'e', PR_TRUE, 0, PR_FALSE },429 { /* opt_ConvertDate */ 'd', PR_TRUE, 0, PR_FALSE },
419 };430};
420431
421int432int
422main(int argc, char **argv)433main(int argc, char **argv)
@@ -444,6 +455,30 @@ main(int argc, char **argv)
444 if (rv != SECSuccess)455 if (rv != SECSuccess)
445 Usage(progName);456 Usage(progName);
446457
458 if (addbuiltin.options[opt_ConvertDate].activated) {
459 char *endPtr;
460 PRTime distrustTimestamp = strtol(addbuiltin.options[opt_ConvertDate].arg, &endPtr, 0) * PR_USEC_PER_SEC;
461 if (*endPtr != '\0' && distrustTimestamp > 0) {
462 Usage(progName);
463 exit(1);
464 }
465 SECItem encTime;
466 DER_EncodeTimeChoice(NULL, &encTime, distrustTimestamp);
467 SECU_PrintTimeChoice(stdout, &encTime, "The timestamp represents this date", 0);
468 printf("Locate the entry of the desired certificate in certdata.txt\n"
469 "Erase the CKA_NSS_[SERVER|EMAIL]_DISTRUST_AFTER CK_BBOOL CK_FALSE\n"
470 "And override with the following respective entry:\n\n");
471 SECU_PrintTimeChoice(stdout, &encTime, "# For Server Distrust After", 0);
472 printf("CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL\n");
473 dumpbytes(encTime.data, encTime.len);
474 printf("END\n");
475 SECU_PrintTimeChoice(stdout, &encTime, "# For Email Distrust After", 0);
476 printf("CKA_NSS_EMAIL_DISTRUST_AFTER MULTILINE_OCTAL\n");
477 dumpbytes(encTime.data, encTime.len);
478 printf("END\n");
479 exit(0);
480 }
481
447 if (addbuiltin.options[opt_Trust].activated)482 if (addbuiltin.options[opt_Trust].activated)
448 ++mutuallyExclusiveOpts;483 ++mutuallyExclusiveOpts;
449 if (addbuiltin.options[opt_Distrust].activated)484 if (addbuiltin.options[opt_Distrust].activated)
@@ -458,12 +493,12 @@ main(int argc, char **argv)
458 }493 }
459494
460 if (addbuiltin.options[opt_DistrustCRL].activated) {495 if (addbuiltin.options[opt_DistrustCRL].activated) {
461 if (!addbuiltin.options[opt_CRLEnry].activated) {496 if (!addbuiltin.options[opt_CRLEntry].activated) {
462 fprintf(stderr, "%s: you must specify the CRL entry number.\n",497 fprintf(stderr, "%s: you must specify the CRL entry number.\n",
463 progName);498 progName);
464 Usage(progName);499 Usage(progName);
465 } else {500 } else {
466 crlentry = atoi(addbuiltin.options[opt_CRLEnry].arg);501 crlentry = atoi(addbuiltin.options[opt_CRLEntry].arg);
467 if (crlentry < 1) {502 if (crlentry < 1) {
468 fprintf(stderr, "%s: The CRL entry number must be > 0.\n",503 fprintf(stderr, "%s: The CRL entry number must be > 0.\n",
469 progName);504 progName);
diff --git a/nss/cmd/httpserv/httpserv.c b/nss/cmd/httpserv/httpserv.c
index 71e2ab8..c7277f3 100644
--- a/nss/cmd/httpserv/httpserv.c
+++ b/nss/cmd/httpserv/httpserv.c
@@ -463,7 +463,7 @@ handle_connection(
463 char *getData = NULL; /* inplace conversion */463 char *getData = NULL; /* inplace conversion */
464 SECItem postData;464 SECItem postData;
465 PRBool isOcspRequest = PR_FALSE;465 PRBool isOcspRequest = PR_FALSE;
466 PRBool isPost;466 PRBool isPost = PR_FALSE;
467467
468 postData.data = NULL;468 postData.data = NULL;
469 postData.len = 0;469 postData.len = 0;
diff --git a/nss/cmd/lib/Makefile b/nss/cmd/lib/Makefile
index 0fb6c90..6b53451 100644
--- a/nss/cmd/lib/Makefile
+++ b/nss/cmd/lib/Makefile
@@ -27,6 +27,7 @@ include $(CORE_DEPTH)/coreconf/config.mk
27#######################################################################27#######################################################################
2828
29include config.mk29include config.mk
30include ../platlibs.mk
3031
31#######################################################################32#######################################################################
32# (5) Execute "global" rules. (OPTIONAL) #33# (5) Execute "global" rules. (OPTIONAL) #
diff --git a/nss/cmd/lib/derprint.c b/nss/cmd/lib/derprint.c
index 08ef66d..b86179e 100644
--- a/nss/cmd/lib/derprint.c
+++ b/nss/cmd/lib/derprint.c
@@ -4,6 +4,8 @@
4#include "secutil.h"4#include "secutil.h"
5#include "secoid.h"5#include "secoid.h"
66
7#include <stdint.h>
8
7#ifdef __sun9#ifdef __sun
8extern int fprintf(FILE *strm, const char *format, ... /* args */);10extern int fprintf(FILE *strm, const char *format, ... /* args */);
9extern int fflush(FILE *stream);11extern int fflush(FILE *stream);
@@ -509,7 +511,7 @@ prettyPrintItem(FILE *out, const unsigned char *data, const unsigned char *end,
509 /*511 /*
510 * Just quit now if slen more bytes puts us off the end.512 * Just quit now if slen more bytes puts us off the end.
511 */513 */
512 if ((data + slen) > end) {514 if (data > end || slen > (end - data)) {
513 PORT_SetError(SEC_ERROR_BAD_DER);515 PORT_SetError(SEC_ERROR_BAD_DER);
514 return -1;516 return -1;
515 }517 }
diff --git a/nss/cmd/lib/lib.gyp b/nss/cmd/lib/lib.gyp
index 6b7da58..c5835a8 100644
--- a/nss/cmd/lib/lib.gyp
+++ b/nss/cmd/lib/lib.gyp
@@ -27,7 +27,8 @@
27 ],27 ],
28 'target_defaults': {28 'target_defaults': {
29 'defines': [29 'defines': [
30 'NSPR20'30 'NSPR20',
31 'NSS_USE_STATIC_LIBS'
31 ]32 ]
32 },33 },
33 'variables': {34 'variables': {
diff --git a/nss/cmd/lib/manifest.mn b/nss/cmd/lib/manifest.mn
index 87440c0..b3c36b3 100644
--- a/nss/cmd/lib/manifest.mn
+++ b/nss/cmd/lib/manifest.mn
@@ -37,3 +37,5 @@ CSRCS = basicutil.c \
37endif37endif
3838
39NO_MD_RELEASE = 139NO_MD_RELEASE = 1
40
41USE_STATIC_LIBS = 1
diff --git a/nss/cmd/lib/pk11table.c b/nss/cmd/lib/pk11table.c
index 15c0a8d..ec5d889 100644
--- a/nss/cmd/lib/pk11table.c
+++ b/nss/cmd/lib/pk11table.c
@@ -333,6 +333,8 @@ const Constant _consts[] = {
333 mkEntry(CKM_SHA512, Mechanism),333 mkEntry(CKM_SHA512, Mechanism),
334 mkEntry(CKM_SHA512_HMAC_GENERAL, Mechanism),334 mkEntry(CKM_SHA512_HMAC_GENERAL, Mechanism),
335 mkEntry(CKM_SHA512_HMAC, Mechanism),335 mkEntry(CKM_SHA512_HMAC, Mechanism),
336 mkEntry(CKM_AES_CMAC, Mechanism),
337 mkEntry(CKM_AES_CMAC_GENERAL, Mechanism),
336 mkEntry(CKM_CAST_KEY_GEN, Mechanism),338 mkEntry(CKM_CAST_KEY_GEN, Mechanism),
337 mkEntry(CKM_CAST_ECB, Mechanism),339 mkEntry(CKM_CAST_ECB, Mechanism),
338 mkEntry(CKM_CAST_CBC, Mechanism),340 mkEntry(CKM_CAST_CBC, Mechanism),
diff --git a/nss/cmd/lib/secpwd.c b/nss/cmd/lib/secpwd.c
index 7e99b27..e8ca792 100644
--- a/nss/cmd/lib/secpwd.c
+++ b/nss/cmd/lib/secpwd.c
@@ -66,7 +66,7 @@ SEC_GetPassword(FILE *input, FILE *output, char *prompt,
66 int infd = fileno(input);66 int infd = fileno(input);
67 int isTTY = isatty(infd);67 int isTTY = isatty(infd);
68#endif68#endif
69 char phrase[200] = { '\0' }; /* ensure EOF doesn't return junk */69 char phrase[500] = { '\0' }; /* ensure EOF doesn't return junk */
7070
71 for (;;) {71 for (;;) {
72 /* Prompt for password */72 /* Prompt for password */
diff --git a/nss/cmd/lib/secutil.c b/nss/cmd/lib/secutil.c
index 97c7f75..703845e 100644
--- a/nss/cmd/lib/secutil.c
+++ b/nss/cmd/lib/secutil.c
@@ -22,6 +22,7 @@
22#include <stdarg.h>22#include <stdarg.h>
23#include <sys/stat.h>23#include <sys/stat.h>
24#include <errno.h>24#include <errno.h>
25#include <limits.h>
2526
26#ifdef XP_UNIX27#ifdef XP_UNIX
27#include <unistd.h>28#include <unistd.h>
@@ -1107,36 +1108,33 @@ typedef struct secuPBEParamsStr {
1107SEC_ASN1_MKSUB(SECOID_AlgorithmIDTemplate)1108SEC_ASN1_MKSUB(SECOID_AlgorithmIDTemplate)
11081109
1109/* SECOID_PKCS5_PBKDF2 */1110/* SECOID_PKCS5_PBKDF2 */
1110const SEC_ASN1Template secuKDF2Params[] =1111const SEC_ASN1Template secuKDF2Params[] = {
1111 {1112 { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },
1112 { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },1113 { SEC_ASN1_OCTET_STRING, offsetof(secuPBEParams, salt) },
1113 { SEC_ASN1_OCTET_STRING, offsetof(secuPBEParams, salt) },1114 { SEC_ASN1_INTEGER, offsetof(secuPBEParams, iterationCount) },
1114 { SEC_ASN1_INTEGER, offsetof(secuPBEParams, iterationCount) },1115 { SEC_ASN1_INTEGER, offsetof(secuPBEParams, keyLength) },
1115 { SEC_ASN1_INTEGER, offsetof(secuPBEParams, keyLength) },1116 { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, kdfAlg),
1116 { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, kdfAlg),1117 SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
1117 SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },1118 { 0 }
1118 { 0 }1119};
1119 };
11201120
1121/* PKCS5v1 & PKCS12 */1121/* PKCS5v1 & PKCS12 */
1122const SEC_ASN1Template secuPBEParamsTemp[] =1122const SEC_ASN1Template secuPBEParamsTemp[] = {
1123 {1123 { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },
1124 { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },1124 { SEC_ASN1_OCTET_STRING, offsetof(secuPBEParams, salt) },
1125 { SEC_ASN1_OCTET_STRING, offsetof(secuPBEParams, salt) },1125 { SEC_ASN1_INTEGER, offsetof(secuPBEParams, iterationCount) },
1126 { SEC_ASN1_INTEGER, offsetof(secuPBEParams, iterationCount) },1126 { 0 }
1127 { 0 }1127};
1128 };
11291128
1130/* SEC_OID_PKCS5_PBES2, SEC_OID_PKCS5_PBMAC1 */1129/* SEC_OID_PKCS5_PBES2, SEC_OID_PKCS5_PBMAC1 */
1131const SEC_ASN1Template secuPBEV2Params[] =1130const SEC_ASN1Template secuPBEV2Params[] = {
1132 {1131 { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },
1133 { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },1132 { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, kdfAlg),
1134 { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, kdfAlg),1133 SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
1135 SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },1134 { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, cipherAlg),
1136 { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, cipherAlg),1135 SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
1137 SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },1136 { 0 }
1138 { 0 }1137};
1139 };
11401138
1141void1139void
1142secu_PrintRSAPSSParams(FILE *out, SECItem *value, char *m, int level)1140secu_PrintRSAPSSParams(FILE *out, SECItem *value, char *m, int level)
@@ -2299,8 +2297,9 @@ SECU_PrintCertAttributes(FILE *out, CERTAttribute **attrs, char *m, int level)
2299 return rv;2297 return rv;
2300}2298}
23012299
2302int /* sometimes a PRErrorCode, other times a SECStatus. Sigh. */2300/* sometimes a PRErrorCode, other times a SECStatus. Sigh. */
2303 SECU_PrintCertificateRequest(FILE *out, SECItem *der, char *m, int level)2301int
2302SECU_PrintCertificateRequest(FILE *out, SECItem *der, char *m, int level)
2304{2303{
2305 PLArenaPool *arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);2304 PLArenaPool *arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
2306 CERTCertificateRequest *cr;2305 CERTCertificateRequest *cr;
@@ -3250,6 +3249,26 @@ SEC_PrintCertificateAndTrust(CERTCertificate *cert,
3250 "Certificate Trust Flags", 1);3249 "Certificate Trust Flags", 1);
3251 }3250 }
32523251
3252 /* The distrust fields are hard-coded in nssckbi and read-only.
3253 * If verifying some cert, with vfychain, for instance, the certificate may
3254 * not have a defined slot if not imported. */
3255 if (cert->slot != NULL && cert->distrust != NULL) {
3256 const unsigned int kDistrustFieldSize = 13;
3257 fprintf(stdout, "\n");
3258 SECU_Indent(stdout, 1);
3259 fprintf(stdout, "%s:\n", "Certificate Distrust Dates");
3260 if (cert->distrust->serverDistrustAfter.len == kDistrustFieldSize) {
3261 SECU_PrintTimeChoice(stdout,
3262 &cert->distrust->serverDistrustAfter,
3263 "Server Distrust After", 2);
3264 }
3265 if (cert->distrust->emailDistrustAfter.len == kDistrustFieldSize) {
3266 SECU_PrintTimeChoice(stdout,
3267 &cert->distrust->emailDistrustAfter,
3268 "E-mail Distrust After", 2);
3269 }
3270 }
3271
3253 printf("\n");3272 printf("\n");
32543273
3255 return (SECSuccess);3274 return (SECSuccess);
@@ -3979,3 +3998,164 @@ done:
3979 *enabledSigSchemes = schemes;3998 *enabledSigSchemes = schemes;
3980 return SECSuccess;3999 return SECSuccess;
3981}4000}
4001
4002/* Parse the exporter spec in the form: LABEL[:OUTPUT-LENGTH[:CONTEXT]] */
4003static SECStatus
4004parseExporter(const char *arg,
4005 secuExporter *exporter)
4006{
4007 SECStatus rv = SECSuccess;
4008
4009 char *str = PORT_Strdup(arg);
4010 if (!str) {
4011 rv = SECFailure;
4012 goto done;
4013 }
4014
4015 char *labelEnd = strchr(str, ':');
4016 if (labelEnd) {
4017 *labelEnd = '\0';
4018 labelEnd++;
4019
4020 /* To extract CONTEXT, first skip OUTPUT-LENGTH */
4021 char *outputEnd = strchr(labelEnd, ':');
4022 if (outputEnd) {
4023 *outputEnd = '\0';
4024 outputEnd++;
4025
4026 exporter->hasContext = PR_TRUE;
4027 exporter->context.data = (unsigned char *)PORT_Strdup(outputEnd);
4028 exporter->context.len = strlen(outputEnd);
4029 if (PORT_Strncasecmp((char *)exporter->context.data, "0x", 2) == 0) {
4030 rv = SECU_SECItemHexStringToBinary(&exporter->context);
4031 if (rv != SECSuccess) {
4032 goto done;
4033 }
4034 }
4035 }
4036 }
4037
4038 if (labelEnd && *labelEnd != '\0') {
4039 long int outputLength = strtol(labelEnd, NULL, 10);
4040 if (!(outputLength > 0 && outputLength <= UINT_MAX)) {
4041 PORT_SetError(SEC_ERROR_INVALID_ARGS);
4042 rv = SECFailure;
4043 goto done;
4044 }
4045 exporter->outputLength = outputLength;
4046 } else {
4047 exporter->outputLength = 20;
4048 }
4049
4050 char *label = PORT_Strdup(str);
4051 exporter->label.data = (unsigned char *)label;
4052 exporter->label.len = strlen(label);
4053 if (PORT_Strncasecmp((char *)exporter->label.data, "0x", 2) == 0) {
4054 rv = SECU_SECItemHexStringToBinary(&exporter->label);
4055 if (rv != SECSuccess) {
4056 goto done;
4057 }
4058 }
4059
4060done:
4061 PORT_Free(str);
4062
4063 return rv;
4064}
4065
4066SECStatus
4067parseExporters(const char *arg,
4068 const secuExporter **enabledExporters,
4069 unsigned int *enabledExporterCount)
4070{
4071 secuExporter *exporters;
4072 unsigned int numValues = 0;
4073 unsigned int count = 0;
4074
4075 if (countItems(arg, &numValues) != SECSuccess) {
4076 return SECFailure;
4077 }
4078 exporters = PORT_ZNewArray(secuExporter, numValues);
4079 if (!exporters) {
4080 return SECFailure;
4081 }
4082
4083 /* Get exporter definitions. */
4084 char *str = PORT_Strdup(arg);
4085 if (!str) {
4086 goto done;
4087 }
4088 char *p = strtok(str, ",");
4089 while (p) {
4090 SECStatus rv = parseExporter(p, &exporters[count++]);
4091 if (rv != SECSuccess) {
4092 count = 0;
4093 goto done;
4094 }
4095 p = strtok(NULL, ",");
4096 }
4097
4098done:
4099 PORT_Free(str);
4100 if (!count) {
4101 PORT_Free(exporters);
4102 return SECFailure;
4103 }
4104
4105 *enabledExporterCount = count;
4106 *enabledExporters = exporters;
4107 return SECSuccess;
4108}
4109
4110static SECStatus
4111exportKeyingMaterial(PRFileDesc *fd, const secuExporter *exporter)
4112{
4113 SECStatus rv = SECSuccess;
4114 unsigned char *out = PORT_Alloc(exporter->outputLength);
4115
4116 if (!out) {
4117 fprintf(stderr, "Unable to allocate buffer for keying material\n");
4118 return SECFailure;
4119 }
4120 rv = SSL_ExportKeyingMaterial(fd,
4121 (char *)exporter->label.data,
4122 exporter->label.len,
4123 exporter->hasContext,
4124 exporter->context.data,
4125 exporter->context.len,
4126 out,
4127 exporter->outputLength);
4128 if (rv != SECSuccess) {
4129 goto done;
4130 }
4131 fprintf(stdout, "Exported Keying Material:\n");
4132 secu_PrintRawString(stdout, (SECItem *)&exporter->label, "Label", 1);
4133 if (exporter->hasContext) {
4134 SECU_PrintAsHex(stdout, &exporter->context, "Context", 1);
4135 }
4136 SECU_Indent(stdout, 1);
4137 fprintf(stdout, "Length: %u\n", exporter->outputLength);
4138 SECItem temp = { siBuffer, out, exporter->outputLength };
4139 SECU_PrintAsHex(stdout, &temp, "Keying Material", 1);
4140
4141done:
4142 PORT_Free(out);
4143 return rv;
4144}
4145
4146SECStatus
4147exportKeyingMaterials(PRFileDesc *fd,
4148 const secuExporter *exporters,
4149 unsigned int exporterCount)
4150{
4151 unsigned int i;
4152
4153 for (i = 0; i < exporterCount; i++) {
4154 SECStatus rv = exportKeyingMaterial(fd, &exporters[i]);
4155 if (rv != SECSuccess) {
4156 return rv;
4157 }
4158 }
4159
4160 return SECSuccess;
4161}
diff --git a/nss/cmd/lib/secutil.h b/nss/cmd/lib/secutil.h
index 90d7639..c6da961 100644
--- a/nss/cmd/lib/secutil.h
+++ b/nss/cmd/lib/secutil.h
@@ -409,6 +409,20 @@ SECStatus parseGroupList(const char *arg, SSLNamedGroup **enabledGroups,
409SECStatus parseSigSchemeList(const char *arg,409SECStatus parseSigSchemeList(const char *arg,
410 const SSLSignatureScheme **enabledSigSchemes,410 const SSLSignatureScheme **enabledSigSchemes,
411 unsigned int *enabledSigSchemeCount);411 unsigned int *enabledSigSchemeCount);
412typedef struct {
413 SECItem label;
414 PRBool hasContext;
415 SECItem context;
416 unsigned int outputLength;
417} secuExporter;
418
419SECStatus parseExporters(const char *arg,
420 const secuExporter **enabledExporters,
421 unsigned int *enabledExporterCount);
422
423SECStatus exportKeyingMaterials(PRFileDesc *fd,
424 const secuExporter *exporters,
425 unsigned int exporterCount);
412426
413/*427/*
414 *428 *
diff --git a/nss/cmd/p7env/p7env.c b/nss/cmd/p7env/p7env.c
index b35bf9a..453cbee 100644
--- a/nss/cmd/p7env/p7env.c
+++ b/nss/cmd/p7env/p7env.c
@@ -66,7 +66,7 @@ EncryptFile(FILE *outFile, FILE *inFile, struct recipient *recipients,
66 SEC_PKCS7ContentInfo *cinfo;66 SEC_PKCS7ContentInfo *cinfo;
67 SEC_PKCS7EncoderContext *ecx;67 SEC_PKCS7EncoderContext *ecx;
68 struct recipient *rcpt;68 struct recipient *rcpt;
69 SECStatus rv;69 SECStatus rv = SECFailure;
7070
71 if (outFile == NULL || inFile == NULL || recipients == NULL)71 if (outFile == NULL || inFile == NULL || recipients == NULL)
72 return -1;72 return -1;
@@ -133,7 +133,7 @@ main(int argc, char **argv)
133 struct recipient *recipients, *rcpt;133 struct recipient *recipients, *rcpt;
134 PLOptState *optstate;134 PLOptState *optstate;
135 PLOptStatus status;135 PLOptStatus status;
136 SECStatus rv;136 SECStatus rv = SECFailure;
137137
138 progName = strrchr(argv[0], '/');138 progName = strrchr(argv[0], '/');
139 progName = progName ? progName + 1 : argv[0];139 progName = progName ? progName + 1 : argv[0];
diff --git a/nss/cmd/pk11importtest/pk11importtest.c b/nss/cmd/pk11importtest/pk11importtest.c
index eb8e359..e832659 100644
--- a/nss/cmd/pk11importtest/pk11importtest.c
+++ b/nss/cmd/pk11importtest/pk11importtest.c
@@ -176,7 +176,9 @@ cleanup:
176 }176 }
177 SECITEM_FreeItem(&pubValue, PR_FALSE);177 SECITEM_FreeItem(&pubValue, PR_FALSE);
178 SECITEM_FreeItem(&privID, PR_FALSE);178 SECITEM_FreeItem(&privID, PR_FALSE);
179 PORT_FreeArena(epki->arena, PR_TRUE);179 if (epki && epki->arena) {
180 PORT_FreeArena(epki->arena, PR_TRUE);
181 }
180 SECKEY_DestroyPublicKey(pubKey);182 SECKEY_DestroyPublicKey(pubKey);
181 SECKEY_DestroyPrivateKey(privKey);183 SECKEY_DestroyPrivateKey(privKey);
182 fprintf(stderr, "%s PrivateKeyImport %s ***********************\n",184 fprintf(stderr, "%s PrivateKeyImport %s ***********************\n",
diff --git a/nss/cmd/pk11mode/pk11mode.c b/nss/cmd/pk11mode/pk11mode.c
index 9989109..1655453 100644
--- a/nss/cmd/pk11mode/pk11mode.c
+++ b/nss/cmd/pk11mode/pk11mode.c
@@ -5229,7 +5229,7 @@ PKM_Digest(CK_FUNCTION_LIST_PTR pFunctionList,
5229char *5229char *
5230PKM_FilePasswd(char *pwFile)5230PKM_FilePasswd(char *pwFile)
5231{5231{
5232 unsigned char phrase[200];5232 unsigned char phrase[500];
5233 PRFileDesc *fd;5233 PRFileDesc *fd;
5234 PRInt32 nb;5234 PRInt32 nb;
5235 int i;5235 int i;
diff --git a/nss/cmd/pk12util/pk12util.c b/nss/cmd/pk12util/pk12util.c
index 5884713..794f17b 100644
--- a/nss/cmd/pk12util/pk12util.c
+++ b/nss/cmd/pk12util/pk12util.c
@@ -644,6 +644,7 @@ P12U_ExportPKCS12Object(char *nn, char *outfile, PK11SlotInfo *inSlot,
644 }644 }
645 certlist = PK11_FindCertsFromNickname(nn, slotPw);645 certlist = PK11_FindCertsFromNickname(nn, slotPw);
646 if (!certlist) {646 if (!certlist) {
647 PORT_SetError(SEC_ERROR_UNKNOWN_CERT);
647 SECU_PrintError(progName, "find user certs from nickname failed");648 SECU_PrintError(progName, "find user certs from nickname failed");
648 pk12uErrno = PK12UERR_FINDCERTBYNN;649 pk12uErrno = PK12UERR_FINDCERTBYNN;
649 return;650 return;
diff --git a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk
index a59d03d..6401778 100644
--- a/nss/cmd/platlibs.mk
+++ b/nss/cmd/platlibs.mk
@@ -144,8 +144,8 @@ endif
144ifeq ($(OS_ARCH), WINNT)144ifeq ($(OS_ARCH), WINNT)
145145
146EXTRA_LIBS += \146EXTRA_LIBS += \
147 $(NSS_LIBS_1) \
148 $(SECTOOL_LIB) \147 $(SECTOOL_LIB) \
148 $(NSS_LIBS_1) \
149 $(NSS_LIBS_2) \149 $(NSS_LIBS_2) \
150 $(SOFTOKENLIB) \150 $(SOFTOKENLIB) \
151 $(CRYPTOLIB) \151 $(CRYPTOLIB) \
@@ -161,8 +161,8 @@ EXTRA_LIBS += \
161else161else
162162
163EXTRA_LIBS += \163EXTRA_LIBS += \
164 $(NSS_LIBS_1) \
165 $(SECTOOL_LIB) \164 $(SECTOOL_LIB) \
165 $(NSS_LIBS_1) \
166 $(NSS_LIBS_2) \166 $(NSS_LIBS_2) \
167 $(SOFTOKENLIB) \167 $(SOFTOKENLIB) \
168 $(NSS_LIBS_3) \168 $(NSS_LIBS_3) \
diff --git a/nss/cmd/selfserv/selfserv.c b/nss/cmd/selfserv/selfserv.c
index f2b1273..03e39d6 100644
--- a/nss/cmd/selfserv/selfserv.c
+++ b/nss/cmd/selfserv/selfserv.c
@@ -235,7 +235,13 @@ PrintParameterUsage()
235 " rsa_pss_pss_sha256, rsa_pss_pss_sha384, rsa_pss_pss_sha512,\n"235 " rsa_pss_pss_sha256, rsa_pss_pss_sha384, rsa_pss_pss_sha512,\n"
236 "-Z enable 0-RTT (for TLS 1.3; also use -u)\n"236 "-Z enable 0-RTT (for TLS 1.3; also use -u)\n"
237 "-E enable post-handshake authentication\n"237 "-E enable post-handshake authentication\n"
238 " (for TLS 1.3; only has an effect with 3 or more -r options)\n",238 " (for TLS 1.3; only has an effect with 3 or more -r options)\n"
239 "-x Export and print keying material after successful handshake\n"
240 " The argument is a comma separated list of exporters in the form:\n"
241 " LABEL[:OUTPUT-LENGTH[:CONTEXT]]\n"
242 " where LABEL and CONTEXT can be either a free-form string or\n"
243 " a hex string if it is preceded by \"0x\"; OUTPUT-LENGTH\n"
244 " is a decimal integer.\n",
239 stderr);245 stderr);
240}246}
241247
@@ -812,6 +818,8 @@ SSLNamedGroup *enabledGroups = NULL;
812unsigned int enabledGroupsCount = 0;818unsigned int enabledGroupsCount = 0;
813const SSLSignatureScheme *enabledSigSchemes = NULL;819const SSLSignatureScheme *enabledSigSchemes = NULL;
814unsigned int enabledSigSchemeCount = 0;820unsigned int enabledSigSchemeCount = 0;
821const secuExporter *enabledExporters = NULL;
822unsigned int enabledExporterCount = 0;
815823
816static char *virtServerNameArray[MAX_VIRT_SERVER_NAME_ARRAY_INDEX];824static char *virtServerNameArray[MAX_VIRT_SERVER_NAME_ARRAY_INDEX];
817static int virtServerNameIndex = 1;825static int virtServerNameIndex = 1;
@@ -1822,6 +1830,15 @@ handshakeCallback(PRFileDesc *fd, void *client_data)
1822 SECITEM_FreeItem(hostInfo, PR_TRUE);1830 SECITEM_FreeItem(hostInfo, PR_TRUE);
1823 }1831 }
1824 }1832 }
1833 if (enabledExporters) {
1834 SECStatus rv = exportKeyingMaterials(fd, enabledExporters, enabledExporterCount);
1835 if (rv != SECSuccess) {
1836 PRErrorCode err = PR_GetError();
1837 fprintf(stderr,
1838 "couldn't export keying material: %s\n",
1839 SECU_Strerror(err));
1840 }
1841 }
1825}1842}
18261843
1827void1844void
@@ -2012,7 +2029,7 @@ server_main(
2012 errExit("SSL_CipherPrefSetDefault:TLS_RSA_WITH_NULL_MD5");2029 errExit("SSL_CipherPrefSetDefault:TLS_RSA_WITH_NULL_MD5");
2013 }2030 }
20142031
2015 if (expectedHostNameVal) {2032 if (expectedHostNameVal || enabledExporters) {
2016 SSL_HandshakeCallback(model_sock, handshakeCallback,2033 SSL_HandshakeCallback(model_sock, handshakeCallback,
2017 (void *)expectedHostNameVal);2034 (void *)expectedHostNameVal);
2018 }2035 }
@@ -2246,11 +2263,11 @@ main(int argc, char **argv)
22462263
2247 /* please keep this list of options in ASCII collating sequence.2264 /* please keep this list of options in ASCII collating sequence.
2248 ** numbers, then capital letters, then lower case, alphabetical.2265 ** numbers, then capital letters, then lower case, alphabetical.
2249 ** XXX: 'B', 'E', 'q', and 'x' were used in the past but removed2266 ** XXX: 'B', and 'q' were used in the past but removed
2250 ** in 3.28, please leave some time before resuing those.2267 ** in 3.28, please leave some time before resuing those.
2251 ** 'z' was removed in 3.39. */2268 ** 'z' was removed in 3.39. */
2252 optstate = PL_CreateOptState(argc, argv,2269 optstate = PL_CreateOptState(argc, argv,
2253 "2:A:C:DEGH:I:J:L:M:NP:QRS:T:U:V:W:YZa:bc:d:e:f:g:hi:jk:lmn:op:rst:uvw:y");2270 "2:A:C:DEGH:I:J:L:M:NP:QRS:T:U:V:W:YZa:bc:d:e:f:g:hi:jk:lmn:op:rst:uvw:x:y");
2254 while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {2271 while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
2255 ++optionsFound;2272 ++optionsFound;
2256 switch (optstate->option) {2273 switch (optstate->option) {
@@ -2496,6 +2513,17 @@ main(int argc, char **argv)
2496 }2513 }
2497 break;2514 break;
24982515
2516 case 'x':
2517 rv = parseExporters(optstate->value,
2518 &enabledExporters, &enabledExporterCount);
2519 if (rv != SECSuccess) {
2520 PL_DestroyOptState(optstate);
2521 fprintf(stderr, "Bad exporter specified.\n");
2522 fprintf(stderr, "Run '%s -h' for usage information.\n", progName);
2523 exit(5);
2524 }
2525 break;
2526
2499 default:2527 default:
2500 case '?':2528 case '?':
2501 fprintf(stderr, "Unrecognized or bad option specified.\n");2529 fprintf(stderr, "Unrecognized or bad option specified.\n");
@@ -2685,8 +2713,10 @@ main(int argc, char **argv)
2685 }2713 }
2686 if (cipher > 0) {2714 if (cipher > 0) {
2687 rv = SSL_CipherPrefSetDefault(cipher, SSL_ALLOWED);2715 rv = SSL_CipherPrefSetDefault(cipher, SSL_ALLOWED);
2688 if (rv != SECSuccess)2716 if (rv != SECSuccess) {
2689 SECU_PrintError(progName, "SSL_CipherPrefSet()");2717 SECU_PrintError(progName, "SSL_CipherPrefSetDefault()");
2718 exit(9);
2719 }
2690 } else {2720 } else {
2691 fprintf(stderr,2721 fprintf(stderr,
2692 "Invalid cipher specification (-c arg).\n");2722 "Invalid cipher specification (-c arg).\n");
diff --git a/nss/cmd/shlibsign/shlibsign.c b/nss/cmd/shlibsign/shlibsign.c
index 221d1e6..b0a7512 100644
--- a/nss/cmd/shlibsign/shlibsign.c
+++ b/nss/cmd/shlibsign/shlibsign.c
@@ -614,7 +614,7 @@ cleanup:
614static char *614static char *
615filePasswd(char *pwFile)615filePasswd(char *pwFile)
616{616{
617 unsigned char phrase[200];617 unsigned char phrase[500];
618 PRFileDesc *fd;618 PRFileDesc *fd;
619 PRInt32 nb;619 PRInt32 nb;
620 int i;620 int i;
diff --git a/nss/cmd/strsclnt/strsclnt.c b/nss/cmd/strsclnt/strsclnt.c
index 099b7bf..3d9fc4f 100644
--- a/nss/cmd/strsclnt/strsclnt.c
+++ b/nss/cmd/strsclnt/strsclnt.c
@@ -166,6 +166,9 @@ Usage(void)
166 " -u enable TLS Session Ticket extension\n"166 " -u enable TLS Session Ticket extension\n"
167 " -z enable compression\n"167 " -z enable compression\n"
168 " -g enable false start\n"168 " -g enable false start\n"
169 " -4 Enforce using an IPv4 destination address\n"
170 " -6 Enforce using an IPv6 destination address\n"
171 " Note: Default behavior is both IPv4 and IPv6 enabled\n"
169 " -J enable signature schemes\n"172 " -J enable signature schemes\n"
170 " This takes a comma separated list of signature schemes in preference\n"173 " This takes a comma separated list of signature schemes in preference\n"
171 " order.\n"174 " order.\n"
@@ -1061,7 +1064,9 @@ client_main(
1061 int connections,1064 int connections,
1062 cert_and_key *Cert_And_Key,1065 cert_and_key *Cert_And_Key,
1063 const char *hostName,1066 const char *hostName,
1064 const char *sniHostName)1067 const char *sniHostName,
1068 PRBool allowIPv4,
1069 PRBool allowIPv6)
1065{1070{
1066 PRFileDesc *model_sock = NULL;1071 PRFileDesc *model_sock = NULL;
1067 int i;1072 int i;
@@ -1083,11 +1088,15 @@ client_main(
1083 SECU_PrintError(progName, "error looking up host");1088 SECU_PrintError(progName, "error looking up host");
1084 return;1089 return;
1085 }1090 }
1086 do {1091 for (;;) {
1087 enumPtr = PR_EnumerateAddrInfo(enumPtr, addrInfo, port, &addr);1092 enumPtr = PR_EnumerateAddrInfo(enumPtr, addrInfo, port, &addr);
1088 } while (enumPtr != NULL &&1093 if (enumPtr == NULL)
1089 addr.raw.family != PR_AF_INET &&1094 break;
1090 addr.raw.family != PR_AF_INET6);1095 if (addr.raw.family == PR_AF_INET && allowIPv4)
1096 break;
1097 if (addr.raw.family == PR_AF_INET6 && allowIPv6)
1098 break;
1099 }
1091 PR_FreeAddrInfo(addrInfo);1100 PR_FreeAddrInfo(addrInfo);
1092 if (enumPtr == NULL) {1101 if (enumPtr == NULL) {
1093 SECU_PrintError(progName, "error looking up host address");1102 SECU_PrintError(progName, "error looking up host address");
@@ -1319,6 +1328,8 @@ main(int argc, char **argv)
1319 int connections = 1;1328 int connections = 1;
1320 int exitVal;1329 int exitVal;
1321 int tmpInt;1330 int tmpInt;
1331 PRBool allowIPv4 = PR_TRUE;
1332 PRBool allowIPv6 = PR_TRUE;
1322 unsigned short port = 443;1333 unsigned short port = 443;
1323 SECStatus rv;1334 SECStatus rv;
1324 PLOptState *optstate;1335 PLOptState *optstate;
@@ -1338,9 +1349,25 @@ main(int argc, char **argv)
1338 /* XXX: 'B' was used in the past but removed in 3.28,1349 /* XXX: 'B' was used in the past but removed in 3.28,
1339 * please leave some time before resuing it. */1350 * please leave some time before resuing it. */
1340 optstate = PL_CreateOptState(argc, argv,1351 optstate = PL_CreateOptState(argc, argv,
1341 "C:DJ:NP:TUV:W:a:c:d:f:gin:op:qst:uvw:z");1352 "46C:DJ:NP:TUV:W:a:c:d:f:gin:op:qst:uvw:z");
1342 while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {1353 while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
1343 switch (optstate->option) {1354 switch (optstate->option) {
1355 case '4':
1356 if (!allowIPv4) {
1357 fprintf(stderr, "Only one of [-4, -6] can be specified.\n");
1358 Usage();
1359 }
1360 allowIPv6 = PR_FALSE;
1361 break;
1362
1363 case '6':
1364 if (!allowIPv6) {
1365 fprintf(stderr, "Only one of [-4, -6] can be specified.\n");
1366 Usage();
1367 }
1368 allowIPv4 = PR_FALSE;
1369 break;
1370
1344 case 'C':1371 case 'C':
1345 cipherString = optstate->value;1372 cipherString = optstate->value;
1346 break;1373 break;
@@ -1523,7 +1550,7 @@ main(int argc, char **argv)
1523 }1550 }
15241551
1525 client_main(port, connections, &Cert_And_Key, hostName,1552 client_main(port, connections, &Cert_And_Key, hostName,
1526 sniHostName);1553 sniHostName, allowIPv4, allowIPv6);
15271554
1528 /* clean up */1555 /* clean up */
1529 if (Cert_And_Key.cert) {1556 if (Cert_And_Key.cert) {
diff --git a/nss/cmd/symkeyutil/symkeyutil.c b/nss/cmd/symkeyutil/symkeyutil.c
index 31ab4dd..6304338 100644
--- a/nss/cmd/symkeyutil/symkeyutil.c
+++ b/nss/cmd/symkeyutil/symkeyutil.c
@@ -254,7 +254,7 @@ HexToBuf(char *inString, SECItem *outbuf)
254 int trueLen = 0;254 int trueLen = 0;
255255
256 outbuf->data = PORT_Alloc(outlen);256 outbuf->data = PORT_Alloc(outlen);
257 if (outbuf->data) {257 if (!outbuf->data) {
258 return -1;258 return -1;
259 }259 }
260260
diff --git a/nss/cmd/tstclnt/tstclnt.c b/nss/cmd/tstclnt/tstclnt.c
index 12c6df0..6fa1541 100644
--- a/nss/cmd/tstclnt/tstclnt.c
+++ b/nss/cmd/tstclnt/tstclnt.c
@@ -318,6 +318,13 @@ PrintParameterUsage()
318 fprintf(stderr, "%-20s Enable post-handshake authentication\n"318 fprintf(stderr, "%-20s Enable post-handshake authentication\n"
319 "%-20s for TLS 1.3; need to specify -n\n",319 "%-20s for TLS 1.3; need to specify -n\n",
320 "-E", "");320 "-E", "");
321 fprintf(stderr, "%-20s Export and print keying material after successful handshake.\n"
322 "%-20s The argument is a comma separated list of exporters in the form:\n"
323 "%-20s LABEL[:OUTPUT-LENGTH[:CONTEXT]]\n"
324 "%-20s where LABEL and CONTEXT can be either a free-form string or\n"
325 "%-20s a hex string if it is preceded by \"0x\"; OUTPUT-LENGTH\n"
326 "%-20s is a decimal integer.\n",
327 "-x", "", "", "", "", "");
321}328}
322329
323static void330static void
@@ -924,7 +931,7 @@ restartHandshakeAfterServerCertIfNeeded(PRFileDesc *fd,
924 PRBool override)931 PRBool override)
925{932{
926 SECStatus rv;933 SECStatus rv;
927 PRErrorCode error;934 PRErrorCode error = 0;
928935
929 if (!serverCertAuth->isPaused)936 if (!serverCertAuth->isPaused)
930 return SECSuccess;937 return SECSuccess;
@@ -998,6 +1005,8 @@ PRBool handshakeComplete = PR_FALSE;
998char *encryptedSNIKeys = NULL;1005char *encryptedSNIKeys = NULL;
999PRBool enablePostHandshakeAuth = PR_FALSE;1006PRBool enablePostHandshakeAuth = PR_FALSE;
1000PRBool enableDelegatedCredentials = PR_FALSE;1007PRBool enableDelegatedCredentials = PR_FALSE;
1008const secuExporter *enabledExporters = NULL;
1009unsigned int enabledExporterCount = 0;
10011010
1002static int1011static int
1003writeBytesToServer(PRFileDesc *s, const PRUint8 *buf, int nb)1012writeBytesToServer(PRFileDesc *s, const PRUint8 *buf, int nb)
@@ -1093,6 +1102,18 @@ handshakeCallback(PRFileDesc *fd, void *client_data)
1093 requestToExit = PR_TRUE;1102 requestToExit = PR_TRUE;
1094 }1103 }
1095 handshakeComplete = PR_TRUE;1104 handshakeComplete = PR_TRUE;
1105
1106 if (enabledExporters) {
1107 SECStatus rv;
1108
1109 rv = exportKeyingMaterials(fd, enabledExporters, enabledExporterCount);
1110 if (rv != SECSuccess) {
1111 PRErrorCode err = PR_GetError();
1112 FPRINTF(stderr,
1113 "couldn't export keying material: %s\n",
1114 SECU_Strerror(err));
1115 }
1116 }
1096}1117}
10971118
1098static SECStatus1119static SECStatus
@@ -1313,8 +1334,11 @@ run()
1313 }1334 }
1314 if (cipher > 0) {1335 if (cipher > 0) {
1315 rv = SSL_CipherPrefSet(s, cipher, SSL_ALLOWED);1336 rv = SSL_CipherPrefSet(s, cipher, SSL_ALLOWED);
1316 if (rv != SECSuccess)1337 if (rv != SECSuccess) {
1317 SECU_PrintError(progName, "SSL_CipherPrefSet()");1338 SECU_PrintError(progName, "SSL_CipherPrefSet()");
1339 error = 1;
1340 goto done;
1341 }
1318 } else {1342 } else {
1319 Usage();1343 Usage();
1320 }1344 }
@@ -1732,7 +1756,7 @@ main(int argc, char **argv)
1732 * Please leave some time before reusing these.1756 * Please leave some time before reusing these.
1733 */1757 */
1734 optstate = PL_CreateOptState(argc, argv,1758 optstate = PL_CreateOptState(argc, argv,
1735 "46A:BCDEFGHI:J:KL:M:N:OP:QR:STUV:W:X:YZa:bc:d:fgh:m:n:op:qr:st:uvw:");1759 "46A:BCDEFGHI:J:KL:M:N:OP:QR:STUV:W:X:YZa:bc:d:fgh:m:n:op:qr:st:uvw:x:");
1736 while ((optstatus = PL_GetNextOpt(optstate)) == PL_OPT_OK) {1760 while ((optstatus = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
1737 switch (optstate->option) {1761 switch (optstate->option) {
1738 case '?':1762 case '?':
@@ -1980,6 +2004,17 @@ main(int argc, char **argv)
1980 Usage();2004 Usage();
1981 }2005 }
1982 break;2006 break;
2007
2008 case 'x':
2009 rv = parseExporters(optstate->value,
2010 &enabledExporters,
2011 &enabledExporterCount);
2012 if (rv != SECSuccess) {
2013 PL_DestroyOptState(optstate);
2014 fprintf(stderr, "Bad exporter specified.\n");
2015 Usage();
2016 }
2017 break;
1983 }2018 }
1984 }2019 }
1985 PL_DestroyOptState(optstate);2020 PL_DestroyOptState(optstate);
diff --git a/nss/cmd/vfyserv/vfyserv.c b/nss/cmd/vfyserv/vfyserv.c
index 4234ecd..3c6d014 100644
--- a/nss/cmd/vfyserv/vfyserv.c
+++ b/nss/cmd/vfyserv/vfyserv.c
@@ -544,7 +544,12 @@ main(int argc, char **argv)
544 }544 }
545 }545 }
546 if (cipher > 0) {546 if (cipher > 0) {
547 SSL_CipherPrefSetDefault(cipher, PR_TRUE);547 SECStatus rv = SSL_CipherPrefSetDefault(cipher, PR_TRUE);
548 if (rv != SECSuccess) {
549 SECU_PrintError(progName,
550 "error setting cipher default preference");
551 goto cleanup;
552 }
548 } else {553 } else {
549 Usage(progName);554 Usage(progName);
550 }555 }
diff --git a/nss/coreconf/UNIX.mk b/nss/coreconf/UNIX.mk
index b448e75..8f6042e 100644
--- a/nss/coreconf/UNIX.mk
+++ b/nss/coreconf/UNIX.mk
@@ -14,9 +14,7 @@ ifdef BUILD_OPT
14 DEFINES += -UDEBUG -DNDEBUG14 DEFINES += -UDEBUG -DNDEBUG
15else15else
16 OPTIMIZER += -g16 OPTIMIZER += -g
17 USERNAME := $(shell whoami)17 DEFINES += -DDEBUG -UNDEBUG
18 USERNAME := $(subst -,_,$(USERNAME))
19 DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
20endif18endif
2119
22ifdef BUILD_TREE20ifdef BUILD_TREE
diff --git a/nss/coreconf/WIN32.mk b/nss/coreconf/WIN32.mk
index be795f0..7269cc7 100644
--- a/nss/coreconf/WIN32.mk
+++ b/nss/coreconf/WIN32.mk
@@ -104,7 +104,7 @@ endif
104DLL_SUFFIX = dll104DLL_SUFFIX = dll
105105
106ifdef NS_USE_GCC106ifdef NS_USE_GCC
107 OS_CFLAGS += -mwindows -mms-bitfields107 OS_CFLAGS += -mwindows
108 _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)108 _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
109 DLLFLAGS += -mwindows -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))109 DLLFLAGS += -mwindows -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
110 ifdef BUILD_OPT110 ifdef BUILD_OPT
@@ -116,11 +116,7 @@ ifdef NS_USE_GCC
116 DEFINES += -UDEBUG -DNDEBUG116 DEFINES += -UDEBUG -DNDEBUG
117 else117 else
118 OPTIMIZER += -g118 OPTIMIZER += -g
119 NULLSTRING :=119 DEFINES += -DDEBUG -UNDEBUG
120 SPACE := $(NULLSTRING) # end of the line
121 USERNAME := $(subst $(SPACE),_,$(USERNAME))
122 USERNAME := $(subst -,_,$(USERNAME))
123 DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
124 endif120 endif
125else # !NS_USE_GCC121else # !NS_USE_GCC
126 WARNING_CFLAGS = -W3 -nologo -D_CRT_SECURE_NO_WARNINGS \122 WARNING_CFLAGS = -W3 -nologo -D_CRT_SECURE_NO_WARNINGS \
@@ -179,10 +175,7 @@ else # !NS_USE_GCC
179 else175 else
180 OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od176 OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od
181 NULLSTRING :=177 NULLSTRING :=
182 SPACE := $(NULLSTRING) # end of the line178 DEFINES += -DDEBUG -UNDEBUG
183 USERNAME := $(subst $(SPACE),_,$(USERNAME))
184 USERNAME := $(subst -,_,$(USERNAME))
185 DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
186 DLLFLAGS += -DEBUG -OUT:$@179 DLLFLAGS += -DEBUG -OUT:$@
187 LDFLAGS += -DEBUG 180 LDFLAGS += -DEBUG
188ifeq ($(_MSC_VER),$(_MSC_VER_6))181ifeq ($(_MSC_VER),$(_MSC_VER_6))
diff --git a/nss/coreconf/config.gypi b/nss/coreconf/config.gypi
index 2f17c82..f4426ac 100644
--- a/nss/coreconf/config.gypi
+++ b/nss/coreconf/config.gypi
@@ -96,6 +96,7 @@
96 'cc_is_gcc%': '<(cc_is_gcc)',96 'cc_is_gcc%': '<(cc_is_gcc)',
97 'cc_use_gnu_ld%': '<(cc_use_gnu_ld)',97 'cc_use_gnu_ld%': '<(cc_use_gnu_ld)',
98 # Some defaults98 # Some defaults
99 'disable_arm_hw_aes%': 0,
99 'disable_tests%': 0,100 'disable_tests%': 0,
100 'disable_chachapoly%': 0,101 'disable_chachapoly%': 0,
101 'disable_dbm%': 0,102 'disable_dbm%': 0,
diff --git a/nss/coreconf/nspr.sh b/nss/coreconf/nspr.sh
index 325a188..d84674e 100644
--- a/nss/coreconf/nspr.sh
+++ b/nss/coreconf/nspr.sh
@@ -36,15 +36,30 @@ nspr_build()
36 extra_params+=(--enable-64bit)36 extra_params+=(--enable-64bit)
37 fi37 fi
3838
39 echo "NSPR [1/3] configure ..."39 echo "NSPR [1/5] configure ..."
40 pushd "$nspr_dir" >/dev/null40 pushd "$nspr_dir" >/dev/null
41 CFLAGS="$nspr_cflags" CXXFLAGS="$nspr_cxxflags" \41 CFLAGS="$nspr_cflags" CXXFLAGS="$nspr_cxxflags" \
42 LDFLAGS="$nspr_ldflags" CC="$CC" CXX="$CCC" \42 LDFLAGS="$nspr_ldflags" CC="$CC" CXX="$CCC" \
43 run_verbose ../configure "${extra_params[@]}" "$@"43 run_verbose ../configure "${extra_params[@]}" "$@"
44 popd >/dev/null44 popd >/dev/null
45 echo "NSPR [2/3] make ..."45 echo "NSPR [2/5] make ..."
46 run_verbose make -C "$nspr_dir"46 run_verbose make -C "$nspr_dir"
47 echo "NSPR [3/3] install ..."47
48 if [ "$build_nspr_tests" = 1 ]; then
49 echo "NSPR [3/5] build tests ..."
50 run_verbose make -C "$nspr_dir/pr/tests"
51 else
52 echo "NSPR [3/5] NOT building tests"
53 fi
54
55 if [[ "$build_nspr_tests" = 1 && "$run_nspr_tests" = 1 ]]; then
56 echo "NSPR [4/5] run tests ..."
57 run_verbose make -C "$nspr_dir/pr/tests" runtests
58 else
59 echo "NSPR [4/5] NOT running tests"
60 fi
61
62 echo "NSPR [5/5] install ..."
48 run_verbose make -C "$nspr_dir" install63 run_verbose make -C "$nspr_dir" install
49}64}
5065
diff --git a/nss/cpputil/freebl_scoped_ptrs.h b/nss/cpputil/freebl_scoped_ptrs.h
51new file mode 10064466new file mode 100644
index 0000000..2f21ca9
--- /dev/null
+++ b/nss/cpputil/freebl_scoped_ptrs.h
@@ -0,0 +1,33 @@
1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set ts=2 et sw=2 tw=80: */
3/* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7#ifndef freebl_scoped_ptrs_h__
8#define freebl_scoped_ptrs_h__
9
10#include <memory>
11#include "blapi.h"
12
13struct ScopedDelete {
14 void operator()(CMACContext* ctx) { CMAC_Destroy(ctx, PR_TRUE); }
15};
16
17template <class T>
18struct ScopedMaybeDelete {
19 void operator()(T* ptr) {
20 if (ptr) {
21 ScopedDelete del;
22 del(ptr);
23 }
24 }
25};
26
27#define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x> > Scoped##x
28
29SCOPED(CMACContext);
30
31#undef SCOPED
32
33#endif // freebl_scoped_ptrs_h__
diff --git a/nss/cpputil/nss_scoped_ptrs.h b/nss/cpputil/nss_scoped_ptrs.h
index 9b1fbb4..3ee7c9e 100644
--- a/nss/cpputil/nss_scoped_ptrs.h
+++ b/nss/cpputil/nss_scoped_ptrs.h
@@ -21,13 +21,19 @@ struct ScopedDelete {
21 void operator()(CERTCertificateList* list) {21 void operator()(CERTCertificateList* list) {
22 CERT_DestroyCertificateList(list);22 CERT_DestroyCertificateList(list);
23 }23 }
24 void operator()(CERTDistNames* names) { CERT_FreeDistNames(names); }
24 void operator()(CERTName* name) { CERT_DestroyName(name); }25 void operator()(CERTName* name) { CERT_DestroyName(name); }
25 void operator()(CERTCertList* list) { CERT_DestroyCertList(list); }26 void operator()(CERTCertList* list) { CERT_DestroyCertList(list); }
26 void operator()(CERTSubjectPublicKeyInfo* spki) {27 void operator()(CERTSubjectPublicKeyInfo* spki) {
27 SECKEY_DestroySubjectPublicKeyInfo(spki);28 SECKEY_DestroySubjectPublicKeyInfo(spki);
28 }29 }
30 void operator()(PK11Context* context) { PK11_DestroyContext(context, true); }
31 void operator()(PK11GenericObject* obj) { PK11_DestroyGenericObject(obj); }
29 void operator()(PK11SlotInfo* slot) { PK11_FreeSlot(slot); }32 void operator()(PK11SlotInfo* slot) { PK11_FreeSlot(slot); }
30 void operator()(PK11SymKey* key) { PK11_FreeSymKey(key); }33 void operator()(PK11SymKey* key) { PK11_FreeSymKey(key); }
34 void operator()(PK11URI* uri) { PK11URI_DestroyURI(uri); }
35 void operator()(PLArenaPool* arena) { PORT_FreeArena(arena, PR_FALSE); }
36 void operator()(PQGParams* pqg) { PK11_PQG_DestroyParams(pqg); }
31 void operator()(PRFileDesc* fd) { PR_Close(fd); }37 void operator()(PRFileDesc* fd) { PR_Close(fd); }
32 void operator()(SECAlgorithmID* id) { SECOID_DestroyAlgorithmID(id, true); }38 void operator()(SECAlgorithmID* id) { SECOID_DestroyAlgorithmID(id, true); }
33 void operator()(SECKEYEncryptedPrivateKeyInfo* e) {39 void operator()(SECKEYEncryptedPrivateKeyInfo* e) {
@@ -39,16 +45,10 @@ struct ScopedDelete {
39 void operator()(SECKEYPrivateKeyList* list) {45 void operator()(SECKEYPrivateKeyList* list) {
40 SECKEY_DestroyPrivateKeyList(list);46 SECKEY_DestroyPrivateKeyList(list);
41 }47 }
42 void operator()(PK11URI* uri) { PK11URI_DestroyURI(uri); }48 void operator()(SECMODModule* module) { SECMOD_DestroyModule(module); }
43 void operator()(PLArenaPool* arena) { PORT_FreeArena(arena, PR_FALSE); }
44 void operator()(PK11Context* context) { PK11_DestroyContext(context, true); }
45 void operator()(PK11GenericObject* obj) { PK11_DestroyGenericObject(obj); }
46 void operator()(PQGParams* pqg) { PK11_PQG_DestroyParams(pqg); }
47 void operator()(SEC_PKCS12DecoderContext* dcx) {49 void operator()(SEC_PKCS12DecoderContext* dcx) {
48 SEC_PKCS12DecoderFinish(dcx);50 SEC_PKCS12DecoderFinish(dcx);
49 }51 }
50 void operator()(CERTDistNames* names) { CERT_FreeDistNames(names); }
51 void operator()(SECMODModule* module) { SECMOD_DestroyModule(module); }
52};52};
5353
54template <class T>54template <class T>
@@ -63,34 +63,35 @@ struct ScopedMaybeDelete {
6363
64#define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x> > Scoped##x64#define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x> > Scoped##x
6565
66SCOPED(CERTCertList);
66SCOPED(CERTCertificate);67SCOPED(CERTCertificate);
67SCOPED(CERTCertificateList);68SCOPED(CERTCertificateList);
68SCOPED(CERTCertList);69SCOPED(CERTDistNames);
69SCOPED(CERTName);70SCOPED(CERTName);
70SCOPED(CERTSubjectPublicKeyInfo);71SCOPED(CERTSubjectPublicKeyInfo);
72SCOPED(PK11Context);
73SCOPED(PK11GenericObject);
71SCOPED(PK11SlotInfo);74SCOPED(PK11SlotInfo);
72SCOPED(PK11SymKey);75SCOPED(PK11SymKey);
76SCOPED(PK11URI);
77SCOPED(PLArenaPool);
73SCOPED(PQGParams);78SCOPED(PQGParams);
74SCOPED(PRFileDesc);79SCOPED(PRFileDesc);
75SCOPED(SECAlgorithmID);80SCOPED(SECAlgorithmID);
76SCOPED(SECKEYEncryptedPrivateKeyInfo);
77SCOPED(SECItem);81SCOPED(SECItem);
78SCOPED(SECKEYPublicKey);82SCOPED(SECKEYEncryptedPrivateKeyInfo);
79SCOPED(SECKEYPrivateKey);83SCOPED(SECKEYPrivateKey);
80SCOPED(SECKEYPrivateKeyList);84SCOPED(SECKEYPrivateKeyList);
81SCOPED(PK11URI);85SCOPED(SECKEYPublicKey);
82SCOPED(PLArenaPool);
83SCOPED(PK11Context);
84SCOPED(PK11GenericObject);
85SCOPED(SEC_PKCS12DecoderContext);
86SCOPED(CERTDistNames);
87SCOPED(SECMODModule);86SCOPED(SECMODModule);
87SCOPED(SEC_PKCS12DecoderContext);
8888
89#undef SCOPED89#undef SCOPED
9090
91struct StackSECItem : public SECItem {91struct StackSECItem : public SECItem {
92 StackSECItem() : SECItem({siBuffer, nullptr, 0}) {}92 StackSECItem() : SECItem({siBuffer, nullptr, 0}) {}
93 ~StackSECItem() { SECITEM_FreeItem(this, PR_FALSE); }93 ~StackSECItem() { Reset(); }
94 void Reset() { SECITEM_FreeItem(this, PR_FALSE); }
94};95};
9596
96#endif // nss_scoped_ptrs_h__97#endif // nss_scoped_ptrs_h__
diff --git a/nss/cpputil/scoped_ptrs_util.h b/nss/cpputil/scoped_ptrs_util.h
index dc6e1d7..d0a42ee 100644
--- a/nss/cpputil/scoped_ptrs_util.h
+++ b/nss/cpputil/scoped_ptrs_util.h
@@ -37,4 +37,9 @@ SCOPED(PLArenaPool);
3737
38#undef SCOPED38#undef SCOPED
3939
40struct StackSECItem : public SECItem {
41 StackSECItem() : SECItem({siBuffer, nullptr, 0}) {}
42 ~StackSECItem() { SECITEM_FreeItem(this, PR_FALSE); }
43};
44
40#endif // scoped_ptrs_util_h__45#endif // scoped_ptrs_util_h__
diff --git a/nss/cpputil/tls_parser.h b/nss/cpputil/tls_parser.h
index 2aa7a0e..015bd20 100644
--- a/nss/cpputil/tls_parser.h
+++ b/nss/cpputil/tls_parser.h
@@ -47,6 +47,7 @@ const uint8_t kTlsAlertIllegalParameter = 47;
47const uint8_t kTlsAlertDecodeError = 50;47const uint8_t kTlsAlertDecodeError = 50;
48const uint8_t kTlsAlertDecryptError = 51;48const uint8_t kTlsAlertDecryptError = 51;
49const uint8_t kTlsAlertProtocolVersion = 70;49const uint8_t kTlsAlertProtocolVersion = 70;
50const uint8_t kTlsAlertInsufficientSecurity = 71;
50const uint8_t kTlsAlertInternalError = 80;51const uint8_t kTlsAlertInternalError = 80;
51const uint8_t kTlsAlertInappropriateFallback = 86;52const uint8_t kTlsAlertInappropriateFallback = 86;
52const uint8_t kTlsAlertMissingExtension = 109;53const uint8_t kTlsAlertMissingExtension = 109;
diff --git a/nss/fuzz/fuzz.gyp b/nss/fuzz/fuzz.gyp
index 91e9b25..292930a 100644
--- a/nss/fuzz/fuzz.gyp
+++ b/nss/fuzz/fuzz.gyp
@@ -43,6 +43,7 @@
43 '<(DEPTH)/lib/pkcs7/pkcs7.gyp:pkcs7',43 '<(DEPTH)/lib/pkcs7/pkcs7.gyp:pkcs7',
44 # This is a static build of pk11wrap, softoken, and freebl.44 # This is a static build of pk11wrap, softoken, and freebl.
45 '<(DEPTH)/lib/pk11wrap/pk11wrap.gyp:pk11wrap_static',45 '<(DEPTH)/lib/pk11wrap/pk11wrap.gyp:pk11wrap_static',
46 '<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
46 ],47 ],
47 'cflags_cc': [48 'cflags_cc': [
48 '-Wno-error=shadow',49 '-Wno-error=shadow',
diff --git a/nss/gtests/common/testvectors/curve25519-vectors.h b/nss/gtests/common/testvectors/curve25519-vectors.h
index de44444..bf350cf 100644
--- a/nss/gtests/common/testvectors/curve25519-vectors.h
+++ b/nss/gtests/common/testvectors/curve25519-vectors.h
@@ -48,9 +48,9 @@ const curve25519_testvector kCurve25519Vectors[] = {
48 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a},48 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a},
49 {0x30, 0x38, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,49 {0x30, 0x38, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
50 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01,50 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01,
51 0x03, 0x20, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3, 0x5b,51 0x03, 0x20, 0x00, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3,
52 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78,52 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
53 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f},53 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b},
54 {},54 {},
55 false},55 false},
5656
@@ -70,6 +70,66 @@ const curve25519_testvector kCurve25519Vectors[] = {
70 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,70 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
71 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f, 0x34},71 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f, 0x34},
72 {},72 {},
73 false},
74
75 // A private key with leading zeros (they should not be stripped)
76 {{0x30, 0x67, 0x02, 0x01, 0x00, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48,
77 0xce, 0x3d, 0x02, 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda,
78 0x47, 0x0f, 0x01, 0x04, 0x4c, 0x30, 0x4a, 0x02, 0x01, 0x01, 0x04, 0x20,
79 0x00, 0x99, 0xD1, 0x90, 0x60, 0xCF, 0x79, 0xF0, 0x6F, 0x4F, 0x2E, 0x47,
80 0x97, 0x5B, 0x2A, 0x90, 0x01, 0x6C, 0x94, 0xF4, 0x3D, 0x94, 0x02, 0x57,
81 0x13, 0xDB, 0xB2, 0xA3, 0xD9, 0x54, 0x0B, 0xE5, 0xa1, 0x23, 0x03, 0x21,
82 0x05, 0x66, 0xA7, 0x26, 0xE0, 0xFC, 0x83, 0xEF, 0xA2, 0x56, 0xF4, 0xCC,
83 0xEA, 0x71, 0x07, 0x4D, 0xBB, 0x5C, 0x76, 0x0A, 0x9F, 0xF4, 0x7E, 0x5C,
84 0x5D, 0x4C, 0xB8, 0xDA, 0x9E, 0x44, 0x60, 0x52, 0x00},
85 {0x30, 0x39, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
86 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01,
87 0x03, 0x21, 0x00, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3,
88 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
89 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f},
90 {0xB9, 0x4B, 0x92, 0xEA, 0xDA, 0x64, 0x40, 0xD3, 0x08, 0x63, 0x06,
91 0x45, 0xF4, 0x4C, 0xCD, 0x19, 0x7B, 0xE6, 0x0A, 0xBC, 0x6C, 0x9D,
92 0x96, 0x8F, 0x5D, 0x70, 0x44, 0x55, 0xD0, 0x1B, 0xEE, 0x4A},
93 true},
94
95 // A private key that's too short
96 {{0x30, 0x66, 0x02, 0x01, 0x00, 0x30, 0x14, 0x06, 0x07, 0x2A, 0x86, 0x48,
97 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA,
98 0x47, 0x0F, 0x01, 0x04, 0x4B, 0x30, 0x49, 0x02, 0x01, 0x01, 0x04, 0x1F,
99 0x07, 0x6D, 0x0A, 0x73, 0x18, 0xA5, 0x7D, 0x3C, 0x16, 0xC1, 0x72, 0x51,
100 0xB2, 0x66, 0x45, 0xDF, 0x4C, 0x2F, 0x87, 0xEB, 0xC0, 0x99, 0x2A, 0xB1,
101 0x77, 0xFB, 0xA5, 0x1D, 0xB9, 0x2C, 0x2A, 0xA1, 0x23, 0x03, 0x21, 0x00,
102 0x85, 0x20, 0xF0, 0x09, 0x89, 0x30, 0xA7, 0x54, 0x74, 0x8B, 0x7D, 0xDC,
103 0xB4, 0x3E, 0xF7, 0x5A, 0x0D, 0xBF, 0x3A, 0x0D, 0x26, 0x38, 0x1A, 0xF4,
104 0xEB, 0xA4, 0xA9, 0x8E, 0xAA, 0x9B, 0x4E, 0x6A},
105 {0x30, 0x39, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
106 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01,
107 0x03, 0x21, 0x00, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3,
108 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
109 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f},
110 {0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1, 0x72, 0x8e, 0x3b,
111 0xf4, 0x80, 0x35, 0x0f, 0x25, 0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1,
112 0x9e, 0x33, 0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42},
113 false},
114
115 // A private key that's too long
116 {{0x30, 0x68, 0x02, 0x01, 0x00, 0x30, 0x14, 0x06, 0x07, 0x2A, 0x86, 0x48,
117 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA,
118 0x47, 0x0F, 0x01, 0x04, 0x4D, 0x30, 0x4B, 0x02, 0x01, 0x01, 0x04, 0x21,
119 0x43, 0x77, 0x07, 0x6D, 0x0A, 0x73, 0x18, 0xA5, 0x7D, 0x3C, 0x16, 0xC1,
120 0x72, 0x51, 0xB2, 0x66, 0x45, 0xDF, 0x4C, 0x2F, 0x87, 0xEB, 0xC0, 0x99,
121 0x2A, 0xB1, 0x77, 0xFB, 0xA5, 0x1D, 0xB9, 0x2C, 0x2A, 0xA1, 0x23, 0x03,
122 0x21, 0x00, 0x85, 0x20, 0xF0, 0x09, 0x89, 0x30, 0xA7, 0x54, 0x74, 0x8B,
123 0x7D, 0xDC, 0xB4, 0x3E, 0xF7, 0x5A, 0x0D, 0xBF, 0x3A, 0x0D, 0x26, 0x38,
124 0x1A, 0xF4, 0xEB, 0xA4, 0xA9, 0x8E, 0xAA, 0x9B, 0x4E, 0x6A},
125 {0x30, 0x39, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
126 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01,
127 0x03, 0x21, 0x00, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3,
128 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
129 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f},
130 {0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1, 0x72, 0x8e, 0x3b,
131 0xf4, 0x80, 0x35, 0x0f, 0x25, 0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1,
132 0x9e, 0x33, 0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42},
73 false}};133 false}};
74134
75// Testvectors from project wycheproof135// Testvectors from project wycheproof
diff --git a/nss/gtests/common/testvectors/kw-vectors.h b/nss/gtests/common/testvectors/kw-vectors.h
76new file mode 100644136new file mode 100644
index 0000000..38e641a
--- /dev/null
+++ b/nss/gtests/common/testvectors/kw-vectors.h
@@ -0,0 +1,1940 @@
1/* vim: set ts=2 et sw=2 tw=80: */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6#ifndef kw_vectors_h__
7#define kw_vectors_h__
8
9#include <string>
10#include <vector>
11#include <map>
12
13/* The result struct adds some granularity to what we are testing.
14 * With the single "valid" boolean, we don't know whether the function under
15 * test itself is expected to fail (i.e. return SECFailure), or if we simply
16 * expect the output to differ from what's in the test vector. Therefore,
17 * each vector contains a map of Actions (i.e. NSS capabilities that we wish to
18 * test) mapping to expected Result values (both in terms of return code as
19 * well as whether or not the output should match the test vector).
20 *
21 * - If |output_match| is true, the function under test MUST return the same
22 * data (length and contents).
23 * - If |output_match| is false, the function under test MUST NOT return the
24 * same data (length or contents must be different).
25 */
26
27typedef struct Result {
28 SECStatus expect_rv;
29 bool output_match;
30} Result;
31
32enum Action { WRAP, UNWRAP };
33
34typedef struct keywrap_vector {
35 uint32_t test_id;
36 std::vector<uint8_t> key;
37 std::vector<uint8_t> msg;
38 std::vector<uint8_t> ct;
39 std::map<Action, Result> tests;
40} keywrap_vector;
41
42const keywrap_vector kWycheproofAesKWVectors[] = {
43 {1,
44 {0x6f, 0x67, 0x48, 0x6d, 0x1e, 0x91, 0x44, 0x19, 0xcb, 0x43, 0xc2, 0x85,
45 0x09, 0xc7, 0xc1, 0xea},
46 {0x8d, 0xc0, 0x63, 0x2d, 0x92, 0xee, 0x0b, 0xe4, 0xf7, 0x40, 0x02, 0x84,
47 0x10, 0xb0, 0x82, 0x70},
48 {0x9d, 0xe4, 0x53, 0xce, 0xd5, 0xd4, 0xab, 0x46, 0xa5, 0x60, 0x17, 0x08,
49 0xee, 0xef, 0xef, 0xb5, 0xe5, 0x93, 0xe6, 0xae, 0x8e, 0x86, 0xb2, 0x6b},
50 {{Action::WRAP, {SECSuccess, true}},
51 {Action::UNWRAP, {SECSuccess, true}}}},
52
53 {2,
54 {0xa0, 0xb1, 0x71, 0x72, 0xbb, 0x29, 0x6d, 0xb7, 0xf5, 0xc8, 0x69, 0xe9,
55 0xa3, 0x6b, 0x5c, 0xe3},
56 {0x61, 0x5d, 0xd0, 0x22, 0xd6, 0x07, 0xc9, 0x10, 0xf2, 0x01, 0x78, 0xcb,
57 0xdf, 0x42, 0x06, 0x0f},
58 {0x8c, 0x3a, 0xba, 0x85, 0xcc, 0x0a, 0xe1, 0xae, 0x10, 0xb3, 0x66, 0x58,
59 0xb0, 0x68, 0xf5, 0x95, 0xba, 0xf8, 0xca, 0xaf, 0xb7, 0x45, 0xef, 0x3c},
60 {{Action::WRAP, {SECSuccess, true}},
61 {Action::UNWRAP, {SECSuccess, true}}}},
62
63 {3,
64 {0x0e, 0x49, 0xd5, 0x71, 0xc1, 0x9b, 0x52, 0x50, 0xef, 0xfd, 0x41, 0xd9,
65 0x4b, 0xde, 0x39, 0xd6},
66 {0xf2, 0x5e, 0x4d, 0xe8, 0xca, 0xca, 0x36, 0x3f, 0xd5, 0xf2, 0x94, 0x42,
67 0xeb, 0x14, 0x7b, 0x55},
68 {0x1d, 0xe0, 0x93, 0x65, 0x48, 0x26, 0xf1, 0x8f, 0xcd, 0x0f, 0x3f, 0xd4,
69 0x99, 0x41, 0x6f, 0xf2, 0x2e, 0xd7, 0x5e, 0xe1, 0x2f, 0xe0, 0xb6, 0x24},
70 {{Action::WRAP, {SECSuccess, true}},
71 {Action::UNWRAP, {SECSuccess, true}}}},
72
73 {4, // wrapped key is longer than wrapping key
74 {0xe0, 0xe1, 0x29, 0x59, 0x10, 0x91, 0x03, 0xe3, 0x0a, 0xe8, 0xb5, 0x68,
75 0x4a, 0x22, 0xe6, 0x62},
76 {0xdb, 0xb0, 0xf2, 0xbb, 0x2b, 0xe9, 0x12, 0xa2, 0x04, 0x30, 0x97, 0x2d,
77 0x98, 0x42, 0xce, 0x3f, 0xd3, 0xb9, 0x28, 0xe5, 0x73, 0xe1, 0xac, 0x8e},
78 {0x9c, 0x3d, 0xdc, 0x23, 0x82, 0x7b, 0x7b, 0x3c, 0x13, 0x10, 0x5f,
79 0x9e, 0x8b, 0x11, 0x52, 0x3b, 0xac, 0xcd, 0xfb, 0x6c, 0x8b, 0x7e,
80 0x78, 0x25, 0x49, 0x6e, 0x7a, 0x84, 0x0b, 0xd3, 0x2a, 0xec},
81 {{Action::WRAP, {SECSuccess, true}},
82 {Action::UNWRAP, {SECSuccess, true}}}},
83
84 {5, // wrapped key is longer than wrapping key
85 {0xdd, 0x58, 0x3d, 0x9f, 0x10, 0x59, 0x86, 0x14, 0x30, 0xec, 0x8b, 0x5d,
86 0x8a, 0x18, 0x0e, 0x9b},
87 {0xf2, 0xe3, 0x4f, 0x35, 0x63, 0x62, 0xa3, 0x1b, 0x51, 0xd6, 0xe0, 0x2b,
88 0xcd, 0x33, 0x3c, 0x9e, 0x61, 0x70, 0x49, 0x4c, 0xa5, 0xff, 0x54, 0x87},
89 {0xaf, 0xb7, 0x44, 0xaa, 0xf7, 0x46, 0xdc, 0xc0, 0xb5, 0x7f, 0x8b,
90 0x37, 0x8c, 0x40, 0x4c, 0xbe, 0x87, 0x7f, 0x44, 0xcf, 0x3d, 0x45,
91 0x14, 0x0d, 0x60, 0x81, 0x4e, 0xda, 0x3f, 0x54, 0x1f, 0x01},
92 {{Action::WRAP, {SECSuccess, true}},
93 {Action::UNWRAP, {SECSuccess, true}}}},
94
95 {6, // wrapped key is longer than wrapping key
96 {0xfa, 0xf5, 0xcc, 0xfa, 0xe4, 0x2b, 0x43, 0xce, 0xe2, 0xc5, 0xf0, 0xf3,
97 0x17, 0x7a, 0x7c, 0x5d},
98 {0x4e, 0x02, 0x08, 0x48, 0x33, 0x66, 0x0c, 0x46, 0x38, 0x30, 0x48, 0x3b,
99 0x36, 0xda, 0xb8, 0x66, 0xc6, 0x4c, 0x8c, 0xf7, 0x42, 0x9c, 0xac, 0x3d},
100 {0xcf, 0xf9, 0x8c, 0xd6, 0x4c, 0xb5, 0x1a, 0xb9, 0x9b, 0x81, 0xae,
101 0xe8, 0x2c, 0xee, 0x42, 0x74, 0xd0, 0xdf, 0x3e, 0x1b, 0x6a, 0x49,
102 0x43, 0xd3, 0x92, 0x36, 0xea, 0x98, 0x98, 0x46, 0xd0, 0xcc},
103 {{Action::WRAP, {SECSuccess, true}},
104 {Action::UNWRAP, {SECSuccess, true}}}},
105
106 {7, // wrapped key is longer than wrapping key
107 {0xc2, 0xb9, 0xd2, 0x3f, 0x28, 0x31, 0xdd, 0xcd, 0xeb, 0x45, 0x68, 0x53,
108 0xd4, 0x01, 0x4d, 0xb9},
109 {0xf4, 0xcf, 0xea, 0x98, 0xe5, 0x8b, 0x93, 0x9c, 0xc8, 0x59, 0x55,
110 0x43, 0x85, 0xcf, 0x3a, 0x6c, 0x7f, 0x82, 0x17, 0xf7, 0x28, 0xef,
111 0xb4, 0x31, 0xc9, 0x64, 0x78, 0x6d, 0xe8, 0x27, 0x49, 0x07},
112 {0x58, 0xdc, 0xfb, 0x0e, 0x7e, 0xc4, 0xd3, 0xbc, 0x80, 0x03,
113 0x41, 0x8d, 0x86, 0x5f, 0xbd, 0x52, 0x0c, 0x6b, 0x24, 0xb2,
114 0xbd, 0xe3, 0x5b, 0x1b, 0xe5, 0xb1, 0xc5, 0xff, 0x32, 0xa1,
115 0x30, 0xf3, 0x3d, 0x03, 0x5e, 0x59, 0x32, 0x61, 0x60, 0x83},
116 {{Action::WRAP, {SECSuccess, true}},
117 {Action::UNWRAP, {SECSuccess, true}}}},
118
119 {8, // wrapped key is longer than wrapping key
120 {0x62, 0x0a, 0x08, 0xf3, 0x20, 0xcd, 0xed, 0xbf, 0x7a, 0xe5, 0x51, 0xad,
121 0xd3, 0x48, 0xd9, 0x5e},
122 {0xce, 0xc3, 0x4e, 0xaf, 0x8e, 0x67, 0xe1, 0xce, 0x61, 0x9d, 0xdf,
123 0xc3, 0x09, 0x53, 0x1c, 0x42, 0xf1, 0x60, 0x33, 0xa7, 0xe2, 0xcb,
124 0xc4, 0xf5, 0xeb, 0x3a, 0x54, 0x81, 0x64, 0xe9, 0xb2, 0x91},
125 {0x4e, 0xe4, 0x7b, 0xd6, 0x8d, 0x41, 0x85, 0x86, 0xc4, 0x47,
126 0xa3, 0x91, 0x11, 0xe2, 0xec, 0x15, 0x02, 0xff, 0x0f, 0x17,
127 0x26, 0xea, 0x91, 0xc5, 0xd9, 0x73, 0x70, 0x40, 0x9d, 0x89,
128 0xb8, 0xe6, 0x6e, 0x88, 0x9b, 0x63, 0x8a, 0xc4, 0x0c, 0xed},
129 {{Action::WRAP, {SECSuccess, true}},
130 {Action::UNWRAP, {SECSuccess, true}}}},
131
132 {9, // wrapped key is longer than wrapping key
133 {0xed, 0x08, 0x9a, 0xc2, 0x74, 0xf8, 0xc7, 0xce, 0xa2, 0x41, 0x56, 0x71,
134 0xa9, 0x4b, 0x5e, 0x53},
135 {0x60, 0x65, 0xe4, 0x1d, 0xf1, 0x4d, 0xae, 0xee, 0xfa, 0xca, 0xc5,
136 0xda, 0xeb, 0x76, 0x74, 0xcd, 0xc9, 0xc1, 0xf6, 0x86, 0x01, 0x3b,
137 0x79, 0x71, 0x53, 0xe8, 0x0e, 0xf2, 0x15, 0x89, 0x32, 0x99},
138 {0xd3, 0xb0, 0x93, 0xfd, 0x82, 0x2c, 0xe4, 0x54, 0xeb, 0xc2,
139 0x51, 0xc6, 0xf2, 0x1f, 0xa7, 0x1c, 0x38, 0x58, 0xee, 0x7e,
140 0x62, 0x3e, 0xcb, 0xfb, 0xbf, 0x88, 0x73, 0x98, 0xa3, 0x0b,
141 0x40, 0xc5, 0x5d, 0x05, 0x65, 0xc7, 0xa1, 0x5e, 0x40, 0x15},
142 {{Action::WRAP, {SECSuccess, true}},
143 {Action::UNWRAP, {SECSuccess, true}}}},
144
145 {10, // Round counter overflows 256
146 {0x31, 0xca, 0xcb, 0xb1, 0x7d, 0x6d, 0xbb, 0xec, 0xae, 0x40, 0x72, 0x7c,
147 0x50, 0x48, 0xfe, 0x0c},
148 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
149 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
150 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
151 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
152 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
153 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
154 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
155 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
156 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
157 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
158 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
159 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
160 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
161 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
162 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
163 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
164 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
165 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
166 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
167 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
168 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
169 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
170 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
171 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
172 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
173 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
174 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
175 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
176 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
177 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
178 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
179 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
180 {0x22, 0x2d, 0xea, 0xdd, 0xe6, 0xef, 0xb7, 0x60, 0xca, 0xe4, 0x2f, 0xa1,
181 0x88, 0x31, 0x0e, 0x0c, 0x07, 0xe7, 0xd5, 0x57, 0x52, 0x97, 0x66, 0x44,
182 0x4a, 0x9e, 0xfb, 0x33, 0x09, 0x07, 0xd4, 0x2f, 0x0d, 0xd8, 0xf3, 0xd1,
183 0x7b, 0x3a, 0x38, 0xbf, 0x40, 0xd6, 0x8c, 0x09, 0x5a, 0x9c, 0xce, 0x19,
184 0xda, 0xf9, 0x07, 0xbf, 0x2c, 0x92, 0xf1, 0xe5, 0x9b, 0x18, 0xb2, 0x77,
185 0xff, 0x03, 0x97, 0xfc, 0x50, 0xf4, 0x5f, 0x58, 0x2d, 0xb9, 0x36, 0xaa,
186 0x8a, 0xfb, 0x94, 0x3d, 0xe0, 0x1b, 0x58, 0xab, 0xfd, 0xc8, 0x1d, 0xae,
187 0xf4, 0xe0, 0x38, 0xc9, 0x9e, 0x4c, 0x1e, 0xb3, 0xee, 0x44, 0x74, 0x64,
188 0xbb, 0x8f, 0x89, 0xa4, 0xea, 0x81, 0xe5, 0x65, 0x56, 0xcc, 0x26, 0xc7,
189 0x28, 0x83, 0xc0, 0x6a, 0x7f, 0xe8, 0x50, 0xd0, 0x43, 0x47, 0xd6, 0x8b,
190 0xba, 0xdc, 0x4a, 0x06, 0x77, 0x50, 0x30, 0x67, 0x6d, 0xb8, 0xcc, 0x34,
191 0xae, 0xb0, 0x7e, 0x39, 0xc7, 0xf0, 0x59, 0xc2, 0xbf, 0xf7, 0x6a, 0x7f,
192 0x2b, 0xaf, 0x07, 0x67, 0x49, 0x00, 0x4e, 0xf7, 0x18, 0x9f, 0x88, 0x7f,
193 0x89, 0x02, 0x9f, 0x88, 0xc5, 0xc1, 0xd0, 0xf5, 0xee, 0x62, 0x32, 0x0b,
194 0x42, 0x30, 0x48, 0xe2, 0xad, 0x81, 0x86, 0xe6, 0x3b, 0xe2, 0x3c, 0x55,
195 0x3f, 0x55, 0x76, 0xa4, 0x0d, 0x96, 0x7e, 0x8b, 0x52, 0x7c, 0xcd, 0x78,
196 0x3c, 0x41, 0xab, 0xc6, 0x4b, 0xea, 0x1a, 0xec, 0x8a, 0x76, 0xde, 0xb3,
197 0xe9, 0xc9, 0xa6, 0x65, 0x67, 0x56, 0xe1, 0xda, 0xc3, 0x8b, 0xd2, 0x5f,
198 0xf0, 0x08, 0x88, 0x8a, 0x55, 0x91, 0xaf, 0x76, 0x3f, 0xd7, 0x3f, 0x5a,
199 0xdd, 0xd7, 0x49, 0x79, 0x48, 0x17, 0x07, 0x09, 0x90, 0x48, 0x46, 0x54,
200 0xa4, 0x6e, 0xf4, 0x42, 0xad, 0xae, 0xac, 0xab, 0x14, 0xd1, 0x2d, 0xaa,
201 0xf8, 0x7b, 0xcb, 0x91, 0x66, 0x1a, 0x21, 0x59, 0x37, 0x17, 0xd9, 0xb9,
202 0x35, 0x29, 0xd8, 0x13, 0xea, 0x5f, 0xc8, 0x12, 0xd7, 0x08, 0xc0, 0xd8,
203 0xe9, 0xb6, 0x81, 0x22, 0xd9, 0xf5, 0xe6, 0x26, 0x7c, 0xde, 0x36, 0x37,
204 0x80, 0xa4, 0x5d, 0x07, 0xe4, 0xca, 0xa5, 0xbf, 0x14, 0xf2, 0x33, 0x4f,
205 0x25, 0xb9, 0xd1, 0x77, 0x63, 0x2b, 0xb8, 0x0a, 0x82, 0x89, 0x4a, 0xa4,
206 0x7b, 0x6f, 0x36, 0x0b, 0x2d, 0xa1, 0x13, 0x8d, 0xed, 0xd4, 0x33, 0x1f,
207 0x07, 0x7c, 0x90, 0x05, 0x54, 0xc7, 0xa6, 0x8b, 0x5d, 0x15, 0x49, 0x80,
208 0xbb, 0x35, 0x17, 0xac, 0x20, 0xa7, 0x8a, 0x51, 0xf6, 0xf2, 0x1e, 0x42,
209 0xb2, 0xc4, 0xc9, 0x60, 0xd3, 0x1c, 0xbd, 0x22, 0xbd, 0x61, 0x08, 0x19,
210 0x18, 0x2c, 0x5e, 0x45, 0x6b, 0xa7, 0xd7, 0xe9, 0x03, 0xf5, 0xe6, 0x0f,
211 0x6e, 0x0c, 0x4c, 0xc0, 0x14, 0xfe, 0xb4, 0xf8, 0x19, 0x73, 0xce, 0x48,
212 0xad, 0x6f, 0x4d, 0xab, 0x8d, 0xa5, 0x1e, 0xb7},
213 {{Action::WRAP, {SECSuccess, true}},
214 {Action::UNWRAP, {SECSuccess, true}}}},
215
216 {11, // empty keys cannot be wrapped
217 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
218 0xa7, 0xda, 0x64, 0x95},
219 {},
220 {0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6},
221 {{Action::WRAP, {SECFailure, false}},
222 {Action::UNWRAP, {SECFailure, false}}}},
223
224 {12, // keys of size 8 byte cannot be wrapped
225 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
226 0xa7, 0xda, 0x64, 0x95},
227 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
228 {0xdc, 0x26, 0xfb, 0x69, 0x11, 0xd7, 0x19, 0x71, 0xdf, 0x03, 0x56, 0xd6,
229 0xbb, 0x9e, 0xd6, 0xe6},
230 {{Action::WRAP, {SECFailure, false}},
231 {Action::UNWRAP, {SECFailure, false}}}},
232
233 {13, // wrapped key size must be divisible by 8
234 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
235 0xa7, 0xda, 0x64, 0x95},
236 {0x00},
237 {},
238 {{Action::WRAP, {SECFailure, false}},
239 {Action::UNWRAP, {SECFailure, false}}}},
240
241 {14, // wrapped key size must be divisible by 8
242 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
243 0xa7, 0xda, 0x64, 0x95},
244 {0x00, 0x01},
245 {},
246 {{Action::WRAP, {SECFailure, false}},
247 {Action::UNWRAP, {SECFailure, false}}}},
248
249 {15, // wrapped key size must be divisible by 8
250 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
251 0xa7, 0xda, 0x64, 0x95},
252 {0x00, 0x01, 0x02},
253 {},
254 {{Action::WRAP, {SECFailure, false}},
255 {Action::UNWRAP, {SECFailure, false}}}},
256
257 {16, // wrapped key size must be divisible by 8
258 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
259 0xa7, 0xda, 0x64, 0x95},
260 {0x00, 0x01, 0x02, 0x03},
261 {},
262 {{Action::WRAP, {SECFailure, false}},
263 {Action::UNWRAP, {SECFailure, false}}}},
264
265 {17, // wrapped key size must be divisible by 8
266 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
267 0xa7, 0xda, 0x64, 0x95},
268 {0x00, 0x01, 0x02, 0x03, 0x04},
269 {},
270 {{Action::WRAP, {SECFailure, false}},
271 {Action::UNWRAP, {SECFailure, false}}}},
272
273 {18, // wrapped key size must be divisible by 8
274 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
275 0xa7, 0xda, 0x64, 0x95},
276 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05},
277 {},
278 {{Action::WRAP, {SECFailure, false}}}},
279
280 {19, // wrapped key size must be divisible by 8
281 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
282 0xa7, 0xda, 0x64, 0x95},
283 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06},
284 {},
285 {{Action::WRAP, {SECFailure, false}},
286 {Action::UNWRAP, {SECFailure, false}}}},
287
288 {20, // wrapped key size must be divisible by 8
289 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
290 0xa7, 0xda, 0x64, 0x95},
291 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
292 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
293 {},
294 {{Action::WRAP, {SECFailure, false}},
295 {Action::UNWRAP, {SECFailure, false}}}},
296
297 {21, // invalid size of wrapped key
298 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
299 0xe8, 0x21, 0x82, 0xf7},
300 {},
301 {},
302 {{Action::WRAP, {SECFailure, false}},
303 {Action::UNWRAP, {SECFailure, false}}}},
304
305 {22, // invalid size of wrapped key
306 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
307 0xe8, 0x21, 0x82, 0xf7},
308 {},
309 {0x9f},
310 {{Action::WRAP, {SECFailure, false}},
311 {Action::UNWRAP, {SECFailure, false}}}},
312
313 {23, // invalid size of wrapped key
314 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
315 0xe8, 0x21, 0x82, 0xf7},
316 {},
317 {0xdc, 0x9e, 0x95, 0x80},
318 {{Action::WRAP, {SECFailure, false}},
319 {Action::UNWRAP, {SECFailure, false}}}},
320
321 {24, // invalid size of wrapped key
322 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
323 0xe8, 0x21, 0x82, 0xf7},
324 {},
325 {0xb9, 0xb2, 0x82, 0xd1, 0x38, 0x69, 0x30, 0x00},
326 {{Action::WRAP, {SECFailure, false}},
327 {Action::UNWRAP, {SECFailure, false}}}},
328
329 {25, // invalid size of wrapped key
330 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
331 0xe8, 0x21, 0x82, 0xf7},
332 {},
333 {0x0e, 0xfc, 0x63, 0x5b, 0x2d, 0x61, 0xe2, 0x44, 0x05, 0x6b, 0x9d, 0x45,
334 0x91, 0xca, 0x6b},
335 {{Action::WRAP, {SECFailure, false}},
336 {Action::UNWRAP, {SECFailure, false}}}},
337
338 {26, // invalid size of wrapped key
339 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
340 0xe8, 0x21, 0x82, 0xf7},
341 {},
342 {0x4a, 0x30, 0x5d, 0xae, 0x08, 0x7b, 0x0d, 0x24, 0xd6, 0x2a, 0xf4, 0x18,
343 0x31, 0x33, 0x8f, 0x33, 0xae},
344 {{Action::WRAP, {SECFailure, false}},
345 {Action::UNWRAP, {SECFailure, false}}}},
346
347 {27, // invalid size of wrapped key
348 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
349 0xe8, 0x21, 0x82, 0xf7},
350 {},
351 {0x82, 0xcb, 0x92, 0x70, 0x97, 0xcf, 0x31, 0xea, 0x4a, 0xff,
352 0xea, 0x44, 0x0b, 0x0d, 0x8c, 0xa6, 0xa2, 0x40, 0xb9, 0x00},
353 {{Action::WRAP, {SECFailure, false}},
354 {Action::UNWRAP, {SECFailure, false}}}},
355
356 {28, // bytes appended to wrapped key
357 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
358 0xe8, 0x21, 0x82, 0xf7},
359 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
360 0x0c, 0x0d, 0x0e, 0x0f},
361 {0x97, 0x90, 0xab, 0x51, 0xfb, 0xcb, 0x85, 0x0d, 0xf6, 0x76, 0x4e, 0x01,
362 0x1a, 0xe9, 0x7c, 0x85, 0x78, 0x5b, 0xed, 0x26, 0x33, 0xae, 0xa6, 0x65},
363 {{Action::WRAP, {SECSuccess, true}},
364 {Action::UNWRAP, {SECSuccess, true}}}},
365
366 {28, // Bytes appended to wrapped key
367 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
368 0xe8, 0x21, 0x82, 0xf7},
369 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
370 0x0c, 0x0d, 0x0e, 0x0f},
371 {0x97, 0x90, 0xab, 0x51, 0xfb, 0xcb, 0x85, 0x0d, 0xf6,
372 0x76, 0x4e, 0x01, 0x1a, 0xe9, 0x7c, 0x85, 0x78, 0x5b,
373 0xed, 0x26, 0x33, 0xae, 0xa6, 0x65, 0x00},
374 {{Action::UNWRAP, {SECFailure, false}}}},
375
376 {29, // Incorrect IV
377 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
378 0x52, 0xfa, 0x8b, 0xc1},
379 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
380 0x01, 0xd0, 0x70, 0xa5},
381 {0x0a, 0xac, 0x32, 0x9c, 0xcd, 0x51, 0x3e, 0xdb, 0xdd, 0x63, 0x67, 0xdf,
382 0x67, 0x99, 0x9e, 0xaa, 0xc9, 0xe7, 0xb5, 0x19, 0x84, 0xc4, 0xd3, 0x8d},
383 {{Action::WRAP, {SECSuccess, false}},
384 {Action::UNWRAP, {SECFailure, false}}}},
385
386 {30, // Incorrect IV
387 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
388 0x52, 0xfa, 0x8b, 0xc1},
389 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
390 0x01, 0xd0, 0x70, 0xa5},
391 {0x5a, 0x55, 0xdc, 0x42, 0x97, 0x49, 0xca, 0x49, 0xbb, 0x4a, 0xb0, 0x1d,
392 0x96, 0x6b, 0x19, 0xea, 0x9a, 0x9e, 0x14, 0x02, 0xe6, 0xab, 0x29, 0x62},
393 {{Action::WRAP, {SECSuccess, false}},
394 {Action::UNWRAP, {SECFailure, false}}}},
395
396 {31, // Incorrect IV
397 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
398 0x52, 0xfa, 0x8b, 0xc1},
399 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
400 0x01, 0xd0, 0x70, 0xa5},
401 {0x45, 0xf5, 0x33, 0xf6, 0x07, 0x2f, 0x64, 0x0e, 0xb7, 0xe1, 0xe5, 0x12,
402 0xd5, 0x60, 0x72, 0x08, 0x55, 0x67, 0xf4, 0xad, 0x60, 0x12, 0xa9, 0x7a},
403 {{Action::WRAP, {SECSuccess, false}},
404 {Action::UNWRAP, {SECFailure, false}}}},
405
406 {32, // Incorrect IV
407 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
408 0x52, 0xfa, 0x8b, 0xc1},
409 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
410 0x01, 0xd0, 0x70, 0xa5},
411 {0x84, 0xf2, 0x84, 0x56, 0x5d, 0xf4, 0x7c, 0x40, 0x91, 0x07, 0xf7, 0xa0,
412 0xa7, 0x1b, 0xc3, 0x70, 0xa8, 0xed, 0x44, 0x89, 0xd4, 0x14, 0xb9, 0xe9},
413 {{Action::WRAP, {SECSuccess, false}},
414 {Action::UNWRAP, {SECFailure, false}}}},
415
416 {33, // Incorrect IV
417 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
418 0x52, 0xfa, 0x8b, 0xc1},
419 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
420 0x01, 0xd0, 0x70, 0xa5},
421 {0x39, 0x41, 0xc3, 0x66, 0x55, 0x4f, 0xc8, 0x96, 0xe9, 0xfe, 0x52, 0xf0,
422 0x24, 0x93, 0xca, 0x03, 0xd4, 0x39, 0xeb, 0x17, 0xc2, 0x36, 0x14, 0x6d},
423 {{Action::WRAP, {SECSuccess, false}},
424 {Action::UNWRAP, {SECFailure, false}}}},
425
426 {34, // Incorrect IV
427 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
428 0x52, 0xfa, 0x8b, 0xc1},
429 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
430 0x01, 0xd0, 0x70, 0xa5},
431 {0x45, 0xc9, 0xd4, 0x23, 0x63, 0xd9, 0x81, 0xd0, 0x86, 0xa9, 0x72, 0x72,
432 0x8e, 0x13, 0x0a, 0x42, 0xf5, 0xdd, 0x90, 0xbd, 0xa5, 0x62, 0xa8, 0x5a},
433 {{Action::WRAP, {SECSuccess, false}},
434 {Action::UNWRAP, {SECFailure, false}}}},
435
436 {35, // Incorrect IV
437 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
438 0x52, 0xfa, 0x8b, 0xc1},
439 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
440 0x01, 0xd0, 0x70, 0xa5},
441 {0x03, 0x7d, 0x17, 0x85, 0x95, 0x19, 0xd6, 0xc0, 0x72, 0x8a, 0x9e, 0xb6,
442 0xe6, 0x41, 0x13, 0xe8, 0x69, 0x19, 0xde, 0xca, 0xbd, 0x3b, 0xbb, 0x88},
443 {{Action::WRAP, {SECSuccess, false}},
444 {Action::UNWRAP, {SECFailure, false}}}},
445
446 {36, // Incorrect IV
447 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
448 0x52, 0xfa, 0x8b, 0xc1},
449 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
450 0x01, 0xd0, 0x70, 0xa5},
451 {0x1a, 0xd1, 0x0a, 0xf7, 0xf6, 0xc0, 0x42, 0xb2, 0x67, 0xa0, 0xc7, 0xbc,
452 0x4d, 0x25, 0xd2, 0x7c, 0x00, 0x3d, 0xeb, 0x50, 0xe2, 0xcc, 0x56, 0x6a},
453 {{Action::WRAP, {SECSuccess, false}},
454 {Action::UNWRAP, {SECFailure, false}}}},
455
456 {37, // Incorrect IV
457 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
458 0x52, 0xfa, 0x8b, 0xc1},
459 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
460 0x01, 0xd0, 0x70, 0xa5},
461 {0x63, 0x0c, 0x57, 0x1b, 0x7f, 0xb8, 0x64, 0x7a, 0xc5, 0x36, 0x0a, 0x25,
462 0x5f, 0x9f, 0x5d, 0x36, 0x45, 0x79, 0x5a, 0xc4, 0x52, 0x85, 0xcb, 0xaa},
463 {{Action::WRAP, {SECSuccess, false}},
464 {Action::UNWRAP, {SECFailure, false}}}},
465
466 {38, // Incorrect IV
467 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
468 0x52, 0xfa, 0x8b, 0xc1},
469 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
470 0x01, 0xd0, 0x70, 0xa5},
471 {0x16, 0xdb, 0x55, 0x3e, 0x46, 0x7d, 0x40, 0x29, 0xd0, 0xfe, 0xa6, 0x2b,
472 0x2c, 0x44, 0x0e, 0x5d, 0xf6, 0xc6, 0x59, 0x1f, 0x04, 0x97, 0xa9, 0x9d},
473 {{Action::WRAP, {SECSuccess, false}},
474 {Action::UNWRAP, {SECFailure, false}}}},
475
476 {39, // Incorrect IV
477 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
478 0x52, 0xfa, 0x8b, 0xc1},
479 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
480 0x01, 0xd0, 0x70, 0xa5},
481 {0x09, 0x79, 0x91, 0x09, 0x0a, 0x15, 0x60, 0x47, 0xd4, 0x78, 0x4b, 0x75,
482 0x7f, 0x26, 0x2e, 0x12, 0xce, 0x57, 0xe1, 0x3a, 0x3d, 0x5d, 0x28, 0x6c},
483 {{Action::WRAP, {SECSuccess, false}},
484 {Action::UNWRAP, {SECFailure, false}}}},
485
486 {40, // Incorrect IV
487 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
488 0x52, 0xfa, 0x8b, 0xc1},
489 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
490 0x01, 0xd0, 0x70, 0xa5},
491 {0x39, 0x57, 0xc3, 0x38, 0xb7, 0x50, 0xa3, 0x28, 0x5e, 0xb7, 0xb6, 0x5c,
492 0x9c, 0xfe, 0x77, 0x05, 0x3d, 0xd7, 0xd8, 0x14, 0x9f, 0x42, 0xca, 0xa1},
493 {{Action::WRAP, {SECSuccess, false}},
494 {Action::UNWRAP, {SECFailure, false}}}},
495
496 {41, // RFC 3394
497 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
498 0x0c, 0x0d, 0x0e, 0x0f},
499 {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
500 0xcc, 0xdd, 0xee, 0xff},
501 {0x1f, 0xa6, 0x8b, 0x0a, 0x81, 0x12, 0xb4, 0x47, 0xae, 0xf3, 0x4b, 0xd8,
502 0xfb, 0x5a, 0x7b, 0x82, 0x9d, 0x3e, 0x86, 0x23, 0x71, 0xd2, 0xcf, 0xe5},
503 {{Action::WRAP, {SECSuccess, true}},
504 {Action::UNWRAP, {SECSuccess, true}}}},
505
506 {42,
507 {0xf7, 0x5a, 0x2f, 0x49, 0xa6, 0x30, 0xc7, 0xdc, 0x91, 0x62, 0x6b, 0x00,
508 0xce, 0x02, 0x9f, 0x0b, 0xd2, 0x98, 0x1d, 0x7c, 0x74, 0xa9, 0x3e, 0xbe},
509 {0x9a, 0xdb, 0xc0, 0x0c, 0x71, 0x0b, 0x11, 0x01, 0xbd, 0xf6, 0xa4, 0xed,
510 0x65, 0xb3, 0x2d, 0x72},
511 {0x00, 0xbe, 0x1c, 0xad, 0xdf, 0xd5, 0xad, 0x76, 0x97, 0x87, 0x70, 0x17,
512 0x79, 0x5f, 0x9c, 0xee, 0x4b, 0xce, 0x5a, 0x61, 0x68, 0x7a, 0x61, 0x26},
513 {{Action::WRAP, {SECSuccess, true}},
514 {Action::UNWRAP, {SECSuccess, true}}}},
515
516 {43,
517 {0xb7, 0x13, 0xf6, 0xb7, 0x81, 0x4f, 0x98, 0x89, 0x4d, 0x7b, 0x15, 0x39,
518 0x74, 0x68, 0x43, 0x59, 0xf1, 0x46, 0x02, 0x13, 0xeb, 0x74, 0xbe, 0x68},
519 {0x78, 0x58, 0x5f, 0x0c, 0x49, 0x92, 0x2e, 0x82, 0xca, 0xf1, 0x7e, 0xbc,
520 0x37, 0x21, 0xb4, 0xdb},
521 {0x54, 0xe7, 0xf2, 0x78, 0xb5, 0xa1, 0xfb, 0x4c, 0x31, 0xa0, 0xd7, 0x9a,
522 0xc1, 0xf6, 0x15, 0xed, 0xd9, 0x10, 0xbf, 0x22, 0x01, 0x5a, 0x06, 0x68},
523 {{Action::WRAP, {SECSuccess, true}},
524 {Action::UNWRAP, {SECSuccess, true}}}},
525
526 {44,
527 {0x13, 0xec, 0xf4, 0x23, 0x21, 0x1c, 0xaa, 0x33, 0x4b, 0xa6, 0xdb, 0x37,
528 0x25, 0x9a, 0x53, 0x5c, 0x20, 0xde, 0x8a, 0xd1, 0x0f, 0xc8, 0xc4, 0x32},
529 {0x4f, 0xc7, 0x5d, 0x0f, 0x22, 0x1e, 0x22, 0x40, 0x8a, 0x37, 0xe1, 0x12,
530 0x65, 0xd4, 0x9a, 0x05},
531 {0x51, 0x04, 0x55, 0xbd, 0x9c, 0x07, 0x8a, 0xc1, 0xf0, 0x7b, 0xb3, 0x75,
532 0x2c, 0xbd, 0x04, 0xe4, 0x21, 0xb0, 0xdd, 0x63, 0x51, 0x90, 0xfa, 0x62},
533 {{Action::WRAP, {SECSuccess, true}},
534 {Action::UNWRAP, {SECSuccess, true}}}},
535
536 {45,
537 {0x44, 0x17, 0xfb, 0xbe, 0xa5, 0x1b, 0xdd, 0x91, 0x81, 0x8d, 0x74, 0x05,
538 0x19, 0x57, 0xdd, 0x70, 0xe1, 0x35, 0xc5, 0xcf, 0x37, 0x32, 0xbd, 0xf1},
539 {0xf5, 0x35, 0x7d, 0xa9, 0xf8, 0xfd, 0x4a, 0x11, 0x90, 0xf3, 0x6e, 0x9f,
540 0xa0, 0x9a, 0x90, 0xfc, 0xf1, 0x4d, 0x87, 0xd6, 0x23, 0x32, 0xf1, 0xa5},
541 {0x88, 0x0d, 0xa5, 0xb4, 0x10, 0xf9, 0x13, 0xad, 0x72, 0xcc, 0x93,
542 0xf4, 0x63, 0x44, 0xf1, 0x15, 0x21, 0x65, 0xbd, 0xea, 0x14, 0x66,
543 0x4f, 0xd2, 0xd3, 0xaf, 0xbd, 0x87, 0xb8, 0xcc, 0x5c, 0xfd},
544 {{Action::WRAP, {SECSuccess, true}},
545 {Action::UNWRAP, {SECSuccess, true}}}},
546
547 {46,
548 {0xb3, 0xf2, 0x6d, 0x8a, 0x22, 0xfd, 0xd6, 0x1f, 0x70, 0x98, 0x41, 0x23,
549 0x1f, 0xbd, 0xe6, 0x95, 0xb3, 0xf2, 0x8d, 0xdd, 0xce, 0xd6, 0xd4, 0x1e},
550 {0x0d, 0x0a, 0xf9, 0x55, 0xd2, 0xe3, 0x82, 0x9c, 0xc3, 0xd6, 0x43, 0x21,
551 0x9b, 0x30, 0x1e, 0x64, 0xe0, 0x51, 0x0d, 0xfb, 0xc4, 0x28, 0x11, 0x9a},
552 {0x27, 0x65, 0x4c, 0xf6, 0xa6, 0x3d, 0x60, 0x04, 0xae, 0x83, 0xda,
553 0x54, 0xc2, 0xe5, 0xd7, 0xb5, 0xfa, 0xd2, 0x08, 0x78, 0xf3, 0x50,
554 0x08, 0x7d, 0xdd, 0x17, 0xac, 0x44, 0xa2, 0xbe, 0x86, 0x8f},
555 {{Action::WRAP, {SECSuccess, true}},
556 {Action::UNWRAP, {SECSuccess, true}}}},
557
558 {47,
559 {0xf7, 0x0c, 0xfb, 0x26, 0x2c, 0x72, 0x9a, 0x18, 0x20, 0x6c, 0x8a, 0xfd,
560 0x74, 0x35, 0x6e, 0xc7, 0xe0, 0x49, 0xd1, 0x0b, 0x44, 0xa6, 0xe0, 0x00},
561 {0x24, 0x1c, 0xed, 0xfa, 0x64, 0xc4, 0xe7, 0xbe, 0xc5, 0x41, 0xa2, 0xeb,
562 0x4c, 0x36, 0x82, 0x69, 0xe0, 0xf0, 0xdd, 0xeb, 0xc5, 0x82, 0x67, 0xea},
563 {0xad, 0x7c, 0xa6, 0x6a, 0xd4, 0x66, 0x4f, 0x43, 0xe4, 0xdd, 0x09,
564 0x29, 0x6a, 0x6e, 0x6f, 0x02, 0xd5, 0xaf, 0x44, 0x08, 0xf2, 0x25,
565 0xc0, 0xab, 0xeb, 0x0d, 0x9b, 0x76, 0xc8, 0xd1, 0xe9, 0x82},
566 {{Action::WRAP, {SECSuccess, true}},
567 {Action::UNWRAP, {SECSuccess, true}}}},
568
569 {48, // wrapped key is longer than wrapping key
570 {0x16, 0x39, 0xf9, 0xf8, 0x1e, 0x53, 0xe2, 0xee, 0xb6, 0x77, 0xa2, 0x49,
571 0xe5, 0xec, 0xed, 0x3a, 0xf1, 0x08, 0x97, 0x13, 0x01, 0x60, 0x1a, 0x7b},
572 {0xec, 0x3c, 0x6a, 0x1f, 0x1a, 0x95, 0x85, 0x32, 0x7f, 0xe6, 0x58,
573 0x49, 0x0c, 0x74, 0x63, 0x5e, 0x53, 0x00, 0x87, 0x6d, 0xa5, 0x84,
574 0x6a, 0x62, 0x93, 0x98, 0x98, 0x4f, 0xb5, 0x51, 0xd6, 0x91},
575 {0xe2, 0x45, 0xc9, 0x0a, 0x6b, 0x46, 0xca, 0xec, 0xe9, 0x4f,
576 0x47, 0x11, 0x7d, 0x60, 0x83, 0x31, 0x95, 0x8c, 0x8f, 0x75,
577 0xf5, 0x31, 0xeb, 0xcd, 0xc9, 0x02, 0xc0, 0x21, 0x3d, 0x91,
578 0x05, 0xf2, 0x15, 0x5a, 0xf0, 0x7d, 0xaa, 0x62, 0xd1, 0x32},
579 {{Action::WRAP, {SECSuccess, true}},
580 {Action::UNWRAP, {SECSuccess, true}}}},
581
582 {49, // wrapped key is longer than wrapping key
583 {0x1f, 0x22, 0xd5, 0x65, 0x8a, 0xa6, 0x85, 0xb8, 0xba, 0x86, 0x59, 0xdc,
584 0x34, 0x28, 0x80, 0xd5, 0xb2, 0x39, 0x9e, 0x6a, 0x81, 0x50, 0x05, 0xb0},
585 {0x50, 0xbe, 0x4c, 0x1b, 0x2f, 0x29, 0xa6, 0x3f, 0x44, 0xd7, 0xfc,
586 0x63, 0x73, 0x7f, 0x60, 0x0f, 0x01, 0x94, 0xea, 0x3f, 0xb3, 0x6e,
587 0x17, 0x3d, 0x2d, 0xdd, 0x19, 0xf2, 0x18, 0x65, 0x63, 0x80},
588 {0x8a, 0x32, 0xb9, 0xf2, 0x07, 0xae, 0x5a, 0xae, 0xdb, 0x7e,
589 0x8a, 0x0d, 0x94, 0x51, 0x07, 0x41, 0x2c, 0x1b, 0xd0, 0x69,
590 0x99, 0xbc, 0x5a, 0xc8, 0x3c, 0x1f, 0x95, 0x8d, 0xfb, 0x77,
591 0xeb, 0xdc, 0xf9, 0xd9, 0x8c, 0x60, 0xdb, 0xd4, 0x65, 0x0a},
592 {{Action::WRAP, {SECSuccess, true}},
593 {Action::UNWRAP, {SECSuccess, true}}}},
594
595 {50, // wrapped key is longer than wrapping key
596 {0x3a, 0x2f, 0x4a, 0xa5, 0x04, 0x41, 0x95, 0x4b, 0xba, 0x5a, 0x18, 0x36,
597 0x29, 0x4c, 0xe0, 0x71, 0xf9, 0x29, 0x6b, 0x23, 0xdb, 0xed, 0x67, 0x71},
598 {0x65, 0xda, 0x02, 0xff, 0x21, 0xb4, 0x83, 0xa1, 0xe3, 0x95, 0x75,
599 0x49, 0x0b, 0x43, 0x19, 0xe8, 0x4a, 0xe0, 0x29, 0x9f, 0x1f, 0x00,
600 0xb3, 0x85, 0x9f, 0xbe, 0x2e, 0x74, 0xb3, 0xec, 0x2a, 0xaf},
601 {0x4a, 0x58, 0x42, 0xb1, 0x0d, 0x2d, 0xb9, 0x6e, 0xa1, 0x03,
602 0x9e, 0xf4, 0x78, 0x5c, 0xe7, 0x22, 0x55, 0x5b, 0x37, 0x51,
603 0xa9, 0xb6, 0xdd, 0x39, 0x12, 0x6a, 0xd3, 0x63, 0x37, 0x8c,
604 0x72, 0x32, 0x0d, 0x83, 0xea, 0x7a, 0xdb, 0x81, 0x61, 0x5a},
605 {{Action::WRAP, {SECSuccess, true}},
606 {Action::UNWRAP, {SECSuccess, true}}}},
607
608 {51, // Round counter overflows 256
609 {0x31, 0xca, 0xcb, 0xb1, 0x7d, 0x6d, 0xbb, 0xec, 0xae, 0x40, 0x72, 0x7c,
610 0x50, 0x48, 0xfe, 0x0c, 0x01, 0xbc, 0x53, 0xb2, 0x3a, 0xb6, 0x35, 0x02},
611 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
612 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
613 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
614 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
615 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
616 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
617 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
618 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
619 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
620 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
621 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
622 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
623 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
624 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
625 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
626 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
627 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
628 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
629 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
630 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
631 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
632 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
633 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
634 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
635 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
636 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
637 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
638 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
639 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
640 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
641 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
642 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
643 {0xe2, 0x19, 0x25, 0x98, 0xe6, 0x12, 0x4f, 0x27, 0x91, 0xb2, 0x75, 0x1f,
644 0x93, 0x09, 0x58, 0x43, 0x5b, 0xb1, 0xd0, 0x2e, 0x98, 0xaa, 0x1e, 0x09,
645 0x78, 0x1b, 0xba, 0x0b, 0x15, 0x94, 0x35, 0xdb, 0x65, 0x9f, 0xa7, 0x3f,
646 0xa3, 0x10, 0x11, 0x17, 0x04, 0x69, 0x2c, 0x68, 0xe1, 0x6d, 0xdf, 0x4b,
647 0xe0, 0x60, 0x22, 0xc5, 0x2f, 0xe9, 0xdb, 0xa6, 0x27, 0x9a, 0xad, 0x1a,
648 0xeb, 0x81, 0x41, 0x25, 0xd0, 0xdd, 0xf3, 0x3f, 0x31, 0xe5, 0x8e, 0x62,
649 0x5a, 0xf3, 0x23, 0x05, 0x05, 0x0c, 0xfe, 0xa3, 0x90, 0xd8, 0x78, 0x2d,
650 0x32, 0xca, 0xac, 0x55, 0x88, 0x89, 0xca, 0x8e, 0x64, 0x19, 0x08, 0x20,
651 0x8d, 0xa6, 0x97, 0x65, 0x42, 0xb4, 0x0d, 0xbd, 0x09, 0x01, 0x78, 0xe2,
652 0xa6, 0x81, 0x2a, 0x43, 0x6c, 0x18, 0xa5, 0xe8, 0x91, 0xac, 0x80, 0x83,
653 0x17, 0x6a, 0xce, 0x1d, 0xdf, 0xee, 0x4d, 0x38, 0x28, 0x56, 0xa5, 0x9c,
654 0x80, 0xc6, 0x43, 0xec, 0xd5, 0xc1, 0xab, 0x68, 0xc6, 0x6b, 0x2b, 0x89,
655 0x84, 0xce, 0x6e, 0x0e, 0x38, 0x6f, 0x65, 0x54, 0xa9, 0xcb, 0x91, 0xd3,
656 0x63, 0xbb, 0x4a, 0xcc, 0xf0, 0x28, 0x87, 0x8e, 0xc2, 0x0b, 0x8b, 0x2e,
657 0x37, 0x21, 0x4f, 0x7b, 0x12, 0xdb, 0xcd, 0x78, 0xfb, 0x38, 0xf7, 0x11,
658 0xa9, 0x0f, 0xe2, 0x62, 0xc7, 0x84, 0x91, 0xb9, 0x05, 0x83, 0x54, 0xe2,
659 0x7b, 0x34, 0xfc, 0x92, 0xef, 0x0d, 0x70, 0x28, 0x59, 0x4c, 0xb0, 0x82,
660 0x59, 0xf8, 0x6b, 0x54, 0xcb, 0x1d, 0x31, 0x7e, 0xc5, 0x5f, 0x2e, 0xf2,
661 0xab, 0x7e, 0x8b, 0x14, 0x16, 0x71, 0xf8, 0xbc, 0xb1, 0xa9, 0x0b, 0xb7,
662 0xd8, 0x2b, 0xc8, 0xcb, 0x4f, 0xb0, 0x2c, 0x9c, 0xe4, 0x30, 0xef, 0x4a,
663 0xe0, 0xdc, 0x84, 0x7e, 0x91, 0xe7, 0xd4, 0xfb, 0x46, 0x3e, 0xb9, 0xdd,
664 0x87, 0xfc, 0x9d, 0xc9, 0x56, 0x8f, 0x3a, 0x4e, 0xf5, 0x04, 0xd7, 0x4c,
665 0x13, 0x4d, 0xcb, 0x60, 0xca, 0x01, 0xb3, 0x6c, 0xe1, 0x0c, 0xb4, 0x67,
666 0x26, 0x8e, 0xa2, 0x97, 0xc0, 0x51, 0x8a, 0x50, 0xd1, 0x2c, 0xc0, 0x25,
667 0xcf, 0xee, 0xa1, 0x38, 0x1d, 0xdd, 0x7d, 0xd6, 0x3e, 0x4a, 0xc9, 0x48,
668 0x90, 0xa0, 0xea, 0xe9, 0xdb, 0xd8, 0xdb, 0x24, 0x46, 0x25, 0xa3, 0xc8,
669 0xaf, 0x2e, 0x1a, 0xff, 0x6a, 0x81, 0x12, 0xc4, 0xd3, 0xd9, 0x8e, 0x82,
670 0x63, 0x58, 0x8e, 0xe1, 0xdd, 0x90, 0x63, 0xb7, 0x09, 0xb8, 0xec, 0x00,
671 0x47, 0x4c, 0x4e, 0xa4, 0x13, 0xa8, 0x02, 0xb8, 0xcd, 0xe8, 0x14, 0xe7,
672 0xb3, 0x73, 0x14, 0x10, 0x80, 0x9e, 0xd0, 0x00, 0x06, 0x0f, 0xb7, 0xb9,
673 0xb0, 0xbf, 0x85, 0x09, 0xef, 0x17, 0x51, 0x5f, 0x33, 0x3e, 0x86, 0x8b,
674 0x18, 0x8e, 0xa1, 0x64, 0x45, 0xf3, 0x80, 0xb3, 0xa7, 0xd4, 0x27, 0x74,
675 0xf6, 0x45, 0x6c, 0xdf, 0x72, 0x42, 0x46, 0xfa},
676 {{Action::WRAP,
677 {SECSuccess, true}}, // Round counter overflows - acceptable
678 {Action::UNWRAP, {SECSuccess, true}}}},
679
680 {52, // empty keys cannot be wrapped
681 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
682 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
683 {},
684 {0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6},
685 {{Action::WRAP, {SECFailure, false}},
686 {Action::UNWRAP, {SECFailure, false}}}},
687
688 {53, // keys of size 8 byte cannot be wrapped
689 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
690 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
691 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
692 {0x38, 0xd8, 0x23, 0x8c, 0xdb, 0x0d, 0x9a, 0x2d, 0xa2, 0x8d, 0x6d, 0x56,
693 0x19, 0x4f, 0x2e, 0x78},
694 {{Action::WRAP, {SECFailure, false}},
695 {Action::UNWRAP, {SECFailure, false}}}},
696
697 {54, // wrapped key size must be divisible by 8
698 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
699 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
700 {0x00},
701 {},
702 {{Action::WRAP, {SECFailure, false}},
703 {Action::UNWRAP, {SECFailure, false}}}},
704
705 {55, // wrapped key size must be divisible by 8
706 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
707 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
708 {0x00, 0x01},
709 {},
710 {{Action::WRAP, {SECFailure, false}},
711 {Action::UNWRAP, {SECFailure, false}}}},
712
713 {56, // wrapped key size must be divisible by 8
714 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
715 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
716 {0x00, 0x01, 0x02},
717 {},
718 {{Action::WRAP, {SECFailure, false}},
719 {Action::UNWRAP, {SECFailure, false}}}},
720
721 {57, // wrapped key size must be divisible by 8
722 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
723 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
724 {0x00, 0x01, 0x02, 0x03},
725 {},
726 {{Action::WRAP, {SECFailure, false}},
727 {Action::UNWRAP, {SECFailure, false}}}},
728
729 {58, // wrapped key size must be divisible by 8
730 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
731 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
732 {0x00, 0x01, 0x02, 0x03, 0x04},
733 {},
734 {{Action::WRAP, {SECFailure, false}},
735 {Action::UNWRAP, {SECFailure, false}}}},
736
737 {59, // wrapped key size must be divisible by 8
738 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
739 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
740 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05},
741 {},
742 {{Action::WRAP, {SECFailure, false}},
743 {Action::UNWRAP, {SECFailure, false}}}},
744
745 {60, // wrapped key size must be divisible by 8
746 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
747 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
748 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06},
749 {},
750 {{Action::WRAP, {SECFailure, false}},
751 {Action::UNWRAP, {SECFailure, false}}}},
752
753 {61, // wrapped key size must be divisible by 8
754 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
755 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
756 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
757 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
758 {},
759 {{Action::WRAP, {SECFailure, false}},
760 {Action::UNWRAP, {SECFailure, false}}}},
761
762 {62, // invalid size of wrapped key
763 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
764 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
765 {},
766 {},
767 {{Action::WRAP, {SECFailure, false}},
768 {Action::UNWRAP, {SECFailure, false}}}},
769
770 {63, // invalid size of wrapped key
771 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
772 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
773 {},
774 {0x9f},
775 {{Action::WRAP, {SECFailure, false}},
776 {Action::UNWRAP, {SECFailure, false}}}},
777
778 {64, // invalid size of wrapped key
779 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
780 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
781 {},
782 {0xdc, 0x9e, 0x95, 0x80},
783 {{Action::WRAP, {SECFailure, false}},
784 {Action::UNWRAP, {SECFailure, false}}}},
785
786 {65, // invalid size of wrapped key
787 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
788 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
789 {},
790 {0xb9, 0xb2, 0x82, 0xd1, 0x38, 0x69, 0x30, 0x00},
791 {{Action::WRAP, {SECFailure, false}},
792 {Action::UNWRAP, {SECFailure, false}}}},
793
794 {66, // invalid size of wrapped key
795 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
796 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
797 {},
798 {0x0e, 0xfc, 0x63, 0x5b, 0x2d, 0x61, 0xe2, 0x44, 0x05, 0x6b, 0x9d, 0x45,
799 0x91, 0xca, 0x6b},
800 {{Action::WRAP, {SECFailure, false}},
801 {Action::UNWRAP, {SECFailure, false}}}},
802
803 {67, // invalid size of wrapped key
804 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
805 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
806 {},
807 {0x4a, 0x30, 0x5d, 0xae, 0x08, 0x7b, 0x0d, 0x24, 0xd6, 0x2a, 0xf4, 0x18,
808 0x31, 0x33, 0x8f, 0x33, 0xae},
809 {{Action::WRAP, {SECFailure, false}},
810 {Action::UNWRAP, {SECFailure, false}}}},
811
812 {68, // invalid size of wrapped key
813 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
814 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
815 {},
816 {0x82, 0xcb, 0x92, 0x70, 0x97, 0xcf, 0x31, 0xea, 0x4a, 0xff,
817 0xea, 0x44, 0x0b, 0x0d, 0x8c, 0xa6, 0xa2, 0x40, 0xb9, 0x00},
818 {{Action::WRAP, {SECFailure, false}},
819 {Action::UNWRAP, {SECFailure, false}}}},
820
821 {69, // bytes appended to wrapped key
822 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
823 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
824 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
825 0x0c, 0x0d, 0x0e, 0x0f},
826 {0x55, 0xdf, 0xb2, 0xf7, 0xe0, 0xc1, 0xea, 0x04, 0xfe,
827 0xad, 0x89, 0x7c, 0x45, 0x1c, 0x05, 0x05, 0x92, 0x1d,
828 0xc4, 0x7f, 0x30, 0x8c, 0x49, 0x17, 0x00},
829 {{Action::WRAP, {SECSuccess, false}},
830 {Action::UNWRAP, {SECFailure, false}}}},
831
832 {70, // Incorrect IV
833 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
834 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
835 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
836 0x01, 0xd0, 0x70, 0xa5},
837 {0x9b, 0x15, 0x93, 0xfd, 0x7d, 0x4f, 0xe2, 0x5a, 0x66, 0x0b, 0xbc, 0x19,
838 0x76, 0xea, 0x4a, 0xb6, 0x8b, 0xcc, 0x53, 0xf8, 0x48, 0xa8, 0xeb, 0x9d},
839 {{Action::WRAP, {SECSuccess, false}},
840 {Action::UNWRAP, {SECFailure, false}}}},
841
842 {71, // Incorrect IV
843 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
844 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
845 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
846 0x01, 0xd0, 0x70, 0xa5},
847 {0xe7, 0xed, 0xb8, 0x47, 0xfa, 0x91, 0xe2, 0xde, 0xde, 0xd7, 0x26, 0xed,
848 0xf3, 0xab, 0x93, 0xda, 0x91, 0x15, 0x16, 0x97, 0x42, 0x5f, 0xee, 0x28},
849 {{Action::WRAP, {SECSuccess, false}},
850 {Action::UNWRAP, {SECFailure, false}}}},
851
852 {72, // Incorrect IV
853 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
854 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
855 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
856 0x01, 0xd0, 0x70, 0xa5},
857 {0x1b, 0x51, 0xa7, 0xc0, 0x33, 0xc1, 0xef, 0xb5, 0xee, 0x29, 0x94, 0x25,
858 0x9c, 0x40, 0xf0, 0x3b, 0xb5, 0x7d, 0x8c, 0xc0, 0x9e, 0x50, 0x7e, 0x6e},
859 {{Action::WRAP, {SECSuccess, false}},
860 {Action::UNWRAP, {SECFailure, false}}}},
861
862 {73, // Incorrect IV
863 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
864 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
865 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
866 0x01, 0xd0, 0x70, 0xa5},
867 {0xc4, 0x0b, 0x61, 0x4a, 0x50, 0x62, 0xf5, 0xfd, 0x04, 0x9c, 0x53, 0x79,
868 0xb3, 0xe8, 0x14, 0x16, 0x14, 0xc2, 0xda, 0x97, 0x89, 0x35, 0x89, 0xfb},
869 {{Action::WRAP, {SECSuccess, false}},
870 {Action::UNWRAP, {SECFailure, false}}}},
871
872 {74, // Incorrect IV
873 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
874 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
875 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
876 0x01, 0xd0, 0x70, 0xa5},
877 {0xd7, 0x57, 0x5e, 0xf0, 0x2d, 0xf5, 0x4b, 0x30, 0x86, 0xeb, 0x49, 0x03,
878 0x5e, 0xea, 0xfb, 0xce, 0x0e, 0x08, 0x33, 0x6e, 0x89, 0xb3, 0x5a, 0xb0},
879 {{Action::WRAP, {SECSuccess, false}},
880 {Action::UNWRAP, {SECFailure, false}}}},
881
882 {75, // Incorrect IV
883 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
884 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
885 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
886 0x01, 0xd0, 0x70, 0xa5},
887 {0x0d, 0x61, 0x7f, 0x1c, 0x12, 0x48, 0x5a, 0x35, 0x91, 0x7d, 0x2a, 0x94,
888 0x1e, 0x94, 0x9d, 0x2f, 0xdb, 0xf0, 0x3a, 0x34, 0x68, 0x89, 0xb8, 0x50},
889 {{Action::WRAP, {SECSuccess, false}},
890 {Action::UNWRAP, {SECFailure, false}}}},
891
892 {76, // Incorrect IV
893 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
894 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
895 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
896 0x01, 0xd0, 0x70, 0xa5},
897 {0xc7, 0xdf, 0x34, 0x72, 0x91, 0x74, 0xdb, 0x2e, 0x83, 0xee, 0x16, 0xc6,
898 0xde, 0x74, 0xd5, 0xeb, 0x97, 0x66, 0x71, 0x5f, 0xad, 0x04, 0x9b, 0x40},
899 {{Action::WRAP, {SECSuccess, false}},
900 {Action::UNWRAP, {SECFailure, false}}}},
901
902 {77, // Incorrect IV
903 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
904 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
905 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
906 0x01, 0xd0, 0x70, 0xa5},
907 {0xc3, 0xed, 0x38, 0xd6, 0xf9, 0xcc, 0xb9, 0xbf, 0x3c, 0x56, 0xbb, 0x31,
908 0x76, 0xf0, 0x0d, 0x3c, 0xe9, 0x88, 0x75, 0x21, 0xf8, 0xd4, 0xc7, 0x0b},
909 {{Action::WRAP, {SECSuccess, false}},
910 {Action::UNWRAP, {SECFailure, false}}}},
911
912 {78, // Incorrect IV
913 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
914 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
915 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
916 0x01, 0xd0, 0x70, 0xa5},
917 {0x65, 0x82, 0xb5, 0xf4, 0x65, 0x27, 0x44, 0xb0, 0x53, 0x7e, 0x97, 0xe7,
918 0xcd, 0xae, 0x0f, 0x44, 0x31, 0x30, 0x14, 0x0d, 0xba, 0xea, 0x60, 0x4c},
919 {{Action::WRAP, {SECSuccess, false}},
920 {Action::UNWRAP, {SECFailure, false}}}},
921
922 {79, // Incorrect IV
923 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
924 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
925 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
926 0x01, 0xd0, 0x70, 0xa5},
927 {0xfc, 0x9b, 0x9b, 0xdf, 0x25, 0xf2, 0xb4, 0x8a, 0xd7, 0x99, 0x34, 0xc8,
928 0xd3, 0x48, 0x97, 0xcd, 0xbf, 0x4c, 0x84, 0x6f, 0x8c, 0xb4, 0xb1, 0x1d},
929 {{Action::WRAP, {SECSuccess, false}},
930 {Action::UNWRAP, {SECFailure, false}}}},
931
932 {80, // Incorrect IV
933 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
934 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
935 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
936 0x01, 0xd0, 0x70, 0xa5},
937 {0xfc, 0x23, 0xc7, 0xf4, 0xfe, 0x20, 0xaa, 0x81, 0x10, 0x5e, 0xfc, 0x1a,
938 0x71, 0x05, 0xa5, 0x31, 0x6b, 0x23, 0x39, 0x9a, 0xc7, 0x92, 0xc8, 0x24},
939 {{Action::WRAP, {SECSuccess, false}},
940 {Action::UNWRAP, {SECFailure, false}}}},
941
942 {81, // Incorrect IV
943 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
944 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
945 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
946 0x01, 0xd0, 0x70, 0xa5},
947 {0x37, 0xb4, 0xa2, 0x61, 0xb9, 0x6b, 0xce, 0xc9, 0xcc, 0x93, 0xee, 0xf5,
948 0xb2, 0xfb, 0xbb, 0xe8, 0x46, 0x34, 0xf9, 0x78, 0xc5, 0x89, 0x3d, 0xda},
949 {{Action::WRAP, {SECSuccess, false}},
950 {Action::UNWRAP, {SECFailure, false}}}},
951
952 {82, // Incorrect IV
953 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
954 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
955 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
956 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
957 {0x18, 0x31, 0x10, 0x98, 0x47, 0xd1, 0x7d, 0x01, 0x0b, 0xfc, 0xd9,
958 0x3f, 0xb4, 0x6f, 0x31, 0x50, 0xcd, 0xaf, 0xd5, 0x27, 0x33, 0xdb,
959 0x74, 0xc2, 0x21, 0xb0, 0x34, 0xfe, 0x8e, 0x15, 0x52, 0xc0},
960 {{Action::WRAP, {SECSuccess, false}},
961 {Action::UNWRAP, {SECFailure, false}}}},
962
963 {83, // Incorrect IV
964 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
965 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
966 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
967 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
968 {0x2b, 0x2b, 0x89, 0xc3, 0xc6, 0xb2, 0xdb, 0x49, 0x03, 0x87, 0x7a,
969 0xd4, 0x62, 0x2c, 0xa3, 0x3f, 0x3a, 0x3c, 0xb7, 0xe6, 0x70, 0x1d,
970 0x13, 0x40, 0xe6, 0xaf, 0xc0, 0xfd, 0xab, 0x7d, 0xbd, 0x72},
971 {{Action::WRAP, {SECSuccess, false}},
972 {Action::UNWRAP, {SECFailure, false}}}},
973
974 {84, // Incorrect IV
975 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
976 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
977 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
978 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
979 {0x3c, 0x69, 0x03, 0xf3, 0x7d, 0xa5, 0x71, 0x61, 0xaf, 0x67, 0x06,
980 0x05, 0x0a, 0x2e, 0xd7, 0x47, 0xcd, 0x55, 0x34, 0x4d, 0x86, 0x91,
981 0x89, 0xfd, 0x49, 0xd2, 0x53, 0x6f, 0xf9, 0x48, 0x12, 0x9d},
982 {{Action::WRAP, {SECSuccess, false}},
983 {Action::UNWRAP, {SECFailure, false}}}},
984
985 {85, // Incorrect IV
986 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
987 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
988 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
989 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
990 {0x8a, 0x8d, 0xc8, 0xb1, 0x31, 0xc6, 0xb9, 0x68, 0xb6, 0x0c, 0x1d,
991 0xd8, 0x19, 0xa6, 0x55, 0x39, 0x2d, 0x1a, 0x96, 0xd6, 0xca, 0xfa,
992 0x48, 0xe3, 0x0f, 0xb1, 0x14, 0x6f, 0x09, 0x62, 0x29, 0xc6},
993 {{Action::WRAP, {SECSuccess, false}},
994 {Action::UNWRAP, {SECFailure, false}}}},
995
996 {86, // Incorrect IV
997 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
998 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
999 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1000 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1001 {0x30, 0x3e, 0x0b, 0x36, 0x02, 0xd5, 0x14, 0xa7, 0xd5, 0x2e, 0xdb,
1002 0xa3, 0x30, 0x6d, 0x73, 0x83, 0xe8, 0x99, 0x9e, 0x7c, 0x65, 0x2a,
1003 0x51, 0x03, 0x35, 0xa8, 0x94, 0x9e, 0xfb, 0x42, 0xeb, 0x66},
1004 {{Action::WRAP, {SECSuccess, false}},
1005 {Action::UNWRAP, {SECFailure, false}}}},
1006
1007 {87, // Incorrect IV
1008 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
1009 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
1010 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1011 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1012 {0x31, 0x9b, 0xef, 0xbf, 0x2d, 0xdb, 0xb4, 0x75, 0x72, 0x3f, 0xb2,
1013 0xfa, 0x30, 0xf2, 0xae, 0x7f, 0xc1, 0xce, 0xb1, 0xe6, 0xf3, 0x61,
1014 0x71, 0x5e, 0xca, 0x72, 0x09, 0x60, 0x88, 0x73, 0xc7, 0xfc},
1015 {{Action::WRAP, {SECSuccess, false}},
1016 {Action::UNWRAP, {SECFailure, false}}}},
1017
1018 {88, // Incorrect IV
1019 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
1020 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
1021 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1022 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1023 {0x9b, 0x3e, 0x44, 0x03, 0x41, 0xc5, 0xda, 0x13, 0x15, 0x59, 0x95,
1024 0x9d, 0xb6, 0xb3, 0x55, 0x3a, 0x53, 0x46, 0x91, 0x16, 0x2f, 0x4f,
1025 0x00, 0x93, 0x27, 0xbf, 0x2c, 0x21, 0xd6, 0xfe, 0x5a, 0xda},
1026 {{Action::WRAP, {SECSuccess, false}},
1027 {Action::UNWRAP, {SECFailure, false}}}},
1028
1029 {89, // Incorrect IV
1030 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
1031 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
1032 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1033 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1034 {0xeb, 0xa6, 0xcc, 0x09, 0x59, 0xe6, 0xa5, 0x63, 0x39, 0xb1, 0x41,
1035 0x62, 0x98, 0x40, 0xad, 0xd8, 0x0f, 0x45, 0x65, 0x65, 0x6d, 0xc6,
1036 0x87, 0xa3, 0xb9, 0x96, 0x96, 0x0c, 0x99, 0x4d, 0xfd, 0x26},
1037 {{Action::WRAP, {SECSuccess, false}},
1038 {Action::UNWRAP, {SECFailure, false}}}},
1039
1040 {90, // Incorrect IV
1041 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
1042 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
1043 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1044 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1045 {0xb7, 0x03, 0xb6, 0xcf, 0x45, 0x87, 0x70, 0x93, 0x53, 0xc7, 0xe4,
1046 0x00, 0x4d, 0x3d, 0xa6, 0x1c, 0xe5, 0xf5, 0xde, 0xaf, 0x71, 0x63,
1047 0xca, 0x9d, 0x61, 0x58, 0xdd, 0xe9, 0x19, 0xe0, 0xac, 0x34},
1048 {{Action::WRAP, {SECSuccess, false}},
1049 {Action::UNWRAP, {SECFailure, false}}}},
1050
1051 {91, // Incorrect IV
1052 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
1053 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
1054 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1055 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1056 {0x72, 0x54, 0x9d, 0x52, 0xd6, 0xf4, 0xff, 0x91, 0x2d, 0x83, 0x3c,
1057 0x74, 0x13, 0x6d, 0x90, 0x63, 0x4c, 0xe8, 0xaf, 0xa4, 0xf8, 0x44,
1058 0x12, 0xbb, 0xee, 0x80, 0x74, 0x08, 0x4d, 0x4c, 0xec, 0xff},
1059 {{Action::WRAP, {SECSuccess, false}},
1060 {Action::UNWRAP, {SECFailure, false}}}},
1061
1062 {92, // Incorrect IV
1063 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
1064 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
1065 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1066 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1067 {0x13, 0x37, 0xc8, 0xbd, 0x6c, 0x8a, 0x5d, 0xd4, 0x3a, 0xba, 0x8d,
1068 0x29, 0x88, 0x64, 0xff, 0xe7, 0x6a, 0xd6, 0xea, 0x90, 0x9f, 0x34,
1069 0x88, 0x15, 0x7a, 0x15, 0xe6, 0xc4, 0x6a, 0xcf, 0x22, 0x14},
1070 {{Action::WRAP, {SECSuccess, false}},
1071 {Action::UNWRAP, {SECFailure, false}}}},
1072
1073 {93, // Incorrect IV
1074 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
1075 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
1076 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1077 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1078 {0x4a, 0xaf, 0xfa, 0xca, 0x5f, 0xe8, 0x58, 0x14, 0xd0, 0x40, 0xaa,
1079 0x2a, 0x30, 0x6b, 0xa4, 0xd1, 0xd4, 0x47, 0x46, 0xcf, 0xe4, 0x6c,
1080 0x97, 0x8a, 0xa0, 0x57, 0xb5, 0x3f, 0xd2, 0x53, 0x16, 0xc1},
1081 {{Action::WRAP, {SECSuccess, false}},
1082 {Action::UNWRAP, {SECFailure, false}}}},
1083
1084 {94, // RFC 3394
1085 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
1086 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
1087 {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
1088 0xcc, 0xdd, 0xee, 0xff},
1089 {0x96, 0x77, 0x8b, 0x25, 0xae, 0x6c, 0xa4, 0x35, 0xf9, 0x2b, 0x5b, 0x97,
1090 0xc0, 0x50, 0xae, 0xd2, 0x46, 0x8a, 0xb8, 0xa1, 0x7a, 0xd8, 0x4e, 0x5d},
1091 {{Action::WRAP, {SECSuccess, true}},
1092 {Action::UNWRAP, {SECSuccess, true}}}},
1093
1094 {95, // RFC 3394
1095 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
1096 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
1097 {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
1098 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
1099 {0x03, 0x1d, 0x33, 0x26, 0x4e, 0x15, 0xd3, 0x32, 0x68, 0xf2, 0x4e,
1100 0xc2, 0x60, 0x74, 0x3e, 0xdc, 0xe1, 0xc6, 0xc7, 0xdd, 0xee, 0x72,
1101 0x5a, 0x93, 0x6b, 0xa8, 0x14, 0x91, 0x5c, 0x67, 0x62, 0xd2},
1102 {{Action::WRAP, {SECSuccess, true}},
1103 {Action::UNWRAP, {SECSuccess, true}}}},
1104
1105 {96,
1106 {0xfc, 0xe0, 0x42, 0x9c, 0x61, 0x06, 0x58, 0xef, 0x8e, 0x7c, 0xfb,
1107 0x01, 0x54, 0xc5, 0x1d, 0xe2, 0x23, 0x9a, 0x8a, 0x31, 0x7f, 0x5a,
1108 0xf5, 0xb6, 0x71, 0x4f, 0x98, 0x5f, 0xb5, 0xc4, 0xd7, 0x5c},
1109 {0x28, 0x73, 0x26, 0xb5, 0xed, 0x00, 0x78, 0xe7, 0xca, 0x01, 0x64, 0xd7,
1110 0x48, 0xf6, 0x67, 0xe7},
1111 {0x94, 0x0b, 0x1c, 0x58, 0x0e, 0x0c, 0x72, 0x33, 0xa7, 0x91, 0xb0, 0xf1,
1112 0x92, 0x43, 0x8d, 0x2e, 0xac, 0xe1, 0x42, 0x14, 0xce, 0xe4, 0x55, 0xb7},
1113 {{Action::WRAP, {SECSuccess, true}},
1114 {Action::UNWRAP, {SECSuccess, true}}}},
1115
1116 {97,
1117 {0x0d, 0xda, 0x6d, 0xa5, 0x12, 0x3e, 0x2c, 0x37, 0xc6, 0xfa, 0x16,
1118 0xba, 0x0d, 0x33, 0x4c, 0xd0, 0x1a, 0xcd, 0x65, 0x2f, 0x89, 0x94,
1119 0x21, 0x17, 0x51, 0xdf, 0xab, 0x4f, 0xaa, 0xc2, 0xfc, 0x22},
1120 {0xb4, 0x0b, 0x68, 0x28, 0x72, 0x9b, 0x45, 0x63, 0x22, 0xa8, 0xd0, 0x65,
1121 0xab, 0xc0, 0xd0, 0x81},
1122 {0x93, 0x9b, 0x33, 0x89, 0x33, 0x6f, 0xea, 0x4a, 0x97, 0x51, 0xbf, 0x01,
1123 0x4e, 0xf1, 0x80, 0x11, 0x32, 0x30, 0x90, 0xe8, 0xa0, 0x50, 0x0b, 0xc4},
1124 {{Action::WRAP, {SECSuccess, true}},
1125 {Action::UNWRAP, {SECSuccess, true}}}},
1126
1127 {98,
1128 {0xd6, 0x92, 0x59, 0x14, 0xcd, 0x06, 0x30, 0x8f, 0x81, 0xad, 0x91,
1129 0xe2, 0x30, 0x73, 0x59, 0x3d, 0x99, 0xd4, 0xe5, 0x03, 0x51, 0xb2,
1130 0x0e, 0xb2, 0xa8, 0xd1, 0xa1, 0xac, 0x4c, 0xed, 0x65, 0x88},
1131 {0x03, 0x7b, 0x27, 0xb3, 0xdc, 0x95, 0xb1, 0x9d, 0x15, 0xbd, 0x40, 0x91,
1132 0xe3, 0x20, 0xbf, 0xe1},
1133 {0x59, 0xee, 0x8e, 0x51, 0x98, 0x86, 0x12, 0x37, 0xf6, 0x82, 0xed, 0xec,
1134 0x6b, 0xa9, 0x06, 0x52, 0x6c, 0x01, 0x6d, 0x4d, 0x93, 0x59, 0x42, 0xbd},
1135 {{Action::WRAP, {SECSuccess, true}},
1136 {Action::UNWRAP, {SECSuccess, true}}}},
1137
1138 {99,
1139 {0x07, 0x51, 0x8a, 0x82, 0xcb, 0xc8, 0xda, 0x1d, 0xce, 0xc5, 0x5f,
1140 0x37, 0x63, 0xa2, 0x06, 0xd2, 0x77, 0x48, 0x7a, 0xbd, 0x03, 0xce,
1141 0xdd, 0x0b, 0x8b, 0xef, 0x9e, 0xe2, 0xfb, 0x15, 0x71, 0x21},
1142 {0xfa, 0xa4, 0x66, 0x4d, 0x79, 0xfc, 0xe3, 0xc7, 0xd2, 0xfd, 0xd4, 0x62,
1143 0xf6, 0xc1, 0xc4, 0x23, 0xc2, 0xf8, 0xe6, 0xb6, 0x9b, 0xe2, 0xe0, 0x71},
1144 {0x1a, 0xb5, 0x3a, 0x06, 0x5d, 0x8f, 0x77, 0x6a, 0x08, 0xb3, 0x3e,
1145 0x51, 0x38, 0x30, 0x71, 0xb6, 0xf1, 0x54, 0x61, 0x21, 0x16, 0x65,
1146 0x51, 0x37, 0xbd, 0x3b, 0x7e, 0xc2, 0x9b, 0x70, 0xfd, 0x56},
1147 {{Action::WRAP, {SECSuccess, true}},
1148 {Action::UNWRAP, {SECSuccess, true}}}},
1149
1150 {100,
1151 {0xea, 0x46, 0x99, 0x1d, 0x4e, 0x71, 0xf5, 0x3d, 0xd6, 0x24, 0xe7,
1152 0xfe, 0x7f, 0xde, 0x11, 0x94, 0x4a, 0x7c, 0x59, 0x42, 0xd2, 0x32,
1153 0x36, 0x9b, 0x80, 0x65, 0xd4, 0x2b, 0x8c, 0xd2, 0xdd, 0xe1},
1154 {0xdf, 0xfc, 0x5c, 0xf1, 0xdd, 0x54, 0x11, 0xd0, 0x15, 0xd8, 0x46, 0x01,
1155 0xfa, 0x38, 0xdf, 0x5e, 0xff, 0xe8, 0x85, 0xc7, 0xf2, 0x6a, 0x48, 0x25},
1156 {0xa1, 0xbf, 0x8e, 0x73, 0xe3, 0xfa, 0x1d, 0xb7, 0x59, 0xf0, 0xab,
1157 0x2a, 0xb0, 0xb1, 0xca, 0x6f, 0x2c, 0x85, 0xb6, 0x3d, 0x83, 0xe2,
1158 0x5f, 0x7a, 0x0b, 0x52, 0x93, 0xd0, 0xa2, 0x16, 0xa2, 0xb7},
1159 {{Action::WRAP, {SECSuccess, true}},
1160 {Action::UNWRAP, {SECSuccess, true}}}},
1161
1162 {101,
1163 {0xfd, 0xcf, 0xa9, 0x02, 0xc6, 0xf2, 0x22, 0xf5, 0x27, 0xaf, 0x84,
1164 0xda, 0x53, 0x3b, 0x14, 0xb5, 0x2e, 0x26, 0x15, 0xda, 0x3a, 0x89,
1165 0xd1, 0xd3, 0x57, 0x08, 0xb0, 0xcd, 0x49, 0xf6, 0x0d, 0x87},
1166 {0x96, 0x6b, 0x07, 0x04, 0x73, 0x54, 0x96, 0x6a, 0x70, 0x3e, 0x79, 0x60,
1167 0x7b, 0x55, 0x60, 0x32, 0xf4, 0xf5, 0x96, 0xb7, 0xf9, 0x20, 0x6f, 0x05},
1168 {0x27, 0x30, 0x8a, 0x0e, 0x1a, 0x6c, 0x0a, 0x1d, 0x15, 0xd6, 0x17,
1169 0x4a, 0xb7, 0xd6, 0x86, 0x75, 0x20, 0x7b, 0x61, 0x5d, 0xf1, 0x6f,
1170 0xcf, 0x7a, 0x3c, 0x69, 0xb2, 0x5f, 0x55, 0x1c, 0xca, 0x9f},
1171 {{Action::WRAP, {SECSuccess, true}},
1172 {Action::UNWRAP, {SECSuccess, true}}}},
1173
1174 {102,
1175 {0x38, 0xe1, 0xb1, 0xd0, 0x75, 0xd9, 0xd8, 0x52, 0xb9, 0xa6, 0xc0,
1176 0x1c, 0x8f, 0xf6, 0x96, 0x5a, 0xf0, 0x1b, 0xac, 0x45, 0x7a, 0x4e,
1177 0x33, 0x9a, 0xe3, 0xe1, 0xd7, 0xb2, 0xff, 0xac, 0xc0, 0xcd},
1178 {0x80, 0xad, 0x68, 0x20, 0xf1, 0xc9, 0x09, 0x81, 0xe2, 0xca, 0x42,
1179 0xb8, 0x17, 0xa3, 0x45, 0xc1, 0x17, 0x9d, 0x0a, 0x11, 0xd8, 0xe2,
1180 0x3a, 0x8a, 0xdc, 0x05, 0x05, 0xe1, 0x3d, 0x87, 0x29, 0x5a},
1181 {0x71, 0x55, 0xee, 0x93, 0x2b, 0x03, 0x58, 0xd9, 0x81, 0x82,
1182 0xa2, 0x3f, 0x7f, 0x42, 0x7c, 0x77, 0x4a, 0xb3, 0x40, 0xa4,
1183 0x75, 0x7d, 0x0b, 0x6a, 0x63, 0xfa, 0xcd, 0x3d, 0xe9, 0x05,
1184 0x78, 0x43, 0x8c, 0xf0, 0x32, 0x01, 0xc3, 0xf8, 0x80, 0x57},
1185 {{Action::WRAP, {SECSuccess, true}},
1186 {Action::UNWRAP, {SECSuccess, true}}}},
1187
1188 {103,
1189 {0xc6, 0x41, 0xf1, 0x68, 0x9d, 0x81, 0xca, 0xa8, 0xba, 0x37, 0xd8,
1190 0x95, 0x27, 0x22, 0x40, 0x66, 0x40, 0x54, 0xed, 0x97, 0x4c, 0xff,
1191 0xfc, 0x40, 0xe6, 0xc5, 0xc0, 0xca, 0xd1, 0xb9, 0x16, 0xc7},
1192 {0x3f, 0xd0, 0xba, 0x19, 0x95, 0x5e, 0x46, 0x74, 0x9f, 0x54, 0xd8,
1193 0x8e, 0x99, 0xd0, 0x80, 0xb7, 0x33, 0x9d, 0x58, 0x8f, 0xe6, 0x12,
1194 0xec, 0x0f, 0x40, 0x21, 0xca, 0x3c, 0xa2, 0x10, 0x42, 0x70},
1195 {0xf2, 0x0b, 0x9b, 0x55, 0x3b, 0xc0, 0x84, 0x75, 0x29, 0xf8,
1196 0xd4, 0x37, 0x9f, 0xa9, 0x09, 0x21, 0x1e, 0x68, 0x24, 0x9b,
1197 0xd4, 0x29, 0xf4, 0x36, 0xc6, 0x15, 0xc4, 0xc4, 0xa5, 0xd9,
1198 0xf1, 0xa1, 0x96, 0x8f, 0x0b, 0x89, 0xc5, 0x23, 0x7b, 0x30},
1199 {{Action::WRAP, {SECSuccess, true}},
1200 {Action::UNWRAP, {SECSuccess, true}}}},
1201
1202 {104,
1203 {0xaa, 0x0a, 0xb9, 0xd6, 0x8e, 0xd4, 0xa0, 0x4e, 0x72, 0x3f, 0x81,
1204 0xb4, 0x4c, 0x0c, 0x88, 0xd0, 0xbc, 0xde, 0x7a, 0x80, 0xcf, 0xd4,
1205 0x76, 0xeb, 0x4b, 0x88, 0x36, 0xd9, 0xaa, 0x01, 0xec, 0x4c},
1206 {0x57, 0xfa, 0xa8, 0x76, 0x6f, 0x6d, 0x6a, 0x0a, 0xa1, 0xcf, 0x64,
1207 0x3f, 0x85, 0x7c, 0x15, 0x0d, 0xf5, 0xb3, 0x13, 0x03, 0xb5, 0x0a,
1208 0xf4, 0x80, 0xe2, 0x1c, 0x4b, 0x5e, 0x8c, 0x8a, 0x15, 0xd5},
1209 {0x28, 0x11, 0x71, 0x68, 0x54, 0xa2, 0x14, 0xae, 0xcd, 0xd3,
1210 0x18, 0xc6, 0x67, 0x0b, 0x9b, 0x2a, 0x75, 0x11, 0x71, 0x3c,
1211 0x9a, 0x0c, 0x0f, 0xa8, 0x05, 0x23, 0x0f, 0xf0, 0x5c, 0xf8,
1212 0x4a, 0xf7, 0x95, 0xdd, 0x72, 0xf6, 0xc1, 0xa4, 0x45, 0x12},
1213 {{Action::WRAP, {SECSuccess, true}},
1214 {Action::UNWRAP, {SECSuccess, true}}}},
1215
1216 {105, // Round counter overflows 256
1217 {0x31, 0xca, 0xcb, 0xb1, 0x7d, 0x6d, 0xbb, 0xec, 0xae, 0x40, 0x72,
1218 0x7c, 0x50, 0x48, 0xfe, 0x0c, 0x01, 0xbc, 0x53, 0xb2, 0x3a, 0xb6,
1219 0x35, 0x02, 0x5c, 0xba, 0xc1, 0xec, 0xf5, 0x2c, 0xa4, 0x95},
1220 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1221 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1222 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1223 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1224 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1225 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1226 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1227 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1228 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1229 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1230 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1231 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1232 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1233 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1234 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1235 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1236 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1237 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1238 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1239 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1240 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1241 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1242 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1243 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1244 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1245 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1246 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1247 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1248 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1249 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1250 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1251 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1252 {0x53, 0x22, 0xbc, 0x62, 0xbd, 0x83, 0x79, 0xab, 0xbb, 0x75, 0xf6, 0x96,
1253 0x88, 0xb8, 0xf0, 0x0e, 0x31, 0x96, 0x2b, 0x8f, 0x9a, 0xe1, 0xe8, 0x97,
1254 0x71, 0x95, 0x2d, 0x8a, 0x2a, 0x74, 0x9e, 0x13, 0x52, 0xec, 0x33, 0xb5,
1255 0x43, 0x5a, 0x67, 0x42, 0x71, 0xb3, 0x14, 0x76, 0x0a, 0xb9, 0xf7, 0x53,
1256 0xb1, 0x67, 0x26, 0x18, 0x5e, 0xc7, 0xd3, 0x19, 0xac, 0x60, 0x53, 0x13,
1257 0x55, 0x34, 0x4c, 0x1d, 0x53, 0xc7, 0x90, 0x30, 0x00, 0xa8, 0x03, 0x9e,
1258 0xb4, 0x0f, 0x70, 0x56, 0x4a, 0x0a, 0xd3, 0xf4, 0x1b, 0x23, 0x55, 0xea,
1259 0x5d, 0xfa, 0x6a, 0x1d, 0x46, 0x39, 0x2f, 0x1d, 0x10, 0x6a, 0x5d, 0xa5,
1260 0x69, 0xbf, 0xb0, 0x49, 0x3b, 0xf7, 0xc1, 0x2d, 0xff, 0x04, 0xba, 0xfe,
1261 0xae, 0x37, 0x7d, 0xf4, 0xbb, 0x47, 0xcd, 0x44, 0x0b, 0x6f, 0x60, 0xfb,
1262 0xab, 0x2a, 0x54, 0xa9, 0x85, 0x51, 0xb7, 0x62, 0x73, 0xe0, 0x2c, 0xac,
1263 0x8d, 0x7b, 0xe9, 0xf2, 0x34, 0x3d, 0x3a, 0xbb, 0x2a, 0x23, 0xaf, 0x1c,
1264 0x91, 0xa7, 0x01, 0x1c, 0x67, 0xa7, 0x90, 0x72, 0x60, 0x11, 0x6b, 0x67,
1265 0xd5, 0x10, 0xaa, 0xbe, 0x5c, 0x7c, 0xa4, 0x6c, 0x1c, 0x20, 0xf7, 0x71,
1266 0x06, 0xc4, 0x59, 0x66, 0x58, 0x3b, 0x3e, 0x4e, 0xd7, 0x99, 0xa4, 0x7e,
1267 0xe1, 0x9b, 0xb4, 0x22, 0x32, 0x09, 0x26, 0x5c, 0x2b, 0x1a, 0xc8, 0x18,
1268 0x3a, 0x67, 0x8f, 0xf4, 0x3b, 0xc9, 0xa3, 0x47, 0x0a, 0x50, 0xb9, 0xee,
1269 0x4d, 0x10, 0xf6, 0x06, 0x74, 0x26, 0x8d, 0x72, 0xc6, 0x8b, 0xe0, 0x03,
1270 0xa0, 0xd9, 0xdd, 0x68, 0x49, 0xab, 0xa8, 0x36, 0xfe, 0x8a, 0x17, 0x92,
1271 0xb8, 0x1c, 0x90, 0xe1, 0x29, 0x45, 0xbf, 0xe1, 0xf2, 0x7a, 0x9c, 0x6b,
1272 0x2a, 0xf6, 0x6a, 0x06, 0x3c, 0xdb, 0x77, 0x21, 0xa7, 0xf2, 0x3f, 0xb3,
1273 0x0a, 0xfd, 0xbd, 0x8b, 0x18, 0xdb, 0x37, 0x7d, 0xd1, 0x69, 0x7f, 0x15,
1274 0x7b, 0xe8, 0x1c, 0x15, 0x78, 0xd0, 0x8b, 0x06, 0x6c, 0x71, 0xb0, 0xc5,
1275 0xca, 0x7f, 0xee, 0xca, 0xc1, 0xcd, 0xd9, 0x38, 0xcf, 0x9a, 0xd5, 0x25,
1276 0xf7, 0x48, 0x44, 0x66, 0x09, 0x08, 0x19, 0x4b, 0x28, 0xe5, 0x4e, 0xdd,
1277 0xb1, 0x58, 0xf6, 0xe4, 0xc9, 0x21, 0xb8, 0x11, 0xd9, 0x0d, 0xb7, 0x1a,
1278 0x92, 0xff, 0x87, 0x2d, 0xb2, 0x25, 0x0d, 0xcc, 0x3f, 0x84, 0x7f, 0xc7,
1279 0x52, 0xb6, 0x6d, 0x77, 0xe3, 0x3c, 0x85, 0x08, 0x4d, 0x3f, 0xa5, 0x3b,
1280 0x4f, 0x30, 0x50, 0x3d, 0x2a, 0x06, 0xe6, 0xca, 0xbb, 0x90, 0x33, 0xd5,
1281 0x9f, 0xc1, 0xdc, 0x15, 0xe3, 0x2f, 0x19, 0x84, 0x6a, 0x03, 0x9b, 0x91,
1282 0x59, 0x7b, 0x0b, 0xa3, 0x14, 0x1a, 0x7d, 0x97, 0x17, 0x63, 0x00, 0x62,
1283 0x17, 0x01, 0x17, 0xb2, 0x13, 0x1d, 0xab, 0x77, 0x40, 0x6e, 0x9e, 0xd7,
1284 0xd6, 0x6b, 0x2c, 0x75, 0x4d, 0x84, 0x9c, 0x60},
1285 {{Action::WRAP,
1286 {SECSuccess, true}}, // Round counter overflows - acceptable
1287 {Action::UNWRAP, {SECSuccess, true}}}},
1288
1289 {106, // empty keys cannot be wrapped
1290 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1291 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1292 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1293 {},
1294 {0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6},
1295 {{Action::WRAP, {SECFailure, false}},
1296 {Action::UNWRAP, {SECFailure, false}}}},
1297
1298 {107, // keys of size 8 byte cannot be wrapped
1299 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1300 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1301 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1302 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
1303 {0x18, 0x1b, 0xa6, 0xa3, 0xa4, 0x39, 0x24, 0x69, 0xe3, 0xde, 0x98, 0xdd,
1304 0xbb, 0xdd, 0x24, 0x32},
1305 {{Action::WRAP, {SECFailure, false}},
1306 {Action::UNWRAP, {SECFailure, false}}}},
1307
1308 {108, // wrapped key size must be divisible by 8
1309 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1310 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1311 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1312 {0x00},
1313 {},
1314 {{Action::WRAP, {SECFailure, false}},
1315 {Action::UNWRAP, {SECFailure, false}}}},
1316
1317 {109, // wrapped key size must be divisible by 8
1318 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1319 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1320 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1321 {0x00, 0x01},
1322 {},
1323 {{Action::WRAP, {SECFailure, false}},
1324 {Action::UNWRAP, {SECFailure, false}}}},
1325
1326 {110, // wrapped key size must be divisible by 8
1327 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1328 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1329 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1330 {0x00, 0x01, 0x02},
1331 {},
1332 {{Action::WRAP, {SECFailure, false}},
1333 {Action::UNWRAP, {SECFailure, false}}}},
1334
1335 {111, // wrapped key size must be divisible by 8
1336 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1337 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1338 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1339 {0x00, 0x01, 0x02, 0x03},
1340 {},
1341 {{Action::WRAP, {SECFailure, false}},
1342 {Action::UNWRAP, {SECFailure, false}}}},
1343
1344 {112, // wrapped key size must be divisible by 8
1345 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1346 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1347 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1348 {0x00, 0x01, 0x02, 0x03, 0x04},
1349 {},
1350 {{Action::WRAP, {SECFailure, false}},
1351 {Action::UNWRAP, {SECFailure, false}}}},
1352
1353 {113, // wrapped key size must be divisible by 8
1354 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1355 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1356 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1357 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05},
1358 {},
1359 {{Action::WRAP, {SECFailure, false}},
1360 {Action::UNWRAP, {SECFailure, false}}}},
1361
1362 {114, // wrapped key size must be divisible by 8
1363 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1364 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1365 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1366 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06},
1367 {},
1368 {{Action::WRAP, {SECFailure, false}},
1369 {Action::UNWRAP, {SECFailure, false}}}},
1370
1371 {115, // wrapped key size must be divisible by 8
1372 {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
1373 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
1374 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
1375 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
1376 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
1377 {},
1378 {{Action::WRAP, {SECFailure, false}},
1379 {Action::UNWRAP, {SECFailure, false}}}},
1380
1381 {116, // invalid size of wrapped key
1382 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
1383 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
1384 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
1385 {},
1386 {},
1387 {{Action::WRAP, {SECFailure, false}},
1388 {Action::UNWRAP, {SECFailure, false}}}},
1389
1390 {117, // invalid size of wrapped key
1391 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
1392 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
1393 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
1394 {},
1395 {0x9f},
1396 {{Action::WRAP, {SECFailure, false}},
1397 {Action::UNWRAP, {SECFailure, false}}}},
1398
1399 {118, // invalid size of wrapped key
1400 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
1401 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
1402 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
1403 {},
1404 {0xdc, 0x9e, 0x95, 0x80},
1405 {{Action::WRAP, {SECFailure, false}},
1406 {Action::UNWRAP, {SECFailure, false}}}},
1407
1408 {119, // invalid size of wrapped key
1409 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
1410 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
1411 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
1412 {},
1413 {0xb9, 0xb2, 0x82, 0xd1, 0x38, 0x69, 0x30, 0x00},
1414 {{Action::WRAP, {SECFailure, false}},
1415 {Action::UNWRAP, {SECFailure, false}}}},
1416
1417 {120, // invalid size of wrapped key
1418 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
1419 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
1420 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
1421 {},
1422 {0x0e, 0xfc, 0x63, 0x5b, 0x2d, 0x61, 0xe2, 0x44, 0x05, 0x6b, 0x9d, 0x45,
1423 0x91, 0xca, 0x6b},
1424 {{Action::WRAP, {SECFailure, false}},
1425 {Action::UNWRAP, {SECFailure, false}}}},
1426
1427 {121, // invalid size of wrapped key
1428 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
1429 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
1430 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
1431 {},
1432 {0x4a, 0x30, 0x5d, 0xae, 0x08, 0x7b, 0x0d, 0x24, 0xd6, 0x2a, 0xf4, 0x18,
1433 0x31, 0x33, 0x8f, 0x33, 0xae},
1434 {{Action::WRAP, {SECFailure, false}},
1435 {Action::UNWRAP, {SECFailure, false}}}},
1436
1437 {122, // invalid size of wrapped key
1438 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
1439 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
1440 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
1441 {},
1442 {0x82, 0xcb, 0x92, 0x70, 0x97, 0xcf, 0x31, 0xea, 0x4a, 0xff,
1443 0xea, 0x44, 0x0b, 0x0d, 0x8c, 0xa6, 0xa2, 0x40, 0xb9, 0x00},
1444 {{Action::WRAP, {SECFailure, false}},
1445 {Action::UNWRAP, {SECFailure, false}}}},
1446
1447 {123, // bytes appended to wrapped key
1448 {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
1449 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
1450 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
1451 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
1452 0x0c, 0x0d, 0x0e, 0x0f},
1453 {0x7d, 0xfb, 0xd7, 0xcf, 0x61, 0x58, 0xd7, 0x5b, 0xb5,
1454 0x90, 0x0b, 0x3b, 0xf1, 0xe3, 0x87, 0x10, 0x03, 0x40,
1455 0x2a, 0x65, 0x08, 0xb1, 0x91, 0x28, 0x00},
1456 {{Action::WRAP, {SECSuccess, false}},
1457 {Action::UNWRAP, {SECFailure, false}}}},
1458
1459 {124, // Incorrect IV
1460 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1461 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1462 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1463 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1464 0x01, 0xd0, 0x70, 0xa5},
1465 {0xa4, 0x17, 0x67, 0x1b, 0xc6, 0x2a, 0x23, 0xc7, 0xa6, 0x55, 0x43, 0x09,
1466 0x21, 0x24, 0x02, 0x4d, 0xf7, 0x2c, 0x04, 0x8d, 0x8d, 0xb3, 0x30, 0xc7},
1467 {{Action::WRAP, {SECSuccess, false}},
1468 {Action::UNWRAP, {SECFailure, false}}}},
1469
1470 {125, // Incorrect IV
1471 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1472 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1473 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1474 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1475 0x01, 0xd0, 0x70, 0xa5},
1476 {0x95, 0x18, 0xd0, 0xf9, 0x9d, 0x7a, 0x73, 0xed, 0x4a, 0x50, 0x2b, 0x44,
1477 0x9c, 0x14, 0xc2, 0x85, 0x97, 0x1b, 0x0e, 0x61, 0x77, 0xce, 0x0e, 0xca},
1478 {{Action::WRAP, {SECSuccess, false}},
1479 {Action::UNWRAP, {SECFailure, false}}}},
1480
1481 {126, // Incorrect IV
1482 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1483 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1484 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1485 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1486 0x01, 0xd0, 0x70, 0xa5},
1487 {0xf3, 0x51, 0x1f, 0x04, 0x91, 0xbd, 0x74, 0xae, 0x1d, 0xef, 0xb5, 0x30,
1488 0x7f, 0x0e, 0x18, 0xdb, 0x86, 0x4b, 0x57, 0xb5, 0xc4, 0x04, 0xd4, 0x28},
1489 {{Action::WRAP, {SECSuccess, false}},
1490 {Action::UNWRAP, {SECFailure, false}}}},
1491
1492 {127, // Incorrect IV
1493 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1494 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1495 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1496 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1497 0x01, 0xd0, 0x70, 0xa5},
1498 {0x6c, 0x03, 0xce, 0x77, 0x92, 0x59, 0x66, 0x1c, 0x43, 0xd4, 0x1d, 0x5d,
1499 0x0e, 0x45, 0x68, 0x7f, 0x87, 0x43, 0x53, 0xbb, 0xa5, 0x16, 0xc7, 0x3e},
1500 {{Action::WRAP, {SECSuccess, false}},
1501 {Action::UNWRAP, {SECFailure, false}}}},
1502
1503 {128, // Incorrect IV
1504 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1505 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1506 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1507 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1508 0x01, 0xd0, 0x70, 0xa5},
1509 {0x8d, 0xf0, 0x19, 0x69, 0xa1, 0x1c, 0x87, 0x02, 0x65, 0x35, 0xbf, 0xcc,
1510 0xf7, 0x2b, 0x1d, 0x06, 0x4c, 0x86, 0xec, 0xc7, 0xe5, 0x22, 0x71, 0x57},
1511 {{Action::WRAP, {SECSuccess, false}},
1512 {Action::UNWRAP, {SECFailure, false}}}},
1513
1514 {129, // Incorrect IV
1515 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1516 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1517 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1518 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1519 0x01, 0xd0, 0x70, 0xa5},
1520 {0x8e, 0xd1, 0xcd, 0xe2, 0x28, 0xd9, 0xc8, 0xd0, 0x46, 0xdc, 0xa6, 0x5c,
1521 0x7a, 0x27, 0xae, 0xf2, 0xed, 0xf8, 0xae, 0x90, 0xc7, 0x05, 0xd1, 0xe9},
1522 {{Action::WRAP, {SECSuccess, false}},
1523 {Action::UNWRAP, {SECFailure, false}}}},
1524
1525 {130, // Incorrect IV
1526 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1527 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1528 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1529 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1530 0x01, 0xd0, 0x70, 0xa5},
1531 {0xd6, 0x9b, 0x3e, 0x34, 0xe9, 0xde, 0x38, 0xd4, 0x4d, 0xe1, 0x99, 0x89,
1532 0x92, 0x36, 0x2a, 0x6f, 0xa1, 0xf6, 0x96, 0xb5, 0xac, 0xab, 0x3f, 0x10},
1533 {{Action::WRAP, {SECSuccess, false}},
1534 {Action::UNWRAP, {SECFailure, false}}}},
1535
1536 {131, // Incorrect IV
1537 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1538 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1539 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1540 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1541 0x01, 0xd0, 0x70, 0xa5},
1542 {0x67, 0x86, 0x51, 0x22, 0xaf, 0x32, 0x94, 0xb8, 0xda, 0x05, 0x88, 0x77,
1543 0x51, 0x25, 0xcb, 0xd6, 0xdc, 0x19, 0xd5, 0xe5, 0xca, 0xb9, 0x7b, 0x6d},
1544 {{Action::WRAP, {SECSuccess, false}},
1545 {Action::UNWRAP, {SECFailure, false}}}},
1546
1547 {132, // Incorrect IV
1548 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1549 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1550 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1551 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1552 0x01, 0xd0, 0x70, 0xa5},
1553 {0x9f, 0x0f, 0xa5, 0x23, 0x63, 0xdd, 0x55, 0xdf, 0x47, 0x2d, 0x86, 0x7e,
1554 0x6f, 0xaf, 0x5d, 0xa8, 0xeb, 0x20, 0x4a, 0x1d, 0x6d, 0x49, 0x70, 0x30},
1555 {{Action::WRAP, {SECSuccess, false}},
1556 {Action::UNWRAP, {SECFailure, false}}}},
1557
1558 {133, // Incorrect IV
1559 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1560 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1561 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1562 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1563 0x01, 0xd0, 0x70, 0xa5},
1564 {0xc3, 0x99, 0xf9, 0x99, 0xc9, 0x6a, 0x42, 0x04, 0x32, 0x5e, 0x7f, 0x08,
1565 0xd6, 0xa4, 0xde, 0x25, 0x6f, 0xaf, 0x21, 0xec, 0x2c, 0x00, 0x7d, 0xdf},
1566 {{Action::WRAP, {SECSuccess, false}},
1567 {Action::UNWRAP, {SECFailure, false}}}},
1568
1569 {134, // Incorrect IV
1570 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1571 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1572 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1573 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1574 0x01, 0xd0, 0x70, 0xa5},
1575 {0x28, 0x20, 0x82, 0x26, 0x4a, 0x87, 0xdc, 0x35, 0xce, 0x1c, 0xc5, 0xb9,
1576 0x93, 0x1b, 0x77, 0xd8, 0x0d, 0x82, 0xfc, 0xac, 0xc0, 0x92, 0x7f, 0x85},
1577 {{Action::WRAP, {SECSuccess, false}},
1578 {Action::UNWRAP, {SECFailure, false}}}},
1579
1580 {135, // Incorrect IV
1581 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1582 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1583 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1584 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1585 0x01, 0xd0, 0x70, 0xa5},
1586 {0xc1, 0x92, 0xc9, 0x0b, 0x83, 0x00, 0x3c, 0xa9, 0x67, 0x44, 0x49, 0x80,
1587 0x14, 0xb6, 0xad, 0x6b, 0xed, 0xda, 0x83, 0x79, 0x55, 0x26, 0x98, 0x19},
1588 {{Action::WRAP, {SECSuccess, false}},
1589 {Action::UNWRAP, {SECFailure, false}}}},
1590
1591 {136, // Incorrect IV
1592 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1593 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1594 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1595 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1596 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1597 {0x30, 0xa9, 0x83, 0xcd, 0x9e, 0x69, 0xd5, 0x61, 0xac, 0xc9, 0x5c,
1598 0x42, 0xb2, 0x52, 0xab, 0xa4, 0x18, 0x5f, 0x83, 0x92, 0xf2, 0xe6,
1599 0xc9, 0x35, 0xc8, 0xeb, 0x10, 0x5a, 0xf8, 0x08, 0x2e, 0x34},
1600 {{Action::WRAP, {SECSuccess, false}},
1601 {Action::UNWRAP, {SECFailure, false}}}},
1602
1603 {137, // Incorrect IV
1604 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1605 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1606 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1607 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1608 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1609 {0x4d, 0xe9, 0xa6, 0x39, 0xb7, 0x99, 0x63, 0x0b, 0x45, 0xb4, 0x9e,
1610 0x28, 0xdb, 0xfc, 0x44, 0xda, 0xbb, 0x98, 0x43, 0xee, 0x58, 0x8a,
1611 0x8c, 0xff, 0x28, 0x6b, 0x8d, 0x5f, 0xbd, 0x7b, 0x32, 0xee},
1612 {{Action::WRAP, {SECSuccess, false}},
1613 {Action::UNWRAP, {SECFailure, false}}}},
1614
1615 {138, // Incorrect IV
1616 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1617 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1618 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1619 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1620 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1621 {0xd9, 0x15, 0xb2, 0xcd, 0xfb, 0x76, 0x9d, 0x9d, 0x82, 0x25, 0x9d,
1622 0xc3, 0xd1, 0x24, 0x64, 0x6b, 0xbf, 0x97, 0x2b, 0x83, 0xef, 0xd4,
1623 0xc2, 0xea, 0xe9, 0xb9, 0xf7, 0x51, 0x07, 0x3f, 0x78, 0xd6},
1624 {{Action::WRAP, {SECSuccess, false}},
1625 {Action::UNWRAP, {SECFailure, false}}}},
1626
1627 {139, // Incorrect IV
1628 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1629 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1630 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1631 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1632 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1633 {0x11, 0x7d, 0x65, 0x3f, 0x48, 0x0b, 0x69, 0xfc, 0xe5, 0x64, 0xf1,
1634 0xfe, 0x99, 0x57, 0x24, 0x92, 0x94, 0x51, 0x89, 0xed, 0x5a, 0xf7,
1635 0x89, 0xce, 0x05, 0xa2, 0x65, 0x1b, 0xaf, 0x90, 0xbb, 0x5e},
1636 {{Action::WRAP, {SECSuccess, false}},
1637 {Action::UNWRAP, {SECFailure, false}}}},
1638
1639 {140, // Incorrect IV
1640 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1641 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1642 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1643 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1644 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1645 {0x82, 0x26, 0xd0, 0x7a, 0x2f, 0x91, 0x9e, 0x24, 0xad, 0xa1, 0x08,
1646 0x1c, 0x69, 0xa7, 0x55, 0x20, 0xbe, 0x89, 0x5e, 0x3a, 0x2b, 0xda,
1647 0x9b, 0x80, 0x5d, 0x97, 0x47, 0x77, 0x3d, 0xde, 0xaa, 0x38},
1648 {{Action::WRAP, {SECSuccess, false}},
1649 {Action::UNWRAP, {SECFailure, false}}}},
1650
1651 {141, // Incorrect IV
1652 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1653 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1654 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1655 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1656 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1657 {0xb0, 0xa7, 0x43, 0x45, 0xbe, 0xdf, 0x88, 0x65, 0x34, 0x8d, 0xaf,
1658 0x45, 0xd0, 0x54, 0xb9, 0x9c, 0xe5, 0x15, 0xea, 0x8b, 0xe1, 0x36,
1659 0x27, 0x0d, 0x1c, 0xf7, 0x1e, 0x1c, 0xfa, 0x7a, 0xa4, 0xa2},
1660 {{Action::WRAP, {SECSuccess, false}},
1661 {Action::UNWRAP, {SECFailure, false}}}},
1662
1663 {142, // Incorrect IV
1664 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1665 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1666 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1667 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1668 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1669 {0xa2, 0x61, 0xdb, 0x77, 0xf1, 0x7f, 0x7e, 0xc7, 0x36, 0xd1, 0xa8,
1670 0xbe, 0x16, 0xe5, 0xf9, 0xae, 0x43, 0x2f, 0xe2, 0xa1, 0x70, 0x12,
1671 0xe5, 0xa6, 0xf0, 0x7c, 0x54, 0x26, 0xa9, 0xf0, 0xca, 0x59},
1672 {{Action::WRAP, {SECSuccess, false}},
1673 {Action::UNWRAP, {SECFailure, false}}}},
1674
1675 {143, // Incorrect IV
1676 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1677 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1678 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1679 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1680 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1681 {0xc5, 0x3a, 0xcb, 0x5e, 0x09, 0x6b, 0x54, 0x54, 0x8e, 0x13, 0x85,
1682 0xb2, 0xff, 0x18, 0xea, 0xef, 0x68, 0xd2, 0x35, 0xc9, 0x5b, 0x01,
1683 0x94, 0xe7, 0x4a, 0x23, 0x83, 0xd3, 0xa7, 0xa5, 0x30, 0xdc},
1684 {{Action::WRAP, {SECSuccess, false}},
1685 {Action::UNWRAP, {SECFailure, false}}}},
1686
1687 {144, // Incorrect IV
1688 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1689 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1690 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1691 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1692 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1693 {0xfa, 0xef, 0x48, 0x2d, 0x99, 0xeb, 0xb1, 0x80, 0xe5, 0xbc, 0x5e,
1694 0x3c, 0xf7, 0x75, 0xba, 0x29, 0x2c, 0x2a, 0x3b, 0x6c, 0x44, 0xaa,
1695 0x4a, 0x21, 0xad, 0x40, 0x09, 0x06, 0xf1, 0x1a, 0xf3, 0x92},
1696 {{Action::WRAP, {SECSuccess, false}},
1697 {Action::UNWRAP, {SECFailure, false}}}},
1698
1699 {145, // Incorrect IV
1700 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1701 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1702 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1703 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1704 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1705 {0x73, 0xa4, 0x50, 0xb6, 0x3b, 0x07, 0xb3, 0xae, 0xce, 0x9d, 0x1a,
1706 0xe5, 0xbf, 0x09, 0x7a, 0x3d, 0xd3, 0xfc, 0xf7, 0x3e, 0x3e, 0xc2,
1707 0xf1, 0xbd, 0x8f, 0xc3, 0xb5, 0x58, 0x6c, 0xb9, 0xbd, 0x73},
1708 {{Action::WRAP, {SECSuccess, false}},
1709 {Action::UNWRAP, {SECFailure, false}}}},
1710
1711 {146, // Incorrect IV
1712 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1713 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1714 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1715 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1716 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1717 {0xd3, 0x4b, 0x6e, 0xe1, 0x84, 0xd3, 0x87, 0xc9, 0xaa, 0x4b, 0x2d,
1718 0x18, 0x0a, 0xe0, 0xa8, 0x94, 0x98, 0x01, 0x4e, 0x55, 0xfe, 0x8e,
1719 0x41, 0x6b, 0xe4, 0xf8, 0x26, 0xfc, 0xf7, 0xd5, 0x65, 0x22},
1720 {{Action::WRAP, {SECSuccess, false}},
1721 {Action::UNWRAP, {SECFailure, false}}}},
1722
1723 {147, // Incorrect IV
1724 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1725 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1726 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1727 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
1728 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
1729 {0x2a, 0xf8, 0x23, 0xd1, 0x60, 0x28, 0x03, 0x74, 0x0b, 0xfa, 0x90,
1730 0x40, 0xc2, 0xc4, 0xe7, 0x69, 0xa5, 0xb6, 0xde, 0x91, 0x9d, 0x40,
1731 0x3c, 0xfb, 0xa9, 0xad, 0x36, 0x0f, 0x63, 0xaf, 0x11, 0x13},
1732 {{Action::WRAP, {SECSuccess, false}},
1733 {Action::UNWRAP, {SECFailure, false}}}},
1734
1735 {148, // Incorrect IV
1736 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1737 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1738 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1739 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1740 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1741 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1742 {0xdd, 0x78, 0xeb, 0xd3, 0x09, 0x1c, 0x55, 0xa5, 0xda, 0x5b,
1743 0x24, 0x50, 0x42, 0x00, 0xf7, 0xfa, 0xdd, 0x1b, 0x3a, 0xc6,
1744 0xad, 0x35, 0xf8, 0x14, 0xf7, 0x33, 0xe6, 0x03, 0xc1, 0x39,
1745 0x36, 0x24, 0x5d, 0x69, 0xd8, 0x3f, 0x26, 0x2f, 0x6b, 0x1e},
1746 {{Action::WRAP, {SECSuccess, false}},
1747 {Action::UNWRAP, {SECFailure, false}}}},
1748
1749 {149, // Incorrect IV
1750 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1751 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1752 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1753 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1754 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1755 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1756 {0x3d, 0x83, 0x38, 0xea, 0xe7, 0xde, 0x32, 0x23, 0x99, 0xe1,
1757 0xd1, 0xb4, 0xa3, 0xdf, 0x54, 0x32, 0x6b, 0x24, 0x2b, 0x56,
1758 0x36, 0x12, 0xea, 0x4b, 0x27, 0xda, 0x22, 0xa0, 0x41, 0xd3,
1759 0xc8, 0x09, 0x66, 0x91, 0x1b, 0xc0, 0x09, 0x91, 0x17, 0x61},
1760 {{Action::WRAP, {SECSuccess, false}},
1761 {Action::UNWRAP, {SECFailure, false}}}},
1762
1763 {150, // Incorrect IV
1764 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1765 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1766 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1767 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1768 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1769 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1770 {0xd0, 0x4b, 0xf7, 0x5c, 0xad, 0xd3, 0xb5, 0xf0, 0x99, 0xc3,
1771 0x4b, 0x27, 0xa9, 0x1e, 0x64, 0xa8, 0xf2, 0xdb, 0xcf, 0x08,
1772 0xe8, 0xc5, 0xc1, 0xc9, 0xf0, 0x7a, 0x77, 0x7e, 0xeb, 0x80,
1773 0x5d, 0x5d, 0x0e, 0x8c, 0x5c, 0x01, 0xaf, 0xc4, 0x39, 0x44},
1774 {{Action::WRAP, {SECSuccess, false}},
1775 {Action::UNWRAP, {SECFailure, false}}}},
1776
1777 {151, // Incorrect IV
1778 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1779 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1780 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1781 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1782 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1783 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1784 {0xbe, 0x0c, 0x5d, 0x19, 0x3b, 0x61, 0xc5, 0x13, 0x7a, 0x8f,
1785 0xd8, 0xa6, 0xd7, 0xd1, 0xed, 0x8f, 0x0f, 0xa2, 0x8c, 0xec,
1786 0x51, 0x6f, 0x54, 0x46, 0x97, 0xc1, 0x2a, 0xdd, 0x4f, 0x8f,
1787 0x4d, 0x5c, 0xfc, 0xa6, 0x5e, 0xde, 0xb1, 0x01, 0x99, 0x74},
1788 {{Action::WRAP, {SECSuccess, false}},
1789 {Action::UNWRAP, {SECFailure, false}}}},
1790
1791 {152, // Incorrect IV
1792 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1793 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1794 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1795 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1796 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1797 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1798 {0xa8, 0x3e, 0xbc, 0xbe, 0xb2, 0xbe, 0x9d, 0x68, 0x07, 0xb5,
1799 0xcf, 0xc3, 0x1c, 0x89, 0x84, 0x9d, 0x13, 0x43, 0xdd, 0x4e,
1800 0xb2, 0x2e, 0x5b, 0xfe, 0x9e, 0x2b, 0x2b, 0x37, 0x90, 0xad,
1801 0x89, 0x00, 0x60, 0x1f, 0x1f, 0x5d, 0x54, 0xfd, 0x47, 0x2f},
1802 {{Action::WRAP, {SECSuccess, false}},
1803 {Action::UNWRAP, {SECFailure, false}}}},
1804
1805 {153, // Incorrect IV
1806 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1807 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1808 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1809 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1810 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1811 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1812 {0x41, 0x62, 0x21, 0x48, 0x5a, 0x6c, 0xb9, 0x8a, 0xd1, 0x34,
1813 0x2e, 0xa9, 0xa1, 0x29, 0x26, 0xa9, 0xa1, 0x33, 0xea, 0xd8,
1814 0xbd, 0x91, 0x93, 0x23, 0xfe, 0x78, 0x9b, 0xb8, 0xf8, 0x9a,
1815 0x4f, 0xca, 0xf8, 0x1e, 0x1b, 0xe5, 0x4f, 0x9d, 0x35, 0x8e},
1816 {{Action::WRAP, {SECSuccess, false}},
1817 {Action::UNWRAP, {SECFailure, false}}}},
1818
1819 {154, // Incorrect IV
1820 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1821 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1822 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1823 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1824 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1825 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1826 {0xbf, 0x6a, 0x53, 0x28, 0x6f, 0xac, 0x48, 0xe7, 0xf2, 0x5d,
1827 0x89, 0xb7, 0x05, 0x6b, 0x27, 0xaa, 0x91, 0x7d, 0x5b, 0x54,
1828 0xc0, 0xd3, 0x17, 0x1d, 0xff, 0x36, 0x9f, 0x72, 0x49, 0x15,
1829 0x3b, 0xf0, 0x9d, 0xa5, 0x89, 0x1e, 0xb4, 0xdc, 0x2d, 0x88},
1830 {{Action::WRAP, {SECSuccess, false}},
1831 {Action::UNWRAP, {SECFailure, false}}}},
1832
1833 {155, // Incorrect IV
1834 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1835 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1836 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1837 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1838 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1839 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1840 {0x99, 0xd5, 0x17, 0xa1, 0x32, 0x1b, 0xb6, 0x33, 0xb0, 0xd5,
1841 0xf3, 0xaf, 0xda, 0x23, 0x72, 0xd3, 0xab, 0xf6, 0x8b, 0x41,
1842 0xd1, 0x3c, 0xbf, 0xdf, 0xfc, 0x78, 0xf1, 0x73, 0xb8, 0x8b,
1843 0xc4, 0xb9, 0x7e, 0xfc, 0xab, 0x2b, 0x29, 0x04, 0x78, 0x8d},
1844 {{Action::WRAP, {SECSuccess, false}},
1845 {Action::UNWRAP, {SECFailure, false}}}},
1846
1847 {156, // Incorrect IV
1848 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1849 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1850 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1851 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1852 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1853 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1854 {0xd9, 0x24, 0x56, 0xbc, 0x77, 0xa2, 0x68, 0xef, 0x71, 0xcb,
1855 0xa7, 0x60, 0x64, 0xa1, 0xb7, 0x72, 0xd1, 0xfe, 0xe2, 0xae,
1856 0x4f, 0x0e, 0xe3, 0xbb, 0x93, 0x2a, 0x2a, 0xdb, 0x2b, 0x03,
1857 0x17, 0x96, 0xb9, 0xea, 0xdb, 0x51, 0x75, 0x3f, 0x28, 0x68},
1858 {{Action::WRAP, {SECSuccess, false}},
1859 {Action::UNWRAP, {SECFailure, false}}}},
1860
1861 {157, // Incorrect IV
1862 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1863 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1864 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1865 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1866 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1867 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1868 {0x5b, 0xb5, 0x46, 0x30, 0xab, 0x8d, 0x73, 0xa0, 0x40, 0xf0,
1869 0xf8, 0x7e, 0x70, 0xe2, 0x63, 0xd1, 0xae, 0xb2, 0x35, 0x8b,
1870 0xcd, 0xc0, 0xdc, 0xe6, 0x99, 0x4d, 0x0d, 0x87, 0x44, 0x52,
1871 0xbb, 0xd8, 0x74, 0x1b, 0x7e, 0xc1, 0xd5, 0x9d, 0x82, 0x98},
1872 {{Action::WRAP, {SECSuccess, false}},
1873 {Action::UNWRAP, {SECFailure, false}}}},
1874
1875 {158, // Incorrect IV
1876 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1877 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1878 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1879 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1880 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1881 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1882 {0x45, 0x81, 0xd6, 0x53, 0x60, 0x39, 0xdb, 0x1b, 0x23, 0xda,
1883 0x50, 0xc6, 0x48, 0x77, 0x7e, 0x90, 0xc8, 0x2d, 0x61, 0x28,
1884 0xbb, 0x92, 0xe2, 0x8b, 0x29, 0x74, 0xba, 0xe1, 0x14, 0x15,
1885 0x43, 0xa1, 0x9a, 0x15, 0x92, 0xfd, 0xa1, 0xfb, 0xd6, 0x1f},
1886 {{Action::WRAP, {SECSuccess, false}},
1887 {Action::UNWRAP, {SECFailure, false}}}},
1888
1889 {159, // Incorrect IV
1890 {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
1891 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
1892 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
1893 {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
1894 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
1895 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
1896 {0xd3, 0x5b, 0xc6, 0x7e, 0x62, 0x06, 0x4c, 0x34, 0xf4, 0x81,
1897 0x50, 0x99, 0x9b, 0xa3, 0x0d, 0xed, 0x47, 0x5d, 0x8c, 0x75,
1898 0x97, 0x8f, 0x45, 0x73, 0x73, 0x20, 0xf2, 0x3e, 0xda, 0xaa,
1899 0x7a, 0x40, 0xd7, 0x80, 0x3f, 0xc6, 0x1a, 0xdd, 0x34, 0xa4},
1900 {{Action::WRAP, {SECSuccess, false}},
1901 {Action::UNWRAP, {SECFailure, false}}}},
1902
1903 {160, // RFC 3394
1904 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
1905 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
1906 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
1907 {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
1908 0xcc, 0xdd, 0xee, 0xff},
1909 {0x64, 0xe8, 0xc3, 0xf9, 0xce, 0x0f, 0x5b, 0xa2, 0x63, 0xe9, 0x77, 0x79,
1910 0x05, 0x81, 0x8a, 0x2a, 0x93, 0xc8, 0x19, 0x1e, 0x7d, 0x6e, 0x8a, 0xe7},
1911 {{Action::WRAP, {SECSuccess, true}},
1912 {Action::UNWRAP, {SECSuccess, true}}}},
1913
1914 {161, // RFC 3394
1915 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
1916 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
1917 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
1918 {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
1919 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
1920 {0xa8, 0xf9, 0xbc, 0x16, 0x12, 0xc6, 0x8b, 0x3f, 0xf6, 0xe6, 0xf4,
1921 0xfb, 0xe3, 0x0e, 0x71, 0xe4, 0x76, 0x9c, 0x8b, 0x80, 0xa3, 0x2c,
1922 0xb8, 0x95, 0x8c, 0xd5, 0xd1, 0x7d, 0x6b, 0x25, 0x4d, 0xa1},
1923 {{Action::WRAP, {SECSuccess, true}},
1924 {Action::UNWRAP, {SECSuccess, true}}}},
1925
1926 {162, // RFC 3394
1927 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
1928 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
1929 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
1930 {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa,
1931 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
1932 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},
1933 {0x28, 0xc9, 0xf4, 0x04, 0xc4, 0xb8, 0x10, 0xf4, 0xcb, 0xcc,
1934 0xb3, 0x5c, 0xfb, 0x87, 0xf8, 0x26, 0x3f, 0x57, 0x86, 0xe2,
1935 0xd8, 0x0e, 0xd3, 0x26, 0xcb, 0xc7, 0xf0, 0xe7, 0x1a, 0x99,
1936 0xf4, 0x3b, 0xfb, 0x98, 0x8b, 0x9b, 0x7a, 0x02, 0xdd, 0x21},
1937 {{Action::WRAP, {SECSuccess, true}},
1938 {Action::UNWRAP, {SECSuccess, true}}}},
1939};
1940#endif // kw_vectors_h__
0\ No newline at end of file1941\ No newline at end of file
diff --git a/nss/gtests/der_gtest/der_quickder_unittest.cc b/nss/gtests/der_gtest/der_quickder_unittest.cc
index 9441179..a5301f1 100644
--- a/nss/gtests/der_gtest/der_quickder_unittest.cc
+++ b/nss/gtests/der_gtest/der_quickder_unittest.cc
@@ -16,17 +16,35 @@
16#include "secerr.h"16#include "secerr.h"
17#include "secitem.h"17#include "secitem.h"
1818
19const SEC_ASN1Template mySEC_NullTemplate[] = {
20 {SEC_ASN1_NULL, 0, NULL, sizeof(SECItem)}};
21
22namespace nss_test {19namespace nss_test {
2320
21struct TemplateAndInput {
22 const SEC_ASN1Template* t;
23 SECItem input;
24};
25
24class QuickDERTest : public ::testing::Test,26class QuickDERTest : public ::testing::Test,
25 public ::testing::WithParamInterface<SECItem> {};27 public ::testing::WithParamInterface<TemplateAndInput> {};
2628
29static const uint8_t kBitstringTag = 0x03;
27static const uint8_t kNullTag = 0x05;30static const uint8_t kNullTag = 0x05;
28static const uint8_t kLongLength = 0x80;31static const uint8_t kLongLength = 0x80;
2932
33const SEC_ASN1Template kBitstringTemplate[] = {
34 {SEC_ASN1_BIT_STRING, 0, NULL, sizeof(SECItem)}, {0}};
35
36// Empty bitstring with unused bits.
37static uint8_t kEmptyBitstringUnused[] = {kBitstringTag, 1, 1};
38
39// Bitstring with 8 unused bits.
40static uint8_t kBitstring8Unused[] = {kBitstringTag, 3, 8, 0xff, 0x00};
41
42// Bitstring with >8 unused bits.
43static uint8_t kBitstring9Unused[] = {kBitstringTag, 3, 9, 0xff, 0x80};
44
45const SEC_ASN1Template kNullTemplate[] = {
46 {SEC_ASN1_NULL, 0, NULL, sizeof(SECItem)}, {0}};
47
30// Length of zero wrongly encoded as 0x80 instead of 0x00.48// Length of zero wrongly encoded as 0x80 instead of 0x00.
31static uint8_t kOverlongLength_0_0[] = {kNullTag, kLongLength | 0};49static uint8_t kOverlongLength_0_0[] = {kNullTag, kLongLength | 0};
3250
@@ -53,14 +71,22 @@ static uint8_t kOverlongLength_16_0[] = {kNullTag, kLongLength | 0x10,
53 0x00, 0x00,71 0x00, 0x00,
54 0x00, 0x00};72 0x00, 0x00};
5573
56static const SECItem kInvalidDER[] = {74#define TI(t, x) \
57 {siBuffer, kOverlongLength_0_0, sizeof(kOverlongLength_0_0)},75 { \
58 {siBuffer, kOverlongLength_1_0, sizeof(kOverlongLength_1_0)},76 t, { siBuffer, x, sizeof(x) } \
59 {siBuffer, kOverlongLength_16_0, sizeof(kOverlongLength_16_0)},77 }
78static const TemplateAndInput kInvalidDER[] = {
79 TI(kBitstringTemplate, kEmptyBitstringUnused),
80 TI(kBitstringTemplate, kBitstring8Unused),
81 TI(kBitstringTemplate, kBitstring9Unused),
82 TI(kNullTemplate, kOverlongLength_0_0),
83 TI(kNullTemplate, kOverlongLength_1_0),
84 TI(kNullTemplate, kOverlongLength_16_0),
60};85};
86#undef TI
6187
62TEST_P(QuickDERTest, InvalidLengths) {88TEST_P(QuickDERTest, InvalidLengths) {
63 const SECItem& original_input(GetParam());89 const SECItem& original_input(GetParam().input);
6490
65 ScopedSECItem copy_of_input(SECITEM_AllocItem(nullptr, nullptr, 0U));91 ScopedSECItem copy_of_input(SECITEM_AllocItem(nullptr, nullptr, 0U));
66 ASSERT_TRUE(copy_of_input);92 ASSERT_TRUE(copy_of_input);
@@ -69,11 +95,10 @@ TEST_P(QuickDERTest, InvalidLengths) {
6995
70 PORTCheapArenaPool pool;96 PORTCheapArenaPool pool;
71 PORT_InitCheapArena(&pool, DER_DEFAULT_CHUNKSIZE);97 PORT_InitCheapArena(&pool, DER_DEFAULT_CHUNKSIZE);
72 ScopedSECItem parsed_value(SECITEM_AllocItem(nullptr, nullptr, 0U));98 StackSECItem parsed_value;
73 ASSERT_TRUE(parsed_value);
74 ASSERT_EQ(SECFailure,99 ASSERT_EQ(SECFailure,
75 SEC_QuickDERDecodeItem(&pool.arena, parsed_value.get(),100 SEC_QuickDERDecodeItem(&pool.arena, &parsed_value, GetParam().t,
76 mySEC_NullTemplate, copy_of_input.get()));101 copy_of_input.get()));
77 ASSERT_EQ(SEC_ERROR_BAD_DER, PR_GetError());102 ASSERT_EQ(SEC_ERROR_BAD_DER, PR_GetError());
78 PORT_DestroyCheapArena(&pool);103 PORT_DestroyCheapArena(&pool);
79}104}
diff --git a/nss/gtests/freebl_gtest/cmac_unittests.cc b/nss/gtests/freebl_gtest/cmac_unittests.cc
80new file mode 100644105new file mode 100644
index 0000000..40088dc
--- /dev/null
+++ b/nss/gtests/freebl_gtest/cmac_unittests.cc
@@ -0,0 +1,187 @@
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this file,
3// You can obtain one at http://mozilla.org/MPL/2.0/.
4
5#include "gtest/gtest.h"
6
7#include <stdint.h>
8#include <memory>
9
10#include "blapi.h"
11#include "secitem.h"
12#include "freebl_scoped_ptrs.h"
13
14class CmacAesTest : public ::testing::Test {
15 protected:
16 bool Compare(const uint8_t *actual, const uint8_t *expected,
17 unsigned int length) {
18 return strncmp((const char *)actual, (const char *)expected, length) == 0;
19 }
20};
21
22TEST_F(CmacAesTest, CreateInvalidSize) {
23 uint8_t key[1] = {0x00};
24 ScopedCMACContext ctx(CMAC_Create(CMAC_AES, key, sizeof(key)));
25 ASSERT_EQ(ctx, nullptr);
26}
27
28TEST_F(CmacAesTest, CreateRightSize) {
29 uint8_t *key = PORT_NewArray(uint8_t, AES_128_KEY_LENGTH);
30 ScopedCMACContext ctx(CMAC_Create(CMAC_AES, key, AES_128_KEY_LENGTH));
31
32 ASSERT_NE(ctx, nullptr);
33 PORT_Free(key);
34}
35
36// The following tests were taken from NIST's Cryptographic Standards and
37// Guidelines page for AES-CMAC Examples with Intermediate Values. These same
38// test vectors for AES-128 can be found in RFC 4493, Section 4.
39
40static const uint8_t kNistKeys[][AES_256_KEY_LENGTH] = {
41 {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15,
42 0x88, 0x09, 0xCF, 0x4F, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
43 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
44 {0x8E, 0x73, 0xB0, 0xF7, 0xDA, 0x0E, 0x64, 0x52, 0xC8, 0x10, 0xF3,
45 0x2B, 0x80, 0x90, 0x79, 0xE5, 0x62, 0xF8, 0xEA, 0xD2, 0x52, 0x2C,
46 0x6B, 0x7B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
47 {0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, 0x2B, 0x73, 0xAE,
48 0xF0, 0x85, 0x7D, 0x77, 0x81, 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61,
49 0x08, 0xD7, 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4}};
50static const size_t kNistKeyLengthsCount = PR_ARRAY_SIZE(kNistKeys);
51static const unsigned int kNistKeyLengths[kNistKeyLengthsCount] = {
52 AES_128_KEY_LENGTH, AES_192_KEY_LENGTH, AES_256_KEY_LENGTH};
53
54static const uint8_t kNistPlaintext[64] = {
55 0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96, 0xE9, 0x3D, 0x7E,
56 0x11, 0x73, 0x93, 0x17, 0x2A, 0xAE, 0x2D, 0x8A, 0x57, 0x1E, 0x03,
57 0xAC, 0x9C, 0x9E, 0xB7, 0x6F, 0xAC, 0x45, 0xAF, 0x8E, 0x51, 0x30,
58 0xC8, 0x1C, 0x46, 0xA3, 0x5C, 0xE4, 0x11, 0xE5, 0xFB, 0xC1, 0x19,
59 0x1A, 0x0A, 0x52, 0xEF, 0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B,
60 0x17, 0xAD, 0x2B, 0x41, 0x7B, 0xE6, 0x6C, 0x37, 0x10};
61static const unsigned int kNistPlaintextLengths[] = {0, 16, 20, 64};
62static const size_t kNistPlaintextLengthsCount =
63 PR_ARRAY_SIZE(kNistPlaintextLengths);
64
65// This table contains the result of a CMAC over kNistPlaintext using keys from
66// kNistKeys. For each key, there are kNistPlaintextLengthsCount answers, all
67// listed one after the other as the input is truncated to the different sizes
68// in kNistPlaintextLengths.
69static const uint8_t kNistKnown[][AES_BLOCK_SIZE] = {
70 {0xBB, 0x1D, 0x69, 0x29, 0xE9, 0x59, 0x37, 0x28, 0x7F, 0xA3, 0x7D, 0x12,
71 0x9B, 0x75, 0x67, 0x46},
72 {0x07, 0x0A, 0x16, 0xB4, 0x6B, 0x4D, 0x41, 0x44, 0xF7, 0x9B, 0xDD, 0x9D,
73 0xD0, 0x4A, 0x28, 0x7C},
74 {0x7D, 0x85, 0x44, 0x9E, 0xA6, 0xEA, 0x19, 0xC8, 0x23, 0xA7, 0xBF, 0x78,
75 0x83, 0x7D, 0xFA, 0xDE},
76 {0x51, 0xF0, 0xBE, 0xBF, 0x7E, 0x3B, 0x9D, 0x92, 0xFC, 0x49, 0x74, 0x17,
77 0x79, 0x36, 0x3C, 0xFE},
78 {0xD1, 0x7D, 0xDF, 0x46, 0xAD, 0xAA, 0xCD, 0xE5, 0x31, 0xCA, 0xC4, 0x83,
79 0xDE, 0x7A, 0x93, 0x67},
80 {0x9E, 0x99, 0xA7, 0xBF, 0x31, 0xE7, 0x10, 0x90, 0x06, 0x62, 0xF6, 0x5E,
81 0x61, 0x7C, 0x51, 0x84},
82 {0x3D, 0x75, 0xC1, 0x94, 0xED, 0x96, 0x07, 0x04, 0x44, 0xA9, 0xFA, 0x7E,
83 0xC7, 0x40, 0xEC, 0xF8},
84 {0xA1, 0xD5, 0xDF, 0x0E, 0xED, 0x79, 0x0F, 0x79, 0x4D, 0x77, 0x58, 0x96,
85 0x59, 0xF3, 0x9A, 0x11},
86 {0x02, 0x89, 0x62, 0xF6, 0x1B, 0x7B, 0xF8, 0x9E, 0xFC, 0x6B, 0x55, 0x1F,
87 0x46, 0x67, 0xD9, 0x83},
88 {0x28, 0xA7, 0x02, 0x3F, 0x45, 0x2E, 0x8F, 0x82, 0xBD, 0x4B, 0xF2, 0x8D,
89 0x8C, 0x37, 0xC3, 0x5C},
90 {0x15, 0x67, 0x27, 0xDC, 0x08, 0x78, 0x94, 0x4A, 0x02, 0x3C, 0x1F, 0xE0,
91 0x3B, 0xAD, 0x6D, 0x93},
92 {0xE1, 0x99, 0x21, 0x90, 0x54, 0x9F, 0x6E, 0xD5, 0x69, 0x6A, 0x2C, 0x05,
93 0x6C, 0x31, 0x54, 0x10}};
94PR_STATIC_ASSERT(PR_ARRAY_SIZE(kNistKnown) ==
95 kNistKeyLengthsCount * kNistPlaintextLengthsCount);
96
97TEST_F(CmacAesTest, AesNistAligned) {
98 for (unsigned int key_index = 0; key_index < kNistKeyLengthsCount;
99 key_index++) {
100 ScopedCMACContext ctx(CMAC_Create(CMAC_AES, kNistKeys[key_index],
101 kNistKeyLengths[key_index]));
102 ASSERT_NE(ctx, nullptr);
103
104 for (unsigned int plaintext_index = 0;
105 plaintext_index < kNistPlaintextLengthsCount; plaintext_index++) {
106 CMAC_Begin(ctx.get());
107
108 unsigned int known_index =
109 (key_index * kNistPlaintextLengthsCount) + plaintext_index;
110 CMAC_Update(ctx.get(), kNistPlaintext,
111 kNistPlaintextLengths[plaintext_index]);
112
113 uint8_t output[AES_BLOCK_SIZE];
114 CMAC_Finish(ctx.get(), output, NULL, AES_BLOCK_SIZE);
115
116 ASSERT_TRUE(Compare(output, kNistKnown[known_index], AES_BLOCK_SIZE));
117 }
118 }
119}
120
121TEST_F(CmacAesTest, AesNistUnaligned) {
122 for (unsigned int key_index = 0; key_index < kNistKeyLengthsCount;
123 key_index++) {
124 unsigned int key_length = kNistKeyLengths[key_index];
125 ScopedCMACContext ctx(
126 CMAC_Create(CMAC_AES, kNistKeys[key_index], key_length));
127 ASSERT_NE(ctx, nullptr);
128
129 // Skip the zero-length test.
130 for (unsigned int plaintext_index = 1;
131 plaintext_index < kNistPlaintextLengthsCount; plaintext_index++) {
132 unsigned int known_index =
133 (key_index * kNistPlaintextLengthsCount) + plaintext_index;
134 unsigned int plaintext_length = kNistPlaintextLengths[plaintext_index];
135
136 // Test all possible offsets and make sure that misaligned updates
137 // produce the desired result. That is, do two updates:
138 // 0 ... offset
139 // offset ... len - offset
140 // and ensure the result is the same as doing one update.
141 for (unsigned int offset = 1; offset < plaintext_length; offset++) {
142 CMAC_Begin(ctx.get());
143
144 CMAC_Update(ctx.get(), kNistPlaintext, offset);
145 CMAC_Update(ctx.get(), kNistPlaintext + offset,
146 plaintext_length - offset);
147
148 uint8_t output[AES_BLOCK_SIZE];
149 CMAC_Finish(ctx.get(), output, NULL, AES_BLOCK_SIZE);
150
151 ASSERT_TRUE(Compare(output, kNistKnown[known_index], AES_BLOCK_SIZE));
152 }
153 }
154 }
155}
156
157TEST_F(CmacAesTest, AesNistTruncated) {
158 for (unsigned int key_index = 0; key_index < kNistKeyLengthsCount;
159 key_index++) {
160 unsigned int key_length = kNistKeyLengths[key_index];
161 ScopedCMACContext ctx(
162 CMAC_Create(CMAC_AES, kNistKeys[key_index], key_length));
163 ASSERT_TRUE(ctx != nullptr);
164
165 // Skip the zero-length test.
166 for (unsigned int plaintext_index = 1;
167 plaintext_index < kNistPlaintextLengthsCount; plaintext_index++) {
168 unsigned int known_index =
169 (key_index * kNistPlaintextLengthsCount) + plaintext_index;
170 unsigned int plaintext_length = kNistPlaintextLengths[plaintext_index];
171
172 // Test truncated outputs to ensure that we always get the desired values.
173 for (unsigned int out_len = 1; out_len < AES_BLOCK_SIZE; out_len++) {
174 CMAC_Begin(ctx.get());
175
176 CMAC_Update(ctx.get(), kNistPlaintext, plaintext_length);
177
178 unsigned int actual_out_len = 0;
179 uint8_t output[AES_BLOCK_SIZE];
180 CMAC_Finish(ctx.get(), output, &actual_out_len, out_len);
181
182 ASSERT_TRUE(actual_out_len == out_len);
183 ASSERT_TRUE(Compare(output, kNistKnown[known_index], out_len));
184 }
185 }
186 }
187}
diff --git a/nss/gtests/freebl_gtest/freebl_gtest.gyp b/nss/gtests/freebl_gtest/freebl_gtest.gyp
index 238f05e..c19db41 100644
--- a/nss/gtests/freebl_gtest/freebl_gtest.gyp
+++ b/nss/gtests/freebl_gtest/freebl_gtest.gyp
@@ -23,6 +23,7 @@
23 '<(DEPTH)/lib/dev/dev.gyp:nssdev',23 '<(DEPTH)/lib/dev/dev.gyp:nssdev',
24 '<(DEPTH)/lib/pki/pki.gyp:nsspki',24 '<(DEPTH)/lib/pki/pki.gyp:nsspki',
25 '<(DEPTH)/lib/ssl/ssl.gyp:ssl',25 '<(DEPTH)/lib/ssl/ssl.gyp:ssl',
26 '<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
26 ],27 ],
27 },28 },
28 {29 {
@@ -34,6 +35,7 @@
34 'ecl_unittest.cc',35 'ecl_unittest.cc',
35 'ghash_unittest.cc',36 'ghash_unittest.cc',
36 'rsa_unittest.cc',37 'rsa_unittest.cc',
38 'cmac_unittests.cc',
37 '<(DEPTH)/gtests/common/gtests.cc'39 '<(DEPTH)/gtests/common/gtests.cc'
38 ],40 ],
39 'dependencies': [41 'dependencies': [
diff --git a/nss/gtests/freebl_gtest/mpi_unittest.cc b/nss/gtests/freebl_gtest/mpi_unittest.cc
index fbc27d0..56b7454 100644
--- a/nss/gtests/freebl_gtest/mpi_unittest.cc
+++ b/nss/gtests/freebl_gtest/mpi_unittest.cc
@@ -290,4 +290,4 @@ TEST_F(DISABLED_MPITest, MpiCmpConstTest) {
290 mp_clear(&c);290 mp_clear(&c);
291}291}
292292
293} // nss_test293} // namespace nss_test
diff --git a/nss/gtests/mozpkix_gtest/mozpkix_gtest.gyp b/nss/gtests/mozpkix_gtest/mozpkix_gtest.gyp
index 899b849..1623d76 100644
--- a/nss/gtests/mozpkix_gtest/mozpkix_gtest.gyp
+++ b/nss/gtests/mozpkix_gtest/mozpkix_gtest.gyp
@@ -43,6 +43,7 @@
43 '<(DEPTH)/lib/base/base.gyp:nssb',43 '<(DEPTH)/lib/base/base.gyp:nssb',
44 '<(DEPTH)/lib/dev/dev.gyp:nssdev',44 '<(DEPTH)/lib/dev/dev.gyp:nssdev',
45 '<(DEPTH)/lib/pki/pki.gyp:nsspki',45 '<(DEPTH)/lib/pki/pki.gyp:nsspki',
46 '<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
46 '<(DEPTH)/lib/mozpkix/mozpkix.gyp:mozpkix',47 '<(DEPTH)/lib/mozpkix/mozpkix.gyp:mozpkix',
47 '<(DEPTH)/lib/mozpkix/mozpkix.gyp:mozpkix-testlib',48 '<(DEPTH)/lib/mozpkix/mozpkix.gyp:mozpkix-testlib',
48 ],49 ],
diff --git a/nss/gtests/mozpkix_gtest/pkixder_input_tests.cpp b/nss/gtests/mozpkix_gtest/pkixder_input_tests.cpp
index e70f795..c66f06e 100644
--- a/nss/gtests/mozpkix_gtest/pkixder_input_tests.cpp
+++ b/nss/gtests/mozpkix_gtest/pkixder_input_tests.cpp
@@ -191,8 +191,10 @@ TEST_F(pkixder_input_tests, ReadByteWrapAroundPointer)
191 // a null pointer is undefined behavior according to the C++ language spec.,191 // a null pointer is undefined behavior according to the C++ language spec.,
192 // but this should catch the problem on at least some compilers, if not all of192 // but this should catch the problem on at least some compilers, if not all of
193 // them.193 // them.
194 const uint8_t* der = nullptr;194 uintptr_t derint = -1;
195 --der;195 auto der = reinterpret_cast<const uint8_t*>(derint);
196 ASSERT_EQ(sizeof(der), sizeof(derint))
197 << "underflow of pointer might not work";
196 Input buf;198 Input buf;
197 ASSERT_EQ(Success, buf.Init(der, 0));199 ASSERT_EQ(Success, buf.Init(der, 0));
198 Reader input(buf);200 Reader input(buf);
diff --git a/nss/gtests/mozpkix_gtest/pkixder_universal_types_tests.cpp b/nss/gtests/mozpkix_gtest/pkixder_universal_types_tests.cpp
index 260c735..0dc8555 100644
--- a/nss/gtests/mozpkix_gtest/pkixder_universal_types_tests.cpp
+++ b/nss/gtests/mozpkix_gtest/pkixder_universal_types_tests.cpp
@@ -1224,3 +1224,53 @@ TEST_F(pkixder_universal_types_tests, OID)
12241224
1225 ASSERT_EQ(Success, OID(reader, expectedOID));1225 ASSERT_EQ(Success, OID(reader, expectedOID));
1226}1226}
1227
1228TEST_F(pkixder_universal_types_tests, SkipOptionalImplicitPrimitiveTag)
1229{
1230 const uint8_t DER_IMPLICIT_BIT_STRING_WITH_CLASS_NUMBER_1[] = {
1231 0x81,
1232 0x04,
1233 0x00,
1234 0x0A,
1235 0x0B,
1236 0x0C,
1237 };
1238 Input input(DER_IMPLICIT_BIT_STRING_WITH_CLASS_NUMBER_1);
1239 Reader reader(input);
1240
1241 ASSERT_EQ(Success, SkipOptionalImplicitPrimitiveTag(reader, 1));
1242 ASSERT_TRUE(reader.AtEnd());
1243}
1244
1245TEST_F(pkixder_universal_types_tests, SkipOptionalImplicitPrimitiveTagMismatch)
1246{
1247 const uint8_t DER_IMPLICIT_BIT_STRING_WITH_CLASS_NUMBER_1[] = {
1248 0x81,
1249 0x04,
1250 0x00,
1251 0x0A,
1252 0x0B,
1253 0x0C,
1254 };
1255 Input input(DER_IMPLICIT_BIT_STRING_WITH_CLASS_NUMBER_1);
1256 Reader reader(input);
1257
1258 ASSERT_EQ(Success, SkipOptionalImplicitPrimitiveTag(reader, 2));
1259 ASSERT_FALSE(reader.AtEnd());
1260}
1261
1262TEST_F(pkixder_universal_types_tests, NoSkipOptionalImplicitConstructedTag)
1263{
1264 const uint8_t DER_IMPLICIT_SEQUENCE_WITH_CLASS_NUMBER_1[] = {
1265 0xA1,
1266 0x03,
1267 0x05,
1268 0x01,
1269 0x00,
1270 };
1271 Input input(DER_IMPLICIT_SEQUENCE_WITH_CLASS_NUMBER_1);
1272 Reader reader(input);
1273
1274 ASSERT_EQ(Success, SkipOptionalImplicitPrimitiveTag(reader, 1));
1275 ASSERT_FALSE(reader.AtEnd());
1276}
diff --git a/nss/gtests/pk11_gtest/manifest.mn b/nss/gtests/pk11_gtest/manifest.mn
index b774f1d..861f45f 100644
--- a/nss/gtests/pk11_gtest/manifest.mn
+++ b/nss/gtests/pk11_gtest/manifest.mn
@@ -9,20 +9,24 @@ MODULE = nss
9CPPSRCS = \9CPPSRCS = \
10 pk11_aes_gcm_unittest.cc \10 pk11_aes_gcm_unittest.cc \
11 pk11_aeskeywrap_unittest.cc \11 pk11_aeskeywrap_unittest.cc \
12 pk11_aeskeywrappad_unittest.cc \
12 pk11_cbc_unittest.cc \13 pk11_cbc_unittest.cc \
13 pk11_chacha20poly1305_unittest.cc \14 pk11_chacha20poly1305_unittest.cc \
14 pk11_curve25519_unittest.cc \15 pk11_curve25519_unittest.cc \
16 pk11_der_private_key_import_unittest.cc \
15 pk11_ecdsa_unittest.cc \17 pk11_ecdsa_unittest.cc \
16 pk11_encrypt_derive_unittest.cc \18 pk11_encrypt_derive_unittest.cc \
17 pk11_export_unittest.cc \19 pk11_export_unittest.cc \
18 pk11_find_certs_unittest.cc \20 pk11_find_certs_unittest.cc \
19 pk11_import_unittest.cc \21 pk11_import_unittest.cc \
22 pk11_keygen.cc \
23 pk11_key_unittest.cc \
20 pk11_pbkdf2_unittest.cc \24 pk11_pbkdf2_unittest.cc \
21 pk11_prf_unittest.cc \25 pk11_prf_unittest.cc \
22 pk11_prng_unittest.cc \26 pk11_prng_unittest.cc \
23 pk11_rsapkcs1_unittest.cc \27 pk11_rsapkcs1_unittest.cc \
24 pk11_rsapss_unittest.cc \28 pk11_rsapss_unittest.cc \
25 pk11_der_private_key_import_unittest.cc \29 pk11_seed_cbc_unittest.cc \
26 $(NULL)30 $(NULL)
2731
28INCLUDES += -I$(CORE_DEPTH)/gtests/google_test/gtest/include \32INCLUDES += -I$(CORE_DEPTH)/gtests/google_test/gtest/include \
diff --git a/nss/gtests/pk11_gtest/pk11_aes_cmac_unittest.cc b/nss/gtests/pk11_gtest/pk11_aes_cmac_unittest.cc
29new file mode 10064433new file mode 100644
index 0000000..c520fff
--- /dev/null
+++ b/nss/gtests/pk11_gtest/pk11_aes_cmac_unittest.cc
@@ -0,0 +1,91 @@
1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set ts=2 et sw=2 tw=80: */
3/* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7#include <memory>
8#include "nss.h"
9#include "pk11pub.h"
10#include "secerr.h"
11#include "sechash.h"
12
13#include "blapi.h"
14
15#include "gtest/gtest.h"
16#include "nss_scoped_ptrs.h"
17#include "util.h"
18
19namespace nss_test {
20
21class Pkcs11AesCmacTest : public ::testing::Test {
22 protected:
23 ScopedPK11SymKey ImportKey(CK_MECHANISM_TYPE mech, SECItem *key_item) {
24 ScopedPK11SlotInfo slot(PK11_GetInternalSlot());
25 if (!slot) {
26 ADD_FAILURE() << "Can't get slot";
27 return nullptr;
28 }
29
30 ScopedPK11SymKey result(PK11_ImportSymKey(
31 slot.get(), mech, PK11_OriginUnwrap, CKA_SIGN, key_item, nullptr));
32
33 return result;
34 }
35
36 void RunTest(uint8_t *key, unsigned int key_len, uint8_t *data,
37 unsigned int data_len, uint8_t *expected,
38 unsigned int expected_len, CK_ULONG mechanism) {
39 // Create SECItems for everything...
40 std::vector<uint8_t> output(expected_len);
41 SECItem key_item = {siBuffer, key, key_len};
42 SECItem output_item = {siBuffer, output.data(), expected_len};
43 SECItem data_item = {siBuffer, data, data_len};
44 SECItem expected_item = {siBuffer, expected, expected_len};
45
46 // Do the PKCS #11 stuff...
47 ScopedPK11SymKey p11_key = ImportKey(mechanism, &key_item);
48 ASSERT_NE(nullptr, p11_key.get());
49
50 SECStatus ret = PK11_SignWithSymKey(p11_key.get(), CKM_AES_CMAC, NULL,
51 &output_item, &data_item);
52
53 // Verify the result...
54 ASSERT_EQ(SECSuccess, ret);
55 ASSERT_EQ(0, SECITEM_CompareItem(&output_item, &expected_item));
56 }
57};
58
59// Sanity check of the PKCS #11 API only. Extensive tests for correctness of
60// underling CMAC implementation conducted in the following file:
61// gtests/freebl_gtest/cmac_unittests.cc
62
63TEST_F(Pkcs11AesCmacTest, Aes128NistExample1) {
64 uint8_t key[AES_128_KEY_LENGTH] = {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE,
65 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88,
66 0x09, 0xCF, 0x4F, 0x3C};
67 uint8_t known[AES_BLOCK_SIZE] = {0xBB, 0x1D, 0x69, 0x29, 0xE9, 0x59,
68 0x37, 0x28, 0x7F, 0xA3, 0x7D, 0x12,
69 0x9B, 0x75, 0x67, 0x46};
70
71 RunTest(key, AES_128_KEY_LENGTH, NULL, 0, known, AES_BLOCK_SIZE,
72 CKM_AES_CMAC);
73}
74
75TEST_F(Pkcs11AesCmacTest, General) {
76 uint8_t key[AES_128_KEY_LENGTH] = {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE,
77 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88,
78 0x09, 0xCF, 0x4F, 0x3C};
79 uint8_t known[4] = {0xBB, 0x1D, 0x69, 0x29};
80
81 RunTest(key, AES_128_KEY_LENGTH, NULL, 0, known, 4, CKM_AES_CMAC_GENERAL);
82}
83
84TEST_F(Pkcs11AesCmacTest, InvalidKeySize) {
85 uint8_t key[4] = {0x00, 0x00, 0x00, 0x00};
86 SECItem key_item = {siBuffer, key, 4};
87
88 ScopedPK11SymKey result = ImportKey(CKM_AES_CMAC, &key_item);
89 ASSERT_EQ(nullptr, result.get());
90}
91}
diff --git a/nss/gtests/pk11_gtest/pk11_aes_gcm_unittest.cc b/nss/gtests/pk11_gtest/pk11_aes_gcm_unittest.cc
index 9505b43..2c58063 100644
--- a/nss/gtests/pk11_gtest/pk11_aes_gcm_unittest.cc
+++ b/nss/gtests/pk11_gtest/pk11_aes_gcm_unittest.cc
@@ -37,47 +37,57 @@ class Pkcs11AesGcmTest : public ::testing::TestWithParam<gcm_kat_value> {
37 }37 }
3838
39 // Prepare AEAD params.39 // Prepare AEAD params.
40 CK_GCM_PARAMS gcmParams;40 CK_GCM_PARAMS gcm_params;
41 gcmParams.pIv = iv.data();41 gcm_params.pIv = iv.data();
42 gcmParams.ulIvLen = iv.size();42 gcm_params.ulIvLen = iv.size();
43 gcmParams.pAAD = aad.data();43 gcm_params.pAAD = aad.data();
44 gcmParams.ulAADLen = aad.size();44 gcm_params.ulAADLen = aad.size();
45 gcmParams.ulTagBits = 128;45 gcm_params.ulTagBits = 128;
4646
47 SECItem params = {siBuffer, reinterpret_cast<unsigned char*>(&gcmParams),47 SECItem params = {siBuffer, reinterpret_cast<unsigned char*>(&gcm_params),
48 sizeof(gcmParams)};48 sizeof(gcm_params)};
4949
50 ScopedPK11SlotInfo slot(PK11_GetInternalSlot());50 ScopedPK11SlotInfo slot(PK11_GetInternalSlot());
51 SECItem keyItem = {siBuffer, key.data(),51 SECItem key_item = {siBuffer, key.data(),
52 static_cast<unsigned int>(key.size())};52 static_cast<unsigned int>(key.size())};
5353
54 // Import key.54 // Import key.
55 ScopedPK11SymKey symKey(PK11_ImportSymKey(55 ScopedPK11SymKey sym_key(PK11_ImportSymKey(
56 slot.get(), mech, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr));56 slot.get(), mech, PK11_OriginUnwrap, CKA_ENCRYPT, &key_item, nullptr));
57 ASSERT_TRUE(!!symKey) << msg;57 ASSERT_TRUE(!!sym_key) << msg;
5858
59 // Encrypt with bogus parameters.59 // Encrypt with bogus parameters.
60 unsigned int outputLen = 0;60 unsigned int output_len = 0;
61 std::vector<uint8_t> output(plaintext.size() + gcmParams.ulTagBits / 8);61 std::vector<uint8_t> output(plaintext.size() + gcm_params.ulTagBits / 8);
62 gcmParams.ulTagBits = 159082344;62 // "maxout" must be at least "inlen + tagBytes", or, in this case:
63 // "output.size()" must be at least "plaintext.size() + tagBytes"
64 gcm_params.ulTagBits = 128;
63 SECStatus rv =65 SECStatus rv =
64 PK11_Encrypt(symKey.get(), mech, &params, output.data(), &outputLen,66 PK11_Encrypt(sym_key.get(), mech, &params, output.data(), &output_len,
65 output.size(), plaintext.data(), plaintext.size());67 output.size() - 10, plaintext.data(), plaintext.size());
66 EXPECT_EQ(SECFailure, rv);68 EXPECT_EQ(SECFailure, rv);
67 EXPECT_EQ(0U, outputLen);69 EXPECT_EQ(0U, output_len);
68 gcmParams.ulTagBits = 128;70
71 // The valid values for tag size in AES_GCM are:
72 // 32, 64, 96, 104, 112, 120 and 128.
73 gcm_params.ulTagBits = 110;
74 rv = PK11_Encrypt(sym_key.get(), mech, &params, output.data(), &output_len,
75 output.size(), plaintext.data(), plaintext.size());
76 EXPECT_EQ(SECFailure, rv);
77 EXPECT_EQ(0U, output_len);
6978
70 // Encrypt.79 // Encrypt.
71 rv = PK11_Encrypt(symKey.get(), mech, &params, output.data(), &outputLen,80 gcm_params.ulTagBits = 128;
81 rv = PK11_Encrypt(sym_key.get(), mech, &params, output.data(), &output_len,
72 output.size(), plaintext.data(), plaintext.size());82 output.size(), plaintext.data(), plaintext.size());
73 if (invalid_iv) {83 if (invalid_iv) {
74 EXPECT_EQ(rv, SECFailure) << msg;84 EXPECT_EQ(SECFailure, rv) << msg;
75 EXPECT_EQ(0U, outputLen);85 EXPECT_EQ(0U, output_len);
76 return;86 return;
77 }87 }
78 EXPECT_EQ(rv, SECSuccess) << msg;88 EXPECT_EQ(SECSuccess, rv) << msg;
7989
80 ASSERT_EQ(outputLen, output.size()) << msg;90 ASSERT_EQ(output_len, output.size()) << msg;
8191
82 // Check ciphertext and tag.92 // Check ciphertext and tag.
83 if (invalid_ct) {93 if (invalid_ct) {
@@ -87,48 +97,49 @@ class Pkcs11AesGcmTest : public ::testing::TestWithParam<gcm_kat_value> {
87 }97 }
8898
89 // Decrypt.99 // Decrypt.
90 unsigned int decryptedLen = 0;100 unsigned int decrypted_len = 0;
91 // The PK11 AES API is stupid, it expects an explicit IV and thus wants101 // The PK11 AES API is stupid, it expects an explicit IV and thus wants
92 // a block more of available output memory.102 // a block more of available output memory.
93 std::vector<uint8_t> decrypted(output.size());103 std::vector<uint8_t> decrypted(output.size());
94 rv =104 rv = PK11_Decrypt(sym_key.get(), mech, &params, decrypted.data(),
95 PK11_Decrypt(symKey.get(), mech, &params, decrypted.data(),105 &decrypted_len, decrypted.size(), output.data(),
96 &decryptedLen, decrypted.size(), output.data(), outputLen);106 output_len);
97 EXPECT_EQ(rv, SECSuccess) << msg;
98 ASSERT_EQ(decryptedLen, plaintext.size()) << msg;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches