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
1diff --git a/debian/changelog b/debian/changelog
2index 27fda7e..7e08155 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,24 @@
6+<<<<<<< debian/changelog
7+=======
8+nss (2:3.47-1ubuntu1) focal; urgency=medium
9+
10+ * Merge with Debian unstable. Remaining changes:
11+ - d/libnss3.links: make freebl3 available as library (LP #1744328)
12+ - d/control: add dh-exec to Build-Depends
13+ - d/rules: make mkdir tolerate debian/tmp existing (due to dh-exec)
14+ - Disable reading fips_enabled flag in FIPS mode. libnss is
15+ not a FIPS certified library. (LP #1837734)
16+
17+ -- Lucas Kanashiro <lucas.kanashiro@canonical.com> Thu, 31 Oct 2019 16:18:35 -0300
18+
19+nss (2:3.47-1) unstable; urgency=medium
20+
21+ * New upstream release.
22+ * debian/libnss3.symbols: Add NSS_3_47 symbol version.
23+
24+ -- Mike Hommey <glandium@debian.org> Wed, 23 Oct 2019 11:19:59 +0900
25+
26+>>>>>>> debian/changelog
27 nss (2:3.45-1ubuntu2) eoan; urgency=medium
28
29 * Disable reading fips_enabled flag in FIPS mode. libnss is
30diff --git a/debian/libnss3.symbols b/debian/libnss3.symbols
31index e4da3e8..4bc778e 100644
32--- a/debian/libnss3.symbols
33+++ b/debian/libnss3.symbols
34@@ -59,6 +59,7 @@ libnss3.so libnss3 #MINVER#
35 (symver)NSS_3.43 2:3.44.0
36 (symver)NSS_3.44 2:3.44.0
37 (symver)NSS_3.45 2:3.45
38+ (symver)NSS_3.47 2:3.47
39 (symver)NSS_3.5 2:3.13.4-2~
40 (symver)NSS_3.6 2:3.13.4-2~
41 (symver)NSS_3.7 2:3.13.4-2~
42diff --git a/nss/.hg_archival.txt b/nss/.hg_archival.txt
43index 7c3f115..032d2c2 100644
44--- a/nss/.hg_archival.txt
45+++ b/nss/.hg_archival.txt
46@@ -1,4 +1,4 @@
47 repo: 9949429068caa6bb8827a8ceeaa7c605d722f47f
48-node: 93ad9d963f4c773ea210b20af50198331ccd8639
49-branch: NSS_3_45_BRANCH
50-tag: NSS_3_45_RTM
51+node: 7ccb4ade557739620b060c173d8660c502e53034
52+branch: NSS_3_47_BRANCH
53+tag: NSS_3_47_RTM
54diff --git a/nss/.taskcluster.yml b/nss/.taskcluster.yml
55index 4d5117e..05bade9 100644
56--- a/nss/.taskcluster.yml
57+++ b/nss/.taskcluster.yml
58@@ -55,7 +55,7 @@ tasks:
59 image: djmitche/nss-decision:0.0.3
60
61 env:
62- TC_OWNER: "${push.owner}"
63+ TC_OWNER: "${ownerEmail}"
64 TC_SOURCE: "${repository.url}"
65 TC_PROJECT: ${repository.project}
66 TC_SCHEDULER_ID: "${schedulerId}"
67diff --git a/nss/Makefile b/nss/Makefile
68index 4a80ebd..2dc8de1 100644
69--- a/nss/Makefile
70+++ b/nss/Makefile
71@@ -135,6 +135,7 @@ endif
72
73 build_nspr: $(NSPR_CONFIG_STATUS)
74 $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
75+ $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)/pr/tests
76
77 install_nspr: build_nspr
78 $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) install
79diff --git a/nss/automation/abi-check/expected-report-libnss3.so.txt b/nss/automation/abi-check/expected-report-libnss3.so.txt
80index 76d0de6..ee06510 100644
81--- a/nss/automation/abi-check/expected-report-libnss3.so.txt
82+++ b/nss/automation/abi-check/expected-report-libnss3.so.txt
83@@ -1,4 +1,33 @@
84-
85 1 Added function:
86
87- 'function SECStatus PK11_FindRawCertsWithSubject(PK11SlotInfo*, SECItem*, CERTCertificateList**)' {PK11_FindRawCertsWithSubject@@NSS_3.45}
88+ 'function CERTCertList* PK11_GetCertsMatchingPrivateKey(SECKEYPrivateKey*)' {PK11_GetCertsMatchingPrivateKey@@NSS_3.47}
89+
90+3 functions with some indirect sub-type change:
91+
92+ [C]'function SECStatus CERT_AddCertToListHead(CERTCertList*, CERTCertificate*)' at certdb.c:2631:1 has some indirect sub-type changes:
93+ parameter 2 of type 'CERTCertificate*' has sub-type changes:
94+ in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
95+ underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
96+ type size changed from 6016 to 6080 (in bits)
97+ 1 data member insertion:
98+ 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
99+ no data member changes (2 filtered);
100+
101+ [C]'function SECStatus CERT_CacheOCSPResponseFromSideChannel(CERTCertDBHandle*, CERTCertificate*, PRTime, const SECItem*, void*)' at ocsp.c:5102:1 has some indirect sub-type changes:
102+ parameter 2 of type 'CERTCertificate*' has sub-type changes:
103+ in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
104+ underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
105+ type size changed from 6016 to 6080 (in bits)
106+ 1 data member insertion:
107+ 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
108+ no data member change (1 filtered);
109+
110+ [C]'function CERTCertificateList* CERT_CertChainFromCert(CERTCertificate*, SECCertUsage, PRBool)' at certhigh.c:1030:1 has some indirect sub-type changes:
111+ parameter 1 of type 'CERTCertificate*' has sub-type changes:
112+ in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
113+ underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
114+ type size changed from 6016 to 6080 (in bits)
115+ 1 data member insertion:
116+ 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
117+ no data member changes (2 filtered);
118+
119diff --git a/nss/automation/abi-check/expected-report-libsmime3.so.txt b/nss/automation/abi-check/expected-report-libsmime3.so.txt
120index e69de29..b57a98a 100644
121--- a/nss/automation/abi-check/expected-report-libsmime3.so.txt
122+++ b/nss/automation/abi-check/expected-report-libsmime3.so.txt
123@@ -0,0 +1,11 @@
124+1 function with some indirect sub-type change:
125+
126+ [C]'function CERTCertificate* CERT_ConvertAndDecodeCertificate(char*)' at certread.c:219:1 has some indirect sub-type changes:
127+ return type changed:
128+ in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
129+ underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
130+ type size changed from 6016 to 6080 (in bits)
131+ 1 data member insertion:
132+ 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
133+
134+
135diff --git a/nss/automation/abi-check/expected-report-libssl3.so.txt b/nss/automation/abi-check/expected-report-libssl3.so.txt
136index 9f2f796..2c3aff4 100644
137--- a/nss/automation/abi-check/expected-report-libssl3.so.txt
138+++ b/nss/automation/abi-check/expected-report-libssl3.so.txt
139@@ -1,22 +1,10 @@
140+1 function with some indirect sub-type change:
141
142-2 functions with some indirect sub-type change:
143-
144- [C]'function SECStatus SSL_ConfigServerCert(PRFileDesc*, CERTCertificate*, SECKEYPrivateKey*, const SSLExtraServerCertData*, unsigned int)' at sslcert.c:640:1 has some indirect sub-type changes:
145- parameter 4 of type 'const SSLExtraServerCertData*' has sub-type changes:
146- in pointed to type 'const SSLExtraServerCertData':
147- in unqualified underlying type 'typedef SSLExtraServerCertData' at sslt.h:291:1:
148- underlying type 'struct SSLExtraServerCertDataStr' at sslt.h:256:1 changed:
149- type size changed from 256 to 384 (in bits)
150- 2 data member insertions:
151- 'const SECItem* SSLExtraServerCertDataStr::delegCred', at offset 256 (in bits) at sslt.h:283:1
152- 'const SECKEYPrivateKey* SSLExtraServerCertDataStr::delegCredPrivKey', at offset 320 (in bits) at sslt.h:290:1
153-
154- [C]'function SECStatus SSL_GetChannelInfo(PRFileDesc*, SSLChannelInfo*, PRUintn)' at sslinfo.c:13:1 has some indirect sub-type changes:
155- parameter 2 of type 'SSLChannelInfo*' has sub-type changes:
156- in pointed to type 'typedef SSLChannelInfo' at sslt.h:357:1:
157- underlying type 'struct SSLChannelInfoStr' at sslt.h:272:1 changed:
158- type size hasn't changed
159+ [C]'function SECStatus NSS_CmpCertChainWCANames(CERTCertificate*, CERTDistNames*)' at cmpcert.c:25:1 has some indirect sub-type changes:
160+ parameter 1 of type 'CERTCertificate*' has sub-type changes:
161+ in pointed to type 'typedef CERTCertificate' at certt.h:39:1:
162+ underlying type 'struct CERTCertificateStr' at certt.h:189:1 changed:
163+ type size changed from 6016 to 6080 (in bits)
164 1 data member insertion:
165- 'PRBool SSLChannelInfoStr::peerDelegCred', at offset 928 (in bits) at sslt.h:353:1
166-
167+ 'CERTCertDistrust* CERTCertificateStr::distrust', at offset 6016 (in bits) at certt.h:296:1
168
169diff --git a/nss/automation/abi-check/previous-nss-release b/nss/automation/abi-check/previous-nss-release
170index c6d6c97..3215111 100644
171--- a/nss/automation/abi-check/previous-nss-release
172+++ b/nss/automation/abi-check/previous-nss-release
173@@ -1 +1 @@
174-NSS_3_44_BRANCH
175+NSS_3_46_BRANCH
176diff --git a/nss/automation/release/nspr-version.txt b/nss/automation/release/nspr-version.txt
177index b91871c..7ae4833 100644
178--- a/nss/automation/release/nspr-version.txt
179+++ b/nss/automation/release/nspr-version.txt
180@@ -1,4 +1,4 @@
181-4.21
182+4.23
183
184 # The first line of this file must contain the human readable NSPR
185 # version number, which is the minimum required version of NSPR
186diff --git a/nss/automation/taskcluster/docker-gcc-4.4/Dockerfile b/nss/automation/taskcluster/docker-gcc-4.4/Dockerfile
187index 6953832..55344e5 100644
188--- a/nss/automation/taskcluster/docker-gcc-4.4/Dockerfile
189+++ b/nss/automation/taskcluster/docker-gcc-4.4/Dockerfile
190@@ -9,6 +9,7 @@ RUN apt-get update \
191 gcc-4.4 \
192 locales \
193 make \
194+ patch \
195 mercurial \
196 zlib1g-dev \
197 && rm -rf /var/lib/apt/lists/* \
198diff --git a/nss/automation/taskcluster/docker-hacl/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc b/nss/automation/taskcluster/docker-hacl/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc
199new file mode 100644
200index 0000000..513dcd4
201--- /dev/null
202+++ b/nss/automation/taskcluster/docker-hacl/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc
203@@ -0,0 +1,143 @@
204+-----BEGIN PGP PUBLIC KEY BLOCK-----
205+
206+mQINBFS+1SABEACnmkESkY7eZq0GhDjbkWpKmURGk9+ycsfAhA44NqUvf4tk1GPM
207+5SkJ/fYedYZJaDVhIp98fHgucD0O+vjOzghtgwtITusYjiPHPFBd/MN+MQqSEAP+
208+LUa/kjHLjgyXxKhFUIDGVaDWL5tKOA7/AQKl1TyJ8lz89NHQoUHFsF/hu10+qhJe
209+V65d32MXFehIUSvegh8DrPuExrliSiORO4HOhuc6151dWA4YBWVg4rX5kfKrGMMT
210+pTWnSSZtgoRhkKW2Ey8cmZUqPuUJIfWyeNVu1e4SFtAivLvu/Ymz2WBJcNA1ZlTr
211+RCOR5SIRgZ453pQnI/Bzna2nnJ/TV1gGJIGRahj/ini0cs2x1CILfS/YJQ3rWGGo
212+OxwG0BVmPk0cmLVtyTq8gUPwxcPUd6WcBKhot3TDMlrffZACnQwQjlVjk5S1dEEz
213+atUfpEuNitU9WOM4jr/gjv36ZNCOWm95YwLhsuci/NddBN8HXhyvs+zYTVZEXa2W
214+l/FqOdQsQqZBcJjjWckGKhESdd7934+cesGD3O8KaeSGxww7slJrS0+6QJ8oBoAB
215+P/WCn/y2AiY2syEKp3wYIGJyAbsm542zMZ4nc7pYfSu49mcyhQQICmqN5QvOyYUx
216+OSqwbAOUNtlOyeRLZNIKoXtTqWDEu5aEiDROTw6Rkq+dIcxPNgOLdeQ3HwARAQAB
217+tCFIYW5zIFdlbm5ib3JnIDxoYW5zQGNocm9taXVtLm9yZz6JARwEEAECAAYFAlT2
218+MQAACgkQVfXNcLtaBWnDKgf/fjusXk+kh1zuyn5eOCe16+2vV1lmXZrDIGdJtXDW
219+ZtHKele1Yv1BA3kUi5tKQi+VOOrvHL0+TMjFWFiCy1sYJS9qgkS08kReI2nAnhZ7
220+INdqEVxtVk1TTOhtYjOPy6txwujoICuPv5F4rHVhn1LPKGTLtYD2LOwf/8eKYQox
221+51gaJ8dNxpcHE/iFOIDXdebJPufo3EhqDRihchxb8AVLhrNss7pGGG/tVfichmHK
222+djPT2KfSh14pq1ahFOz0zH4nmTu7CCLnLAdRBHuhL8HVDbi0vKBtCiSmQggdxvoj
223+u+hpXiiDFQoCjLh0zVCwtFqWDZbnKMTBNNF26aTmQ+2fiYkBMwQQAQgAHRYhBB/m
224+NI7eqCWiKXDlxI3TBA8SPMP0BQJbcLU1AAoJEI3TBA8SPMP021sH/jD1m7azNCN6
225+DVL1iDJT6uIIYCTylygH5XI46CRoWaz/LwdFnUqWHHTcQxJ5pIkWV9KF+SIgMT42
226+brdZZmNvvSdX0odjFKqj5UR6w+wDN+uZ6Q40zu4pNoNzbk7pRpbFf1XIfGB1liyu
227+m28EJ58IXu/0AV7FiDAHGGBqppK/cwQN8pGLwmz1n6YELtXeFmtOGnusO6iLYOE7
228+3ByFCCqJB6twT5+7dDqFYqqQJgQ6jDTy19dDZ1vDhDttL+2Rn0OYXqPw7gy/1D2p
229+Y1cM9PgPBsR4EXhbtV0uKUNomk8tM/HnGMFT0KirI/tSwEP3v9g5YH992mrvNuIV
230+TkyQn0jGeMeJATMEEAEIAB0WIQRswFHTwdmkr54mDFjT45SsdE4uuwUCW3haCQAK
231+CRDT45SsdE4uu4JjCACppkreiMrpJSREKbUscdOvFxFRYzkTFeSCwX9Ih7r5ENpa
232+zjczfIqCCfWzioV6y4K0V04y8CXt/5S5a9vfW801pBUdF9nG4X8YbUn/xSe+8A9m
233+MsfDjMNcF7Cp5czVoSS4/4oHm9mQUMYQsn3AwwCPDKFORRRv5Eb0om9JawKtt++7
234+ZW0fOgDkvOCm14SN0UtVc4mxTx6iyxdMDgrKinBZVjxEh5oeqUyXh5TYM+XyWFVh
235+/gDUvUWwLI0GUWNTyOyUQU1oPVp+sWqrEe1BXLVCKFVWaSTtgJtJ5FyP+z2uzRcv
236+aanPOj/ohHAo8VBq9QbefYVAkShNBEuJkATnXhcGiQEzBBABCAAdFiEEvlzFWRM6
237+4JjNAb2a+j2ZL9Cqr7wFAlkBCcIACgkQ+j2ZL9Cqr7yB9AgArj+0+i0DCo1nm4MF
238+TLnW1Y9GF/Hq/mBva1MhkT0j3BzENK3xgqrqac8KqupsporNEmJ0ZbZzilJdZImb
239+o4X5BFdmmnjMiGaH6GAiPqRBBHGvLV2r2pG467J4tOMWO3XipFRf7FibbfhAU1lV
240+/GLWYTSwLqwWwBE8u5rriEvDngWUJw2Yd4Yqwduef7O6F+JfsGPRXFomR3387II0
241+8AXo/C+P5cl64llaxV6BmkJhQ6ydL0/KwSkHVdlXugk1sPtV/qOyPQ5L1Ibqbsvh
242+lLq/jhHlUUNLFjlQ2lrS9bhHGw9OIHTMJvS8RDrk0yAmoHAyRWNgbFN7aA62vBhq
243+pcUVzokBMwQQAQgAHRYhBPZ+fW6ADyQOg+vIZ/9qyaZGTfCcBQJa+ZAwAAoJEP9q
244+yaZGTfCcKMgH/jRxGfYhhGnlMnDLAEpYC+TGSDLMgmg9cOZbonqyMv+7Kts+pV03
245+KUr9SPV+VtGtOxRNiqwFt6V2MHcwPJfTXuH/bBW/HCCpr6UlOVWqIiCNK0Gnpcj5
246+rRt5unjG9CwsgyaK9QPI8bGin/c6m8BjwmEdfJ01ATLiUb8WuDHQy9OCyrEAnzSq
247+FD5ZtFmAFxvzm2x1nwb5HPuqkOqbRatp8aRJzTxIeSJPpgLw0PawHKGN3Ckp7REc
248+g26P1spkPe7SIVRsobH3al4uw7mgs7wiDWN3t8CdmuHAzmB2UrsR84JMTb45GboO
249+Bc1CX8xZcHyNaDEpyWHav+P8nZqwfBm+cLiJAjMEEAEIAB0WIQSawVDb4dGOtiX0
250++gWyD0lU8+/LPwUCW/4O9QAKCRCyD0lU8+/LPyI7EACWtj0GEb1VT02gKwtKwgFn
251+RJ2pz8vYm188wgJwCJaL04d2D/VwE0jMvmfH80hSKgSLPAVMG06RIOb/tGhHsQKU
252+zBlHiAFmfjlJo1FC/Mp44RrERRsFAWBg0/URIs4vP8+5Vl+5m70sZrQpKeq+6TLM
253+1dQ0Ohz+QkQ04Z+DTroChWU8/7Uw0E3CqGGKYqPvDh54T1q4s8FoN0no8ZUlt/O+
254+r/3c7awr85ZnxqtnHIcuMbVyIZ+gOqXdrLa85yZITsh4zQrjYuyTEg7dpziReyiZ
255++rkpdIdFKl8YeD+d0JWzVm7kq9D4K3+x9C509z0IgJUT3bhsX/N0Yf/QUtUW5oxI
256+T7fod86B/Q2M7zBTttFhd1vAjiSjEalK48SjTzWqTDYVIkea1+f1kZK5A0QlthqG
257+P2zy5GUjZVzOiCSOhyEOvAorU3zKD2s84VFKlayZEqlHJh8u5U59TWBdkW3qZUJd
258+ewW31xt0s8IovYSgOwX3wbsClQs6eVwNuCZT2yQAgAyXA5iFztBvDRQ0qmetvzV2
259+Ay9SrjvkQ3qr/eZmbMErEwEUxIO4b1rctCQ6jcbyVxMTAZAfaDoVKWEMXNiF2KSw
260+F9SSzGPIZDgiEXUlgaJBlUIYSFxrPuE+da0CM5RixyYIinU6AER6crl9C4C9XL6a
261+u3jf+5MTGxviRGn2oQzSCYkCMwQQAQgAHRYhBKeHFU4z7cw4HFbYuaxFYRTTj42I
262+BQJboq6kAAoJEKxFYRTTj42IWIAP/3rc9GjDTM4nI6Oi4OzLkwm/I2Vr7LUKG8oX
263+8E4Nj3amvNGupzGySjB+vrM6APrMSScXunvM0f19LV84EnNrUQ3KFZcSC6r5WC0B
264+2+TVRYGpY+6R9AQpqnuxicW0sa/AlV9WSEb4fDavCel2nW0arH4wkkCzTThUxoBB
265+X4I9nf4ZzGoUnnDAwTD9rN0gpI6Td/7faa3t99dRLb6AHJ1KhvyiiV3lr0xtTssD
266+xVHo0SpzQTnOcRJnYf/2rTny8bVfROPWieh6HuEiP7SxT1HyeTr4WSAjSCoG95O2
267+b3OgSMl0Z82FRMoJYmxID/V5YqH7015SjCxKdYhEZVp9YwWruEJIH8r6MGbWYNAl
268+REnyDvfGzAF0L0+gAUymDRmtp1jeXLo+HmLgVEUWegafs1TPfCWS/H9n10Upjmuq
269+akituzacz6Kjleq9qbnl81Xmh4AKmOILRwE7Pmcbl8HATOrmi5EaKffjMdWFzOWh
270+3U4/VsNDujqSTXD88EjGcpLiIiYefGy0sURJbIMTkfXVt3ruHLyuvhsRE/2QEAi7
271+gWB0zuBV8iGBaag+6RQkxGdpemPiogzuDijqZHoUXlp7Q6IYLanXeweyivdrSyTB
272+4HOECDbWEPZwk6tCxnuklW5iJndxBmxjSxefIMGU7G2JS9quppCVFCrKUjIWnf7b
273+gXnNji5JiQIzBBABCAAdFiEExZuSbLy7rtFhdiOuHt8NuZ2LeoQFAluirpUACgkQ
274+Ht8NuZ2LeoR/gQ/6A71JxUavzyBlCXlMy2Hx2+gOfy68b8UWl7DwKTOBSoZOzPC7
275+dVCSTzoK8dRELqsp7CkFImWcEwLJWMptuH2I1nK+Ua8bvxJSMJnOlPxYE8Wz5EK3
276+SQ2mQvifRezQTe8zjdpxEDSR6xocSiigvJow4X+Mivrxxj8sMgu1KA1ud2VGX/IR
277+wMbwuBTH9YydgvzmFzTxdlJHEYmsI8koHrVWPHm//QqqPBn+qz2z9uAzDmGAiDYg
278+qtQijo5IJC8ZjxgdcTfCkN6he+GhHtOhyP/KF/FcRHY83DoNCtqexQZWGuKtbd8o
279+nQYtmemRFob5kR7GxuNdAqF74oQfXcvXZNtHSuN3VtLqkB4fzW+21JBJCsP3XCzd
280+nKjR4erXNrQycmp3shSoJbnVvdbDwaVlWhDen1DvJb0Lj2sO3PQPcwVQbf5XHWR/
281+ZCf2OQTfVgwFEB4/0Twv70XwYIui2Ry9hmTPbD4Nn+UXbMQ3SOp90tj/e2yY/MFt
282+FvcIYcJTk9LM5IsnKgh+fSWDmdS3HD5Kjv2EPUHTNalruwwfmhS+ScJwM4XqHTJY
283+JkB16j/Xv2FTF+6KlbA1zdOVycPzoFKjAENYccQBVo2B+WQac7dFDqGEVNal9z66
284+DyU4ciAHl6PsbuN7DWeuScLoqq5jwx61bZgn71mUOYC1/47ypat2BKCOXZ2JAjME
285+EgEIAB0WIQSm5op4O95BdGcqQkHwXKpE5VGK/wUCWie53AAKCRDwXKpE5VGK/3rM
286+D/9jcYKOjYaPJh3Q7wNC1HjjUa73eo5GvJqyXbsXufIh/RAYgQkD08P5JgzfXvQ0
287+zOQTtDlDTVG8VMFoBYeMJVDd0k9LBbaljxcttMPfOll+AlQGAL7iQIqTAndknkJL
288+CFdl0ypa5GVsl1tzqmNC5fuMJ3vBoRtYbMitlHQkO0vLjZ7yl9fz+7YkREpEo/d5
289+Ya8t4+L6el6lrETYaiGCTxHcbYD7VdiJxpxFQlpgl+XKtobrj70RocGQ5JwUNilC
290+nRJKUb33lbmntwDwQ1y1AjCnhB++3GHjJDXBPgYFDCSZPCndKeOXhxmB2psFf41i
291+8foJPJXuh1vWOqArdwseFCRM6W2deF1utZmROMSkUo6IC8dYlucO/hjpjhG+C8Zv
292+QiM5uLylD3IPMX9wCz1tAhMNs3v4pEPo/4A//1cdLkor9cQVLFj3+TkS888EWZdj
293+Y8mUTIXU6yL1DXcj8CfDPS29fMpDorDpK1swl4pN5qgGfsL5BSAXUf1AZDWbxnEY
294+xf5rakfHDzrfbtbTSSfrBxS8gdW2vBKM+3nL21BeP8hQ0tkLA7bn2fNGz3aCOw46
295+XeVJdBk1gVTwazspylqrh1ljr0hQEN4gs/8kM645BRdD0IyAFFcI44VmuVwd8+2g
296+5miAGmVKSqN77w2cgMRnF7xpUsanv+3zKzaTnG+2liTeCokCPgQTAQIAKAUCVL7V
297+IAIbAwUJBaOagAYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQD8MELjRa0F1m
298+RhAAj9X+/4iiQsN888dNW/H1wEFFTd/1vqb2j0sHP3t02LkEPN5Ii9u71TSD2gSD
299+WTu1Eb46nRDcapFNv5M0vXcWrEt7PK9b51Kuj4KpP5IjJHpTl2g7umaYQWC8fqcY
300+TJTH0guMSCzZlsP0xGLbAj3cG6X5OPzCO+IxEafXmE//SfS9w46n1OC57ca1Y0Fp
301+WXfjA0sJrcozgNchsptu3jg/oEteYJoxDAzNO45O4geNONq5D9PUQPb+H5Vv5zpy
302+MI7iUJhVnTOFvnoUgRS7v6pWiA3flh5FelK8tYPCzEfvxfe7EB5GO7MaJEO3ZLni
303+COaAZ3Nfn6Tt28tCOgd052W4FeGWow7iYCS1Wgd30bq/FNgnl+tKv2woxmWt4jJv
304+ioBHQ4PbUnap2RCmBFaG7llRkrKP8nhWSUdwSS3OmDwAfxTTXjPaESK9EX9OV9Xo
305+or07thq+7OMs+2cyiy2jSfIau0SELy/tVioZBhoB7hzAJUB8sGHOxMPlVDFdUr3x
306+F/cgCclWANhw2xvgPim1wQ0XpeZe6w9RpmjZR7ReMYwxn8APBDP/e9R5aLDUQAep
307+2hrJUPK38D0L69RnpWQsR9hZ2hEOrMV2M6ChlvhwHbGSdJ2CcqG5Jx4ZAP23DK3A
308+N26TB88H9F7IMrM0REZeu7KzvYwCWlpg0zMXXKQ/2vovoe2JAlUEEwECAD8CGwMG
309+CwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAFiEEtsj5goK5ROOw1cJTD8MELjRa0F0F
310+Alpd+i0FCQ8FJo0ACgkQD8MELjRa0F3X3A//dBQLm6GmXlQFjxZbukTw0lZsevFR
311+M/6ljZTxp7bsC+HFzYoaCKv6rikaWzytxk//SOaLKrB4Z9HjAlpBMtyLl2Hk7tcZ
312+bPpFafNmQ+4KgWNjLXCvt9se8BGrQvGQUrbE6YowbXa2YIgxIVEncFzIECAsp/+N
313+xbMcZN5/X1PJxKi/N22gP4nn47muN6L3pKez3CXgWnhGYSc7BuD5ALWYH7yMYUem
314+d4jlXfu5xkBIqirj1arIYC9wmF4ldbLNDPuracc8LmXcSqa5Rpao0s4iVzAD+tkX
315+vE/73m3rhepwBXxrfk0McXuI9aucf5h4/KkIBzZsaJ6JM1tzlrJzzjaBKJF9OI5T
316+jA0qTxdGzdPztS8gPaPcMkRFfh9ti0ZDx4VeF3s8sOtmMRHeGEWfxqUAbBUbwFsa
317+JDu/+8/VO4KijfcuUi8tqJ/JHeosCuGE7TM93LwJu6ZcqMYOPDROE/hsnGm0ZU92
318+xedu+07/X1ESHkSFPoaSHD5/DCNa/tXIyJZ8X7gF3eoDP5mSmrJqIqsOBR9WOVYv
319+dI8i0GHTXbrZj8WXdoS+N8wlyMLLbAS2jvTe7M5RoqbLz4ABOUUnLVoEE0CiccVZ
320+bW75BPxOfaD0szbinAeX6HDPI7St0MbKrRPjuDXjD0JVkLqFINtZfYLGMLss4tgn
321+suefr0Bo9ISwG3u5Ag0EVL7VIAEQAOxBxrQesChjrCqKjY5PnSsSYpeb4froucrC
322+898AFw2DgN/Zz+W7wtSTbtz/GRcCurjzZvN7o2rCuNk0j0+s1sgZZm2BdldlabLy
323++UF/kSW1rb5qhfXcGGubu48OMdtSfok9lOc0Q1L4HNlGE4lUBkZzmI7Ykqfl+Bwr
324+m9rpi54g4ua9PIiiHIAmMoZIcbtOG1KaDr6CoXRk/3g2ZiGUwhq3jFGroiBsKEap
325+2FJ1bh5NJk2Eg8pV7fMOF7hUQKBZrNOtIPu8hA5WEgku3U3VYjRSI3SDi6QXnDL+
326+xHxajiWpKtF3JjZh8y/CCTD8PyP34YjfZuFmkdske5cdx6H0V2UCiH453ncgFVdQ
327+DXkY4n+0MTzhy2xu0IVVnBxYDYNhi+3MjTHJd9C4xMi9t+5IuEvDAPhgfZjDpQak
328+EPz6hVmgj0mlKIgRilBRK9/kOxky9utBpGk3jEJGru/hKNloFNspoYtY6zATAr8E
329+cOgoCFQE0nIktcg3wF9+OCEnV28/a7XZwUZ7Gl/qfOHtdr374wo8kd8R3V8d2G9q
330+5w0/uCV9NNQ0fGWZDPDoYt6wnPL6gZv/nJM8oZY+u0rC24WwScZIniaryC4JHDas
331+Ahr2S2CtgCvBgslK6f3gD16KHxPZMBpX73TzOYIhMEP/vXgVJbUD6dYht+U9c4Oh
332+EDJown0dABEBAAGJAjwEGAECACYCGwwWIQS2yPmCgrlE47DVwlMPwwQuNFrQXQUC
333+Wl36SwUJDwUmqwAKCRAPwwQuNFrQXT1/D/9YpRDNgaJl3YVDtVZoeQwh7BQ6ULZT
334+eXFPogYkF2j3VWg8s9UmAs4sg/4a+9KLSantXjX+JFsRv0lQe5Gr/Vl8VQ4LKEXB
335+fiGmSivjIZ7eopdd3YP2w6G5T3SA4d2CQfsg4rnJPnXIjzKNiSOi368ybnt9fL0Y
336+2r2aqLTmP6Y7issDUO+J1TW1XHm349JPR0Hl4cTuNnWm4JuX2m2CJEc5XBlDAha9
337+pUVs+J5C2D0UFFkyeOzeJPwy6x5ApWHm84n8AjhQSpu1qRKxKXdwei6tkQWWMHui
338++TgSY/zCkmD9/oY15Ei5avJ4WgIbTLJUoZMi70riPmU8ThjpzA7S+Nk0g7rMPq+X
339+l1whjKU/u0udlsrIJjzkh6ftqKUmIkbxYTpjhnEujNrEr5m2S6Z6x3y9E5QagBMR
340+dxRhfk+HbyACcP/p9rXOzl4M291DoKeAAH70GHniGxyNs9rAoMr/hD5XW/Wrz3dc
341+KMc2s555E6MZILE2ZiolcRn+bYOMPZtWlbx98t8uqMf49gY4FGQBZAwPglMrx7mr
342+m7HTIiXahThQGOJg6izJDAD5RwSEGlAcL28T8KAuM6CLLkhlBfQwiKsUBNnh9r8w
343+V3lB+pV0GhL+3i077gTYfZBRwLzjFdhm9xUKEaZ6rN1BX9lzix4eSNK5nln0jUq1
344+67H2IH//2sf8dw==
345+=fTDu
346+-----END PGP PUBLIC KEY BLOCK-----
347\ No newline at end of file
348diff --git a/nss/automation/taskcluster/docker-hacl/Dockerfile b/nss/automation/taskcluster/docker-hacl/Dockerfile
349index 50f2be2..168be1c 100644
350--- a/nss/automation/taskcluster/docker-hacl/Dockerfile
351+++ b/nss/automation/taskcluster/docker-hacl/Dockerfile
352@@ -9,9 +9,10 @@ ENV haclrepo https://github.com/mitls/hacl-star.git
353
354 # Define versions of dependencies
355 ENV opamv 4.05.0
356-ENV haclversion 1da331f9ef30e13269e45ae73bbe4a4bca679ae6
357+ENV haclversion 1442c015dab97cdf203ae238b1f3aeccf511bd1e
358
359 # Install required packages and set versions
360+ADD B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc /tmp/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc
361 ADD setup.sh /tmp/setup.sh
362 RUN bash /tmp/setup.sh
363
364diff --git a/nss/automation/taskcluster/docker-hacl/setup.sh b/nss/automation/taskcluster/docker-hacl/setup.sh
365index f5f8bd7..491342e 100644
366--- a/nss/automation/taskcluster/docker-hacl/setup.sh
367+++ b/nss/automation/taskcluster/docker-hacl/setup.sh
368@@ -12,9 +12,13 @@ update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 200
369 # Get clang-format-3.9
370 curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
371 curl -LO https://releases.llvm.org/3.9.1/clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig
372-# Verify the signature.
373-gpg --keyserver pool.sks-keyservers.net --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D
374-gpg --verify *.tar.xz.sig
375+
376+# Verify the signature. The key used for verification was fetched via:
377+# gpg --keyserver pgp.key-server.io --recv-keys B6C8F98282B944E3B0D5C2530FC3042E345AD05D
378+# Use a local copy to workaround bug 1565013.
379+gpg --no-default-keyring --keyring tmp.keyring --import /tmp/B6C8F98282B944E3B0D5C2530FC3042E345AD05D.asc
380+gpg --no-default-keyring --keyring tmp.keyring --verify clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig
381+
382 # Install into /usr/local/.
383 tar xJvf *.tar.xz -C /usr/local --strip-components=1
384 # Cleanup.
385diff --git a/nss/automation/taskcluster/graph/src/extend.js b/nss/automation/taskcluster/graph/src/extend.js
386index d7bd3f5..5b22ef8 100644
387--- a/nss/automation/taskcluster/graph/src/extend.js
388+++ b/nss/automation/taskcluster/graph/src/extend.js
389@@ -121,12 +121,26 @@ queue.map(task => {
390 }
391 }
392
393- // We don't run FIPS SSL tests
394 if (task.tests == "ssl") {
395 if (!task.env) {
396 task.env = {};
397 }
398- task.env.NSS_SSL_TESTS = "crl iopr policy";
399+
400+ // Stress tests to not include other SSL tests
401+ if (task.symbol == "stress") {
402+ task.env.NSS_SSL_TESTS = "normal_normal";
403+ } else {
404+ task.env.NSS_SSL_TESTS = "crl iopr policy normal_normal";
405+ }
406+
407+ // FIPS runs
408+ if (task.collection == "fips") {
409+ task.env.NSS_SSL_TESTS += " fips_fips fips_normal normal_fips";
410+ }
411+
412+ if (task.platform == "mac") {
413+ task.maxRunTime = 7200;
414+ }
415 }
416
417 // Windows is slow.
418@@ -135,6 +149,9 @@ queue.map(task => {
419 task.maxRunTime = 7200;
420 }
421
422+ if (task.platform == "mac" && task.tests == "tools") {
423+ task.maxRunTime = 7200;
424+ }
425 return task;
426 });
427
428@@ -317,12 +334,7 @@ async function scheduleMac(name, base, args = "") {
429 });
430
431 // Build base definition.
432- let build_base = merge(mac_base, {
433- command: [
434- MAC_CHECKOUT_CMD,
435- ["bash", "-c",
436- "nss/automation/taskcluster/scripts/build_gyp.sh " + args]
437- ],
438+ let build_base_without_command_symbol = merge(mac_base, {
439 provisioner: "localprovisioner",
440 workerType: "nss-macos-10-12",
441 platform: "mac",
442@@ -333,6 +345,35 @@ async function scheduleMac(name, base, args = "") {
443 path: "public"
444 }],
445 kind: "build",
446+ });
447+
448+ let gyp_cmd = "nss/automation/taskcluster/scripts/build_gyp.sh ";
449+
450+ if (!("collection" in base) ||
451+ (base.collection != "make" &&
452+ base.collection != "asan" &&
453+ base.collection != "fips" &&
454+ base.collection != "fuzz")) {
455+ let nspr_gyp = gyp_cmd + "--nspr-only --nspr-test-build ";
456+ // TODO (bug 1385039): nspr_gyp += "--nspr-test-run ";
457+ let nspr_build = merge(build_base_without_command_symbol, {
458+ command: [
459+ MAC_CHECKOUT_CMD,
460+ ["bash", "-c",
461+ nspr_gyp + args]
462+ ],
463+ symbol: "NSPR"
464+ });
465+ // The task that tests NSPR.
466+ let nspr_task_build = queue.scheduleTask(merge(nspr_build, {name}));
467+ }
468+
469+ let build_base = merge(build_base_without_command_symbol, {
470+ command: [
471+ MAC_CHECKOUT_CMD,
472+ ["bash", "-c",
473+ gyp_cmd + args]
474+ ],
475 symbol: "B"
476 });
477
478@@ -366,25 +407,55 @@ async function scheduleMac(name, base, args = "") {
479 /*****************************************************************************/
480
481 async function scheduleLinux(name, overrides, args = "") {
482+ let checkout_and_gyp = "bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh ";
483+ let artifacts_and_kind = {
484+ artifacts: {
485+ public: {
486+ expires: 24 * 7,
487+ type: "directory",
488+ path: "/home/worker/artifacts"
489+ }
490+ },
491+ kind: "build",
492+ };
493+
494+ if (!("collection" in overrides) ||
495+ (overrides.collection != "make" &&
496+ overrides.collection != "asan" &&
497+ overrides.collection != "fips" &&
498+ overrides.collection != "fuzz")) {
499+ let nspr_gyp = checkout_and_gyp + "--nspr-only --nspr-test-build ";
500+ // TODO (bug 1385039): nspr_gyp += "--nspr-test-run ";
501+
502+ let nspr_base = merge({
503+ command: [
504+ "/bin/bash",
505+ "-c",
506+ nspr_gyp + args
507+ ],
508+ }, overrides);
509+ let nspr_without_symbol = merge(nspr_base, artifacts_and_kind);
510+ let nspr_build = merge(nspr_without_symbol, {
511+ symbol: "NSPR",
512+ });
513+ // The task that tests NSPR.
514+ let nspr_task_build = queue.scheduleTask(merge(nspr_build, {name}));
515+ }
516+
517 // Construct a base definition. This takes |overrides| second because
518 // callers expect to be able to overwrite the |command| key.
519 let base = merge({
520 command: [
521 "/bin/bash",
522 "-c",
523- "bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh " + args
524+ checkout_and_gyp + args
525 ],
526 }, overrides);
527+
528+ let base_without_symbol = merge(base, artifacts_and_kind);
529+
530 // The base for building.
531- let build_base = merge(base, {
532- artifacts: {
533- public: {
534- expires: 24 * 7,
535- type: "directory",
536- path: "/home/worker/artifacts"
537- }
538- },
539- kind: "build",
540+ let build_base = merge(base_without_symbol, {
541 symbol: "B",
542 });
543
544@@ -567,7 +638,7 @@ async function scheduleFuzzing() {
545 "/bin/bash",
546 "-c",
547 "bin/checkout.sh && " +
548- "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz"
549+ "nss/automation/taskcluster/scripts/build_gyp.sh --fuzz"
550 ],
551 artifacts: {
552 public: {
553@@ -594,7 +665,7 @@ async function scheduleFuzzing() {
554 "/bin/bash",
555 "-c",
556 "bin/checkout.sh && " +
557- "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz=tls"
558+ "nss/automation/taskcluster/scripts/build_gyp.sh --fuzz=tls"
559 ],
560 }));
561
562@@ -672,7 +743,7 @@ async function scheduleFuzzing32() {
563 "/bin/bash",
564 "-c",
565 "bin/checkout.sh && " +
566- "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz -t ia32"
567+ "nss/automation/taskcluster/scripts/build_gyp.sh --fuzz -t ia32"
568 ],
569 artifacts: {
570 public: {
571@@ -699,7 +770,7 @@ async function scheduleFuzzing32() {
572 "/bin/bash",
573 "-c",
574 "bin/checkout.sh && " +
575- "nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz=tls -t ia32"
576+ "nss/automation/taskcluster/scripts/build_gyp.sh --fuzz=tls -t ia32"
577 ],
578 }));
579
580@@ -771,21 +842,45 @@ async function scheduleWindows(name, base, build_script) {
581 }
582 });
583
584- // Build base definition.
585- let build_base = merge(base, {
586- command: [
587- WINDOWS_CHECKOUT_CMD,
588- `bash -c 'nss/automation/taskcluster/windows/${build_script}'`
589- ],
590+ let artifacts_and_kind = {
591 artifacts: [{
592 expires: 24 * 7,
593 type: "directory",
594 path: "public\\build"
595 }],
596 kind: "build",
597+ };
598+
599+ let build_without_command_symbol = merge(base, artifacts_and_kind);
600+
601+ // Build base definition.
602+ let build_base = merge(build_without_command_symbol, {
603+ command: [
604+ WINDOWS_CHECKOUT_CMD,
605+ `bash -c 'nss/automation/taskcluster/windows/${build_script}'`
606+ ],
607 symbol: "B"
608 });
609
610+ if (!("collection" in base) ||
611+ (base.collection != "make" &&
612+ base.collection != "asan" &&
613+ base.collection != "fips" &&
614+ base.collection != "fuzz")) {
615+ let nspr_gyp =
616+ `bash -c 'nss/automation/taskcluster/windows/${build_script} --nspr-only --nspr-test-build'`;
617+ // TODO (bug 1385039): add --nspr-test-run
618+ let nspr_build = merge(build_without_command_symbol, {
619+ command: [
620+ WINDOWS_CHECKOUT_CMD,
621+ nspr_gyp
622+ ],
623+ symbol: "NSPR"
624+ });
625+ // The task that tests NSPR.
626+ let task_build = queue.scheduleTask(merge(nspr_build, {name}));
627+ }
628+
629 // Make builds run FIPS tests, which need an extra FIPS build.
630 if (base.collection == "make") {
631 let extra_build = queue.scheduleTask(merge(build_base, {
632@@ -951,6 +1046,10 @@ function scheduleTests(task_build, task_cert, test_base) {
633 queue.scheduleTask(merge(ssl_base, {
634 name: "SSL tests (upgradedb)", symbol: "upgradedb", cycle: "upgradedb"
635 }));
636+ queue.scheduleTask(merge(ssl_base, {
637+ name: "SSL tests (stress)", symbol: "stress", cycle: "sharedb",
638+ env: {NSS_SSL_RUN: "stress"}
639+ }));
640 }
641
642 /*****************************************************************************/
643diff --git a/nss/automation/taskcluster/graph/src/queue.js b/nss/automation/taskcluster/graph/src/queue.js
644index 0b7ade9..0dc6bbb 100644
645--- a/nss/automation/taskcluster/graph/src/queue.js
646+++ b/nss/automation/taskcluster/graph/src/queue.js
647@@ -114,6 +114,14 @@ function convertTask(def) {
648 if (def.cycle) {
649 env.NSS_CYCLES = def.cycle;
650 }
651+ if (def.kind === "build") {
652+ // Disable leak checking during builds (bug 1579290).
653+ if (env.ASAN_OPTIONS) {
654+ env.ASAN_OPTIONS += ":detect_leaks=0";
655+ } else {
656+ env.ASAN_OPTIONS = "detect_leaks=0";
657+ }
658+ }
659
660 let payload = {
661 env,
662@@ -143,7 +151,7 @@ function convertTask(def) {
663 }
664
665 let extra = Object.assign({
666- treeherder: parseTreeherder(def)
667+ treeherder: parseTreeherder(def)
668 }, parameters);
669
670 return {
671diff --git a/nss/automation/taskcluster/graph/src/try_syntax.js b/nss/automation/taskcluster/graph/src/try_syntax.js
672index 700032a..ca0b848 100644
673--- a/nss/automation/taskcluster/graph/src/try_syntax.js
674+++ b/nss/automation/taskcluster/graph/src/try_syntax.js
675@@ -183,6 +183,17 @@ export async function initFilter() {
676
677 // Add try syntax filter.
678 if (match) {
679- queue.filter(filter(parseOptions(match[1])));
680+ let match1 = match[1];
681+ queue.filter(filter(parseOptions(match1)));
682+
683+ if (match1.includes("--nspr-patch")) {
684+ queue.map(task => {
685+ if (!task.env) {
686+ task.env = {};
687+ }
688+ task.env.ALLOW_NSPR_PATCH = "1";
689+ return task;
690+ });
691+ }
692 }
693 }
694diff --git a/nss/automation/taskcluster/scripts/build.sh b/nss/automation/taskcluster/scripts/build.sh
695index 649fdaa..42ac822 100755
696--- a/nss/automation/taskcluster/scripts/build.sh
697+++ b/nss/automation/taskcluster/scripts/build.sh
698@@ -13,6 +13,12 @@ fi
699 # Clone NSPR if needed.
700 hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
701
702+if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
703+ pushd nspr
704+ cat ../nss/nspr.patch | patch -p1
705+ popd
706+fi
707+
708 # Build.
709 make -C nss nss_build_all
710
711diff --git a/nss/automation/taskcluster/scripts/build_gyp.sh b/nss/automation/taskcluster/scripts/build_gyp.sh
712index fb3a33a..e19a636 100755
713--- a/nss/automation/taskcluster/scripts/build_gyp.sh
714+++ b/nss/automation/taskcluster/scripts/build_gyp.sh
715@@ -5,8 +5,14 @@ source $(dirname "$0")/tools.sh
716 # Clone NSPR if needed.
717 hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
718
719+if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
720+ pushd nspr
721+ cat ../nss/nspr.patch | patch -p1
722+ popd
723+fi
724+
725 # Build.
726-nss/build.sh -g -v "$@"
727+nss/build.sh -g -v --enable-libpkix "$@"
728
729 # Package.
730 if [[ $(uname) = "Darwin" ]]; then
731diff --git a/nss/automation/taskcluster/scripts/build_nspr.sh b/nss/automation/taskcluster/scripts/build_nspr.sh
732index 4d19034..b104e43 100755
733--- a/nss/automation/taskcluster/scripts/build_nspr.sh
734+++ b/nss/automation/taskcluster/scripts/build_nspr.sh
735@@ -7,6 +7,12 @@ source $(dirname $0)/tools.sh
736 # Clone NSPR if needed.
737 hg_clone https://hg.mozilla.org/projects/nspr nspr default
738
739+if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
740+ pushd nspr
741+ cat ../nss/nspr.patch | patch -p1
742+ popd
743+fi
744+
745 # Build.
746 rm -rf dist
747 make -C nss build_nspr
748diff --git a/nss/automation/taskcluster/scripts/build_softoken.sh b/nss/automation/taskcluster/scripts/build_softoken.sh
749index e5aaecc..5f60456 100755
750--- a/nss/automation/taskcluster/scripts/build_softoken.sh
751+++ b/nss/automation/taskcluster/scripts/build_softoken.sh
752@@ -20,8 +20,9 @@ export NSS_BUILD_SOFTOKEN_ONLY=1
753 rm -rf dist
754 make -C nss-softoken nss_build_all
755
756-mv dist/private/nss/blapi.h dist/public/nss
757-mv dist/private/nss/alghmac.h dist/public/nss
758+for i in blapi alghmac cmac; do
759+ mv "dist/private/nss/${i}.h" dist/public/nss
760+done
761
762 # Package.
763 test -d artifacts || mkdir artifacts
764diff --git a/nss/automation/taskcluster/scripts/check_abi.sh b/nss/automation/taskcluster/scripts/check_abi.sh
765index caa5cca..5cd587a 100755
766--- a/nss/automation/taskcluster/scripts/check_abi.sh
767+++ b/nss/automation/taskcluster/scripts/check_abi.sh
768@@ -20,6 +20,12 @@ set_env()
769 done
770 fi
771
772+ if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
773+ pushd nspr
774+ cat ../nss/nspr.patch | patch -p1
775+ popd
776+ fi
777+
778 cd nss
779 ./build.sh -v -c
780 cd ..
781diff --git a/nss/automation/taskcluster/scripts/gen_coverage_report.sh b/nss/automation/taskcluster/scripts/gen_coverage_report.sh
782index 3907c72..dc7d77d 100755
783--- a/nss/automation/taskcluster/scripts/gen_coverage_report.sh
784+++ b/nss/automation/taskcluster/scripts/gen_coverage_report.sh
785@@ -5,6 +5,12 @@ source $(dirname "$0")/tools.sh
786 # Clone NSPR.
787 hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
788
789+if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
790+ pushd nspr
791+ cat ../nss/nspr.patch | patch -p1
792+ popd
793+fi
794+
795 out=/home/worker/artifacts
796 mkdir -p $out
797
798diff --git a/nss/automation/taskcluster/scripts/run_coverity.sh b/nss/automation/taskcluster/scripts/run_coverity.sh
799index 4d008f4..4b09f53 100755
800--- a/nss/automation/taskcluster/scripts/run_coverity.sh
801+++ b/nss/automation/taskcluster/scripts/run_coverity.sh
802@@ -5,6 +5,12 @@ source $(dirname "$0")/tools.sh
803 # Clone NSPR if needed.
804 if [ ! -d "nspr" ]; then
805 hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
806+
807+ if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
808+ pushd nspr
809+ cat ../nss/nspr.patch | patch -p1
810+ popd
811+ fi
812 fi
813
814 # Build and run Coverity
815@@ -12,4 +18,4 @@ cd nss
816 ./mach static-analysis
817
818 # Return the exit code of the Coverity Analysis
819-exit $?
820\ No newline at end of file
821+exit $?
822diff --git a/nss/automation/taskcluster/scripts/run_scan_build.sh b/nss/automation/taskcluster/scripts/run_scan_build.sh
823index 014530b..0e4fcbd 100755
824--- a/nss/automation/taskcluster/scripts/run_scan_build.sh
825+++ b/nss/automation/taskcluster/scripts/run_scan_build.sh
826@@ -5,6 +5,12 @@ source $(dirname "$0")/tools.sh
827 # Clone NSPR if needed.
828 if [ ! -d "nspr" ]; then
829 hg_clone https://hg.mozilla.org/projects/nspr ./nspr default
830+
831+ if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
832+ pushd nspr
833+ cat ../nss/nspr.patch | patch -p1
834+ popd
835+ fi
836 fi
837
838 # Build.
839diff --git a/nss/automation/taskcluster/windows/build.sh b/nss/automation/taskcluster/windows/build.sh
840index eebb415..f878a3d 100644
841--- a/nss/automation/taskcluster/windows/build.sh
842+++ b/nss/automation/taskcluster/windows/build.sh
843@@ -12,6 +12,12 @@ source "$(dirname "$0")/setup.sh"
844 # Clone NSPR.
845 hg_clone https://hg.mozilla.org/projects/nspr nspr default
846
847+if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
848+ pushd nspr
849+ cat ../nss/nspr.patch | patch -p1
850+ popd
851+fi
852+
853 # Build.
854 make -C nss nss_build_all
855
856diff --git a/nss/automation/taskcluster/windows/build_gyp.sh b/nss/automation/taskcluster/windows/build_gyp.sh
857index c0f38f9..1a78d44 100644
858--- a/nss/automation/taskcluster/windows/build_gyp.sh
859+++ b/nss/automation/taskcluster/windows/build_gyp.sh
860@@ -31,8 +31,14 @@ export PATH="${PATH}:${PWD}/ninja/bin:${PWD}/gyp/test-env/Scripts"
861 # Clone NSPR.
862 hg_clone https://hg.mozilla.org/projects/nspr nspr default
863
864+if [[ -f nss/nspr.patch && "$ALLOW_NSPR_PATCH" == "1" ]]; then
865+ pushd nspr
866+ cat ../nss/nspr.patch | patch -p1
867+ popd
868+fi
869+
870 # Build with gyp.
871-./nss/build.sh -g -v "$@"
872+./nss/build.sh -g -v --enable-libpkix "$@"
873
874 # Package.
875 7z a public/build/dist.7z dist
876diff --git a/nss/build.sh b/nss/build.sh
877index 0b6fec8..7595d76 100755
878--- a/nss/build.sh
879+++ b/nss/build.sh
880@@ -13,14 +13,16 @@
881 set -e
882
883 cwd=$(cd $(dirname $0); pwd -P)
884-source "$cwd"/coreconf/nspr.sh
885-source "$cwd"/coreconf/sanitizers.sh
886+dist_dir="$cwd/../dist"
887+argsfile="$dist_dir/build_args"
888+source "$cwd/coreconf/nspr.sh"
889+source "$cwd/coreconf/sanitizers.sh"
890 GYP=${GYP:-gyp}
891
892 # Usage info
893 show_help()
894 {
895- cat "$cwd"/help.txt
896+ cat "$cwd/help.txt"
897 }
898
899 run_verbose()
900@@ -35,6 +37,14 @@ run_verbose()
901 exec 3>&-
902 }
903
904+# The prehistoric bash on Mac doesn't support @Q quoting.
905+# The consequences aren't that serious, unless there are odd arrangements of spaces.
906+if /usr/bin/env bash -c 'x=1;echo "${x@Q}"' >/dev/null 2>&1; then
907+ Q() { echo "${@@Q}"; }
908+else
909+ Q() { echo "$@"; }
910+fi
911+
912 if [ -n "$CCC" ] && [ -z "$CXX" ]; then
913 export CXX="$CCC"
914 fi
915@@ -44,6 +54,9 @@ build_64=0
916 clean=0
917 rebuild_gyp=0
918 rebuild_nspr=0
919+build_nspr_tests=0
920+run_nspr_tests=0
921+exit_after_nspr=0
922 target=Debug
923 verbose=0
924 fuzz=0
925@@ -56,7 +69,7 @@ gyp_params=(--depth="$cwd" --generator-output=".")
926 ninja_params=()
927
928 # Assume that the target architecture is the same as the host by default.
929-host_arch=$(python "$cwd"/coreconf/detect_host_arch.py)
930+host_arch=$(python "$cwd/coreconf/detect_host_arch.py")
931 target_arch=$host_arch
932
933 # Assume that MSVC is wanted if this is running on windows.
934@@ -66,8 +79,17 @@ if [ "${platform%-*}" = "MINGW32_NT" -o "${platform%-*}" = "MINGW64_NT" ]; then
935 fi
936
937 # Parse command line arguments.
938+all_args=("$@")
939 while [ $# -gt 0 ]; do
940 case "$1" in
941+ --rebuild)
942+ if [[ ! -e "$argsfile" ]]; then
943+ echo "Unable to rebuild" 1>&2
944+ exit 2
945+ fi
946+ IFS=$'\r\n' GLOBIGNORE='*' command eval 'previous_args=($(<"$argsfile"))'
947+ exec /usr/bin/env bash -c "$(Q "$0")"' "$@"' "$0" "${previous_args[@]}"
948+ ;;
949 -c) clean=1 ;;
950 -cc) clean_only=1 ;;
951 -v) ninja_params+=(-v); verbose=1 ;;
952@@ -98,6 +120,9 @@ while [ $# -gt 0 ]; do
953 --static) gyp_params+=(-Dstatic_libs=1) ;;
954 --ct-verif) gyp_params+=(-Dct_verif=1) ;;
955 --nspr) nspr_clean; rebuild_nspr=1 ;;
956+ --nspr-test-build) build_nspr_tests=1 ;;
957+ --nspr-test-run) run_nspr_tests=1 ;;
958+ --nspr-only) exit_after_nspr=1 ;;
959 --with-nspr=?*) set_nspr_path "${1#*=}"; no_local_nspr=1 ;;
960 --system-nspr) set_nspr_path "/usr/include/nspr/:"; no_local_nspr=1 ;;
961 --system-sqlite) gyp_params+=(-Duse_system_sqlite=1) ;;
962@@ -105,7 +130,7 @@ while [ $# -gt 0 ]; do
963 --enable-libpkix) gyp_params+=(-Ddisable_libpkix=0) ;;
964 --mozpkix-only) gyp_params+=(-Dmozpkix_only=1 -Ddisable_tests=1 -Dsign_libs=0) ;;
965 --disable-keylog) sslkeylogfile=0 ;;
966- -D*) gyp_params+=("$1") ;;
967+ -D*) gyp_params+=("$1") ;;
968 *) show_help; exit 2 ;;
969 esac
970 shift
971@@ -123,7 +148,7 @@ gyp_params+=(-Denable_sslkeylogfile="$sslkeylogfile")
972
973 # Do special setup.
974 if [ "$fuzz" = 1 ]; then
975- source "$cwd"/coreconf/fuzz.sh
976+ source "$cwd/coreconf/fuzz.sh"
977 fi
978 nspr_set_flags $sanitizer_flags
979 if [ ! -z "$sanitizer_flags" ]; then
980@@ -131,20 +156,13 @@ if [ ! -z "$sanitizer_flags" ]; then
981 fi
982
983 if [ "$msvc" = 1 ]; then
984- source "$cwd"/coreconf/msvc.sh
985+ source "$cwd/coreconf/msvc.sh"
986 fi
987
988-# Setup build paths.
989-target_dir="$cwd"/out/$target
990-mkdir -p "$target_dir"
991-dist_dir="$cwd"/../dist
992-dist_dir=$(mkdir -p "$dist_dir"; cd "$dist_dir"; pwd -P)
993-gyp_params+=(-Dnss_dist_dir="$dist_dir")
994-
995 # -c = clean first
996 if [ "$clean" = 1 -o "$clean_only" = 1 ]; then
997 nspr_clean
998- rm -rf "$cwd"/out
999+ rm -rf "$cwd/out"
1000 rm -rf "$dist_dir"
1001 # -cc = only clean, don't build
1002 if [ "$clean_only" = 1 ]; then
1003@@ -153,6 +171,12 @@ if [ "$clean" = 1 -o "$clean_only" = 1 ]; then
1004 fi
1005 fi
1006
1007+# Setup build paths.
1008+target_dir="$cwd/out/$target"
1009+mkdir -p "$target_dir"
1010+dist_dir=$(mkdir -p "$dist_dir"; cd "$dist_dir"; pwd -P)
1011+gyp_params+=(-Dnss_dist_dir="$dist_dir")
1012+
1013 # This saves a canonical representation of arguments that we are passing to gyp
1014 # or the NSPR build so that we can work out if a rebuild is needed.
1015 # Caveat: This can fail for arguments that are position-dependent.
1016@@ -162,66 +186,72 @@ check_config()
1017 local newconf="$1".new oldconf="$1"
1018 shift
1019 mkdir -p $(dirname "$newconf")
1020- echo CC="$CC" >"$newconf"
1021- echo CCC="$CCC" >>"$newconf"
1022- echo CXX="$CXX" >>"$newconf"
1023- echo target_arch="$target_arch" >>"$newconf"
1024- for i in "$@"; do echo $i; done | sort >>"$newconf"
1025+ echo CC="$(Q "$CC")" >"$newconf"
1026+ echo CCC="$(Q "$CCC")" >>"$newconf"
1027+ echo CXX="$(Q "$CXX")" >>"$newconf"
1028+ echo target_arch="$(Q "$target_arch")" >>"$newconf"
1029+ for i in "$@"; do echo "$i"; done | sort >>"$newconf"
1030
1031 # Note: The following diff fails if $oldconf isn't there as well, which
1032 # happens if we don't have a previous successful build.
1033 ! diff -q "$newconf" "$oldconf" >/dev/null 2>&1
1034 }
1035
1036-gyp_config="$cwd"/out/gyp_config
1037-nspr_config="$cwd"/out/$target/nspr_config
1038+gyp_config="$cwd/out/gyp_config"
1039+nspr_config="$cwd/out/$target/nspr_config"
1040
1041 # Now check what needs to be rebuilt.
1042 # If we don't have a build directory make sure that we rebuild.
1043 if [ ! -d "$target_dir" ]; then
1044 rebuild_nspr=1
1045 rebuild_gyp=1
1046-elif [ ! -d "$dist_dir"/$target ]; then
1047+elif [ ! -d "$dist_dir/$target" ]; then
1048 rebuild_nspr=1
1049 fi
1050
1051 if check_config "$nspr_config" \
1052- nspr_cflags="$nspr_cflags" \
1053- nspr_cxxflags="$nspr_cxxflags" \
1054- nspr_ldflags="$nspr_ldflags"; then
1055+ nspr_cflags="$(Q "$nspr_cflags")" \
1056+ nspr_cxxflags="$(Q "$nspr_cxxflags")" \
1057+ nspr_ldflags="$(Q "$nspr_ldflags")"; then
1058 rebuild_nspr=1
1059 fi
1060
1061-if check_config "$gyp_config" "${gyp_params[@]}"; then
1062+if check_config "$gyp_config" "$(Q "${gyp_params[@]}")"; then
1063 rebuild_gyp=1
1064 fi
1065
1066 # Save the chosen target.
1067-mkdir -p "$dist_dir"
1068-echo $target > "$dist_dir"/latest
1069+echo "$target" > "$dist_dir/latest"
1070+for i in "${all_args[@]}"; do echo "$i"; done > "$argsfile"
1071
1072 # Build.
1073 # NSPR.
1074 if [[ "$rebuild_nspr" = 1 && "$no_local_nspr" = 0 ]]; then
1075+ nspr_clean
1076 nspr_build
1077- mv -f "$nspr_config".new "$nspr_config"
1078+ mv -f "$nspr_config.new" "$nspr_config"
1079+fi
1080+
1081+if [ "$exit_after_nspr" = 1 ]; then
1082+ exit 0
1083 fi
1084+
1085 # gyp.
1086 if [ "$rebuild_gyp" = 1 ]; then
1087- if ! hash ${GYP} 2> /dev/null; then
1088- echo "Please install gyp" 1>&2
1089- exit 1
1090+ if ! hash "$GYP" 2> /dev/null; then
1091+ echo "Building NSS requires an installation of gyp: https://gyp.gsrc.io/" 1>&2
1092+ exit 3
1093 fi
1094 # These extra arguments aren't used in determining whether to rebuild.
1095- obj_dir="$dist_dir"/$target
1096- gyp_params+=(-Dnss_dist_obj_dir=$obj_dir)
1097+ obj_dir="$dist_dir/$target"
1098+ gyp_params+=(-Dnss_dist_obj_dir="$obj_dir")
1099 if [ "$no_local_nspr" = 0 ]; then
1100 set_nspr_path "$obj_dir/include/nspr:$obj_dir/lib"
1101 fi
1102
1103- run_verbose run_scanbuild ${GYP} -f ninja "${gyp_params[@]}" "$cwd"/nss.gyp
1104+ run_verbose run_scanbuild ${GYP} -f ninja "${gyp_params[@]}" "$cwd/nss.gyp"
1105
1106- mv -f "$gyp_config".new "$gyp_config"
1107+ mv -f "$gyp_config.new" "$gyp_config"
1108 fi
1109
1110 # ninja.
1111@@ -230,7 +260,7 @@ if hash ninja-build 2>/dev/null; then
1112 elif hash ninja 2>/dev/null; then
1113 ninja=ninja
1114 else
1115- echo "Please install ninja" 1>&2
1116- exit 1
1117+ echo "Building NSS requires an installation of ninja: https://ninja-build.org/" 1>&2
1118+ exit 3
1119 fi
1120-run_scanbuild $ninja -C "$target_dir" "${ninja_params[@]}"
1121+run_scanbuild "$ninja" -C "$target_dir" "${ninja_params[@]}"
1122diff --git a/nss/cmd/addbuiltin/addbuiltin.c b/nss/cmd/addbuiltin/addbuiltin.c
1123index 8316720..5655888 100644
1124--- a/nss/cmd/addbuiltin/addbuiltin.c
1125+++ b/nss/cmd/addbuiltin/addbuiltin.c
1126@@ -230,6 +230,8 @@ ConvertCertificate(SECItem *sdder, char *nickname, CERTCertTrust *trust,
1127 hasPositiveTrust(trust->objectSigningFlags)) {
1128 printf("CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE\n");
1129 }
1130+ printf("CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE\n");
1131+ printf("CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE\n");
1132 }
1133
1134 if ((trust->sslFlags | trust->emailFlags | trust->objectSigningFlags) ==
1135@@ -306,19 +308,21 @@ printheader()
1136 "#\n"
1137 "# Certificates\n"
1138 "#\n"
1139- "# -- Attribute -- -- type -- -- value --\n"
1140- "# CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE\n"
1141- "# CKA_TOKEN CK_BBOOL CK_TRUE\n"
1142- "# CKA_PRIVATE CK_BBOOL CK_FALSE\n"
1143- "# CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"
1144- "# CKA_LABEL UTF8 (varies)\n"
1145- "# CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509\n"
1146- "# CKA_SUBJECT DER+base64 (varies)\n"
1147- "# CKA_ID byte array (varies)\n"
1148- "# CKA_ISSUER DER+base64 (varies)\n"
1149- "# CKA_SERIAL_NUMBER DER+base64 (varies)\n"
1150- "# CKA_VALUE DER+base64 (varies)\n"
1151- "# CKA_NSS_EMAIL ASCII7 (unused here)\n"
1152+ "# -- Attribute -- -- type -- -- value --\n"
1153+ "# CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE\n"
1154+ "# CKA_TOKEN CK_BBOOL CK_TRUE\n"
1155+ "# CKA_PRIVATE CK_BBOOL CK_FALSE\n"
1156+ "# CKA_MODIFIABLE CK_BBOOL CK_FALSE\n"
1157+ "# CKA_LABEL UTF8 (varies)\n"
1158+ "# CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509\n"
1159+ "# CKA_SUBJECT DER+base64 (varies)\n"
1160+ "# CKA_ID byte array (varies)\n"
1161+ "# CKA_ISSUER DER+base64 (varies)\n"
1162+ "# CKA_SERIAL_NUMBER DER+base64 (varies)\n"
1163+ "# CKA_VALUE DER+base64 (varies)\n"
1164+ "# CKA_NSS_EMAIL ASCII7 (unused here)\n"
1165+ "# CKA_NSS_SERVER_DISTRUST_AFTER DER+base64 (varies)\n"
1166+ "# CKA_NSS_EMAIL_DISTRUST_AFTER DER+base64 (varies)\n"
1167 "#\n"
1168 "# Trust\n"
1169 "#\n"
1170@@ -392,6 +396,12 @@ Usage(char *progName)
1171 fprintf(stderr, "%-15s a CRL entry number, as shown by \"crlutil -S\"\n", "-e");
1172 fprintf(stderr, "%-15s input file to read (default stdin)\n", "-i file");
1173 fprintf(stderr, "%-15s (pipe through atob if the cert is b64-encoded)\n", "");
1174+ fprintf(stderr, "%-15s convert a timestamp to DER, and output.\n", "-d timestamp");
1175+ fprintf(stderr, "%-15s useful to fill server and email distrust fields\n", "");
1176+ fprintf(stderr, "%-15s Example: %s -d 1561939200\n", "", progName);
1177+ fprintf(stderr, "%-15s NOTE: The informed timestamp are interpreted as seconds\n", "");
1178+ fprintf(stderr, "%-15s since unix epoch.\n", "");
1179+ fprintf(stderr, "%-15s TIP: date -d \"2019-07-01 00:00:00 UTC\" +%%s\n", "");
1180 exit(-1);
1181 }
1182
1183@@ -403,20 +413,21 @@ enum {
1184 opt_ExcludeCert,
1185 opt_ExcludeHash,
1186 opt_DistrustCRL,
1187- opt_CRLEnry
1188+ opt_CRLEntry,
1189+ opt_ConvertDate
1190 };
1191
1192-static secuCommandFlag addbuiltin_options[] =
1193- {
1194- { /* opt_Input */ 'i', PR_TRUE, 0, PR_FALSE },
1195- { /* opt_Nickname */ 'n', PR_TRUE, 0, PR_FALSE },
1196- { /* opt_Trust */ 't', PR_TRUE, 0, PR_FALSE },
1197- { /* opt_Distrust */ 'D', PR_FALSE, 0, PR_FALSE },
1198- { /* opt_ExcludeCert */ 'c', PR_FALSE, 0, PR_FALSE },
1199- { /* opt_ExcludeHash */ 'h', PR_FALSE, 0, PR_FALSE },
1200- { /* opt_DistrustCRL */ 'C', PR_FALSE, 0, PR_FALSE },
1201- { /* opt_CRLEnry */ 'e', PR_TRUE, 0, PR_FALSE },
1202- };
1203+static secuCommandFlag addbuiltin_options[] = {
1204+ { /* opt_Input */ 'i', PR_TRUE, 0, PR_FALSE },
1205+ { /* opt_Nickname */ 'n', PR_TRUE, 0, PR_FALSE },
1206+ { /* opt_Trust */ 't', PR_TRUE, 0, PR_FALSE },
1207+ { /* opt_Distrust */ 'D', PR_FALSE, 0, PR_FALSE },
1208+ { /* opt_ExcludeCert */ 'c', PR_FALSE, 0, PR_FALSE },
1209+ { /* opt_ExcludeHash */ 'h', PR_FALSE, 0, PR_FALSE },
1210+ { /* opt_DistrustCRL */ 'C', PR_FALSE, 0, PR_FALSE },
1211+ { /* opt_CRLEntry */ 'e', PR_TRUE, 0, PR_FALSE },
1212+ { /* opt_ConvertDate */ 'd', PR_TRUE, 0, PR_FALSE },
1213+};
1214
1215 int
1216 main(int argc, char **argv)
1217@@ -444,6 +455,30 @@ main(int argc, char **argv)
1218 if (rv != SECSuccess)
1219 Usage(progName);
1220
1221+ if (addbuiltin.options[opt_ConvertDate].activated) {
1222+ char *endPtr;
1223+ PRTime distrustTimestamp = strtol(addbuiltin.options[opt_ConvertDate].arg, &endPtr, 0) * PR_USEC_PER_SEC;
1224+ if (*endPtr != '\0' && distrustTimestamp > 0) {
1225+ Usage(progName);
1226+ exit(1);
1227+ }
1228+ SECItem encTime;
1229+ DER_EncodeTimeChoice(NULL, &encTime, distrustTimestamp);
1230+ SECU_PrintTimeChoice(stdout, &encTime, "The timestamp represents this date", 0);
1231+ printf("Locate the entry of the desired certificate in certdata.txt\n"
1232+ "Erase the CKA_NSS_[SERVER|EMAIL]_DISTRUST_AFTER CK_BBOOL CK_FALSE\n"
1233+ "And override with the following respective entry:\n\n");
1234+ SECU_PrintTimeChoice(stdout, &encTime, "# For Server Distrust After", 0);
1235+ printf("CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL\n");
1236+ dumpbytes(encTime.data, encTime.len);
1237+ printf("END\n");
1238+ SECU_PrintTimeChoice(stdout, &encTime, "# For Email Distrust After", 0);
1239+ printf("CKA_NSS_EMAIL_DISTRUST_AFTER MULTILINE_OCTAL\n");
1240+ dumpbytes(encTime.data, encTime.len);
1241+ printf("END\n");
1242+ exit(0);
1243+ }
1244+
1245 if (addbuiltin.options[opt_Trust].activated)
1246 ++mutuallyExclusiveOpts;
1247 if (addbuiltin.options[opt_Distrust].activated)
1248@@ -458,12 +493,12 @@ main(int argc, char **argv)
1249 }
1250
1251 if (addbuiltin.options[opt_DistrustCRL].activated) {
1252- if (!addbuiltin.options[opt_CRLEnry].activated) {
1253+ if (!addbuiltin.options[opt_CRLEntry].activated) {
1254 fprintf(stderr, "%s: you must specify the CRL entry number.\n",
1255 progName);
1256 Usage(progName);
1257 } else {
1258- crlentry = atoi(addbuiltin.options[opt_CRLEnry].arg);
1259+ crlentry = atoi(addbuiltin.options[opt_CRLEntry].arg);
1260 if (crlentry < 1) {
1261 fprintf(stderr, "%s: The CRL entry number must be > 0.\n",
1262 progName);
1263diff --git a/nss/cmd/httpserv/httpserv.c b/nss/cmd/httpserv/httpserv.c
1264index 71e2ab8..c7277f3 100644
1265--- a/nss/cmd/httpserv/httpserv.c
1266+++ b/nss/cmd/httpserv/httpserv.c
1267@@ -463,7 +463,7 @@ handle_connection(
1268 char *getData = NULL; /* inplace conversion */
1269 SECItem postData;
1270 PRBool isOcspRequest = PR_FALSE;
1271- PRBool isPost;
1272+ PRBool isPost = PR_FALSE;
1273
1274 postData.data = NULL;
1275 postData.len = 0;
1276diff --git a/nss/cmd/lib/Makefile b/nss/cmd/lib/Makefile
1277index 0fb6c90..6b53451 100644
1278--- a/nss/cmd/lib/Makefile
1279+++ b/nss/cmd/lib/Makefile
1280@@ -27,6 +27,7 @@ include $(CORE_DEPTH)/coreconf/config.mk
1281 #######################################################################
1282
1283 include config.mk
1284+include ../platlibs.mk
1285
1286 #######################################################################
1287 # (5) Execute "global" rules. (OPTIONAL) #
1288diff --git a/nss/cmd/lib/derprint.c b/nss/cmd/lib/derprint.c
1289index 08ef66d..b86179e 100644
1290--- a/nss/cmd/lib/derprint.c
1291+++ b/nss/cmd/lib/derprint.c
1292@@ -4,6 +4,8 @@
1293 #include "secutil.h"
1294 #include "secoid.h"
1295
1296+#include <stdint.h>
1297+
1298 #ifdef __sun
1299 extern int fprintf(FILE *strm, const char *format, ... /* args */);
1300 extern int fflush(FILE *stream);
1301@@ -509,7 +511,7 @@ prettyPrintItem(FILE *out, const unsigned char *data, const unsigned char *end,
1302 /*
1303 * Just quit now if slen more bytes puts us off the end.
1304 */
1305- if ((data + slen) > end) {
1306+ if (data > end || slen > (end - data)) {
1307 PORT_SetError(SEC_ERROR_BAD_DER);
1308 return -1;
1309 }
1310diff --git a/nss/cmd/lib/lib.gyp b/nss/cmd/lib/lib.gyp
1311index 6b7da58..c5835a8 100644
1312--- a/nss/cmd/lib/lib.gyp
1313+++ b/nss/cmd/lib/lib.gyp
1314@@ -27,7 +27,8 @@
1315 ],
1316 'target_defaults': {
1317 'defines': [
1318- 'NSPR20'
1319+ 'NSPR20',
1320+ 'NSS_USE_STATIC_LIBS'
1321 ]
1322 },
1323 'variables': {
1324diff --git a/nss/cmd/lib/manifest.mn b/nss/cmd/lib/manifest.mn
1325index 87440c0..b3c36b3 100644
1326--- a/nss/cmd/lib/manifest.mn
1327+++ b/nss/cmd/lib/manifest.mn
1328@@ -37,3 +37,5 @@ CSRCS = basicutil.c \
1329 endif
1330
1331 NO_MD_RELEASE = 1
1332+
1333+USE_STATIC_LIBS = 1
1334diff --git a/nss/cmd/lib/pk11table.c b/nss/cmd/lib/pk11table.c
1335index 15c0a8d..ec5d889 100644
1336--- a/nss/cmd/lib/pk11table.c
1337+++ b/nss/cmd/lib/pk11table.c
1338@@ -333,6 +333,8 @@ const Constant _consts[] = {
1339 mkEntry(CKM_SHA512, Mechanism),
1340 mkEntry(CKM_SHA512_HMAC_GENERAL, Mechanism),
1341 mkEntry(CKM_SHA512_HMAC, Mechanism),
1342+ mkEntry(CKM_AES_CMAC, Mechanism),
1343+ mkEntry(CKM_AES_CMAC_GENERAL, Mechanism),
1344 mkEntry(CKM_CAST_KEY_GEN, Mechanism),
1345 mkEntry(CKM_CAST_ECB, Mechanism),
1346 mkEntry(CKM_CAST_CBC, Mechanism),
1347diff --git a/nss/cmd/lib/secpwd.c b/nss/cmd/lib/secpwd.c
1348index 7e99b27..e8ca792 100644
1349--- a/nss/cmd/lib/secpwd.c
1350+++ b/nss/cmd/lib/secpwd.c
1351@@ -66,7 +66,7 @@ SEC_GetPassword(FILE *input, FILE *output, char *prompt,
1352 int infd = fileno(input);
1353 int isTTY = isatty(infd);
1354 #endif
1355- char phrase[200] = { '\0' }; /* ensure EOF doesn't return junk */
1356+ char phrase[500] = { '\0' }; /* ensure EOF doesn't return junk */
1357
1358 for (;;) {
1359 /* Prompt for password */
1360diff --git a/nss/cmd/lib/secutil.c b/nss/cmd/lib/secutil.c
1361index 97c7f75..703845e 100644
1362--- a/nss/cmd/lib/secutil.c
1363+++ b/nss/cmd/lib/secutil.c
1364@@ -22,6 +22,7 @@
1365 #include <stdarg.h>
1366 #include <sys/stat.h>
1367 #include <errno.h>
1368+#include <limits.h>
1369
1370 #ifdef XP_UNIX
1371 #include <unistd.h>
1372@@ -1107,36 +1108,33 @@ typedef struct secuPBEParamsStr {
1373 SEC_ASN1_MKSUB(SECOID_AlgorithmIDTemplate)
1374
1375 /* SECOID_PKCS5_PBKDF2 */
1376-const SEC_ASN1Template secuKDF2Params[] =
1377- {
1378- { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },
1379- { SEC_ASN1_OCTET_STRING, offsetof(secuPBEParams, salt) },
1380- { SEC_ASN1_INTEGER, offsetof(secuPBEParams, iterationCount) },
1381- { SEC_ASN1_INTEGER, offsetof(secuPBEParams, keyLength) },
1382- { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, kdfAlg),
1383- SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
1384- { 0 }
1385- };
1386+const SEC_ASN1Template secuKDF2Params[] = {
1387+ { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },
1388+ { SEC_ASN1_OCTET_STRING, offsetof(secuPBEParams, salt) },
1389+ { SEC_ASN1_INTEGER, offsetof(secuPBEParams, iterationCount) },
1390+ { SEC_ASN1_INTEGER, offsetof(secuPBEParams, keyLength) },
1391+ { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, kdfAlg),
1392+ SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
1393+ { 0 }
1394+};
1395
1396 /* PKCS5v1 & PKCS12 */
1397-const SEC_ASN1Template secuPBEParamsTemp[] =
1398- {
1399- { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },
1400- { SEC_ASN1_OCTET_STRING, offsetof(secuPBEParams, salt) },
1401- { SEC_ASN1_INTEGER, offsetof(secuPBEParams, iterationCount) },
1402- { 0 }
1403- };
1404+const SEC_ASN1Template secuPBEParamsTemp[] = {
1405+ { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },
1406+ { SEC_ASN1_OCTET_STRING, offsetof(secuPBEParams, salt) },
1407+ { SEC_ASN1_INTEGER, offsetof(secuPBEParams, iterationCount) },
1408+ { 0 }
1409+};
1410
1411 /* SEC_OID_PKCS5_PBES2, SEC_OID_PKCS5_PBMAC1 */
1412-const SEC_ASN1Template secuPBEV2Params[] =
1413- {
1414- { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },
1415- { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, kdfAlg),
1416- SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
1417- { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, cipherAlg),
1418- SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
1419- { 0 }
1420- };
1421+const SEC_ASN1Template secuPBEV2Params[] = {
1422+ { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(secuPBEParams) },
1423+ { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, kdfAlg),
1424+ SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
1425+ { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(secuPBEParams, cipherAlg),
1426+ SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate) },
1427+ { 0 }
1428+};
1429
1430 void
1431 secu_PrintRSAPSSParams(FILE *out, SECItem *value, char *m, int level)
1432@@ -2299,8 +2297,9 @@ SECU_PrintCertAttributes(FILE *out, CERTAttribute **attrs, char *m, int level)
1433 return rv;
1434 }
1435
1436-int /* sometimes a PRErrorCode, other times a SECStatus. Sigh. */
1437- SECU_PrintCertificateRequest(FILE *out, SECItem *der, char *m, int level)
1438+/* sometimes a PRErrorCode, other times a SECStatus. Sigh. */
1439+int
1440+SECU_PrintCertificateRequest(FILE *out, SECItem *der, char *m, int level)
1441 {
1442 PLArenaPool *arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
1443 CERTCertificateRequest *cr;
1444@@ -3250,6 +3249,26 @@ SEC_PrintCertificateAndTrust(CERTCertificate *cert,
1445 "Certificate Trust Flags", 1);
1446 }
1447
1448+ /* The distrust fields are hard-coded in nssckbi and read-only.
1449+ * If verifying some cert, with vfychain, for instance, the certificate may
1450+ * not have a defined slot if not imported. */
1451+ if (cert->slot != NULL && cert->distrust != NULL) {
1452+ const unsigned int kDistrustFieldSize = 13;
1453+ fprintf(stdout, "\n");
1454+ SECU_Indent(stdout, 1);
1455+ fprintf(stdout, "%s:\n", "Certificate Distrust Dates");
1456+ if (cert->distrust->serverDistrustAfter.len == kDistrustFieldSize) {
1457+ SECU_PrintTimeChoice(stdout,
1458+ &cert->distrust->serverDistrustAfter,
1459+ "Server Distrust After", 2);
1460+ }
1461+ if (cert->distrust->emailDistrustAfter.len == kDistrustFieldSize) {
1462+ SECU_PrintTimeChoice(stdout,
1463+ &cert->distrust->emailDistrustAfter,
1464+ "E-mail Distrust After", 2);
1465+ }
1466+ }
1467+
1468 printf("\n");
1469
1470 return (SECSuccess);
1471@@ -3979,3 +3998,164 @@ done:
1472 *enabledSigSchemes = schemes;
1473 return SECSuccess;
1474 }
1475+
1476+/* Parse the exporter spec in the form: LABEL[:OUTPUT-LENGTH[:CONTEXT]] */
1477+static SECStatus
1478+parseExporter(const char *arg,
1479+ secuExporter *exporter)
1480+{
1481+ SECStatus rv = SECSuccess;
1482+
1483+ char *str = PORT_Strdup(arg);
1484+ if (!str) {
1485+ rv = SECFailure;
1486+ goto done;
1487+ }
1488+
1489+ char *labelEnd = strchr(str, ':');
1490+ if (labelEnd) {
1491+ *labelEnd = '\0';
1492+ labelEnd++;
1493+
1494+ /* To extract CONTEXT, first skip OUTPUT-LENGTH */
1495+ char *outputEnd = strchr(labelEnd, ':');
1496+ if (outputEnd) {
1497+ *outputEnd = '\0';
1498+ outputEnd++;
1499+
1500+ exporter->hasContext = PR_TRUE;
1501+ exporter->context.data = (unsigned char *)PORT_Strdup(outputEnd);
1502+ exporter->context.len = strlen(outputEnd);
1503+ if (PORT_Strncasecmp((char *)exporter->context.data, "0x", 2) == 0) {
1504+ rv = SECU_SECItemHexStringToBinary(&exporter->context);
1505+ if (rv != SECSuccess) {
1506+ goto done;
1507+ }
1508+ }
1509+ }
1510+ }
1511+
1512+ if (labelEnd && *labelEnd != '\0') {
1513+ long int outputLength = strtol(labelEnd, NULL, 10);
1514+ if (!(outputLength > 0 && outputLength <= UINT_MAX)) {
1515+ PORT_SetError(SEC_ERROR_INVALID_ARGS);
1516+ rv = SECFailure;
1517+ goto done;
1518+ }
1519+ exporter->outputLength = outputLength;
1520+ } else {
1521+ exporter->outputLength = 20;
1522+ }
1523+
1524+ char *label = PORT_Strdup(str);
1525+ exporter->label.data = (unsigned char *)label;
1526+ exporter->label.len = strlen(label);
1527+ if (PORT_Strncasecmp((char *)exporter->label.data, "0x", 2) == 0) {
1528+ rv = SECU_SECItemHexStringToBinary(&exporter->label);
1529+ if (rv != SECSuccess) {
1530+ goto done;
1531+ }
1532+ }
1533+
1534+done:
1535+ PORT_Free(str);
1536+
1537+ return rv;
1538+}
1539+
1540+SECStatus
1541+parseExporters(const char *arg,
1542+ const secuExporter **enabledExporters,
1543+ unsigned int *enabledExporterCount)
1544+{
1545+ secuExporter *exporters;
1546+ unsigned int numValues = 0;
1547+ unsigned int count = 0;
1548+
1549+ if (countItems(arg, &numValues) != SECSuccess) {
1550+ return SECFailure;
1551+ }
1552+ exporters = PORT_ZNewArray(secuExporter, numValues);
1553+ if (!exporters) {
1554+ return SECFailure;
1555+ }
1556+
1557+ /* Get exporter definitions. */
1558+ char *str = PORT_Strdup(arg);
1559+ if (!str) {
1560+ goto done;
1561+ }
1562+ char *p = strtok(str, ",");
1563+ while (p) {
1564+ SECStatus rv = parseExporter(p, &exporters[count++]);
1565+ if (rv != SECSuccess) {
1566+ count = 0;
1567+ goto done;
1568+ }
1569+ p = strtok(NULL, ",");
1570+ }
1571+
1572+done:
1573+ PORT_Free(str);
1574+ if (!count) {
1575+ PORT_Free(exporters);
1576+ return SECFailure;
1577+ }
1578+
1579+ *enabledExporterCount = count;
1580+ *enabledExporters = exporters;
1581+ return SECSuccess;
1582+}
1583+
1584+static SECStatus
1585+exportKeyingMaterial(PRFileDesc *fd, const secuExporter *exporter)
1586+{
1587+ SECStatus rv = SECSuccess;
1588+ unsigned char *out = PORT_Alloc(exporter->outputLength);
1589+
1590+ if (!out) {
1591+ fprintf(stderr, "Unable to allocate buffer for keying material\n");
1592+ return SECFailure;
1593+ }
1594+ rv = SSL_ExportKeyingMaterial(fd,
1595+ (char *)exporter->label.data,
1596+ exporter->label.len,
1597+ exporter->hasContext,
1598+ exporter->context.data,
1599+ exporter->context.len,
1600+ out,
1601+ exporter->outputLength);
1602+ if (rv != SECSuccess) {
1603+ goto done;
1604+ }
1605+ fprintf(stdout, "Exported Keying Material:\n");
1606+ secu_PrintRawString(stdout, (SECItem *)&exporter->label, "Label", 1);
1607+ if (exporter->hasContext) {
1608+ SECU_PrintAsHex(stdout, &exporter->context, "Context", 1);
1609+ }
1610+ SECU_Indent(stdout, 1);
1611+ fprintf(stdout, "Length: %u\n", exporter->outputLength);
1612+ SECItem temp = { siBuffer, out, exporter->outputLength };
1613+ SECU_PrintAsHex(stdout, &temp, "Keying Material", 1);
1614+
1615+done:
1616+ PORT_Free(out);
1617+ return rv;
1618+}
1619+
1620+SECStatus
1621+exportKeyingMaterials(PRFileDesc *fd,
1622+ const secuExporter *exporters,
1623+ unsigned int exporterCount)
1624+{
1625+ unsigned int i;
1626+
1627+ for (i = 0; i < exporterCount; i++) {
1628+ SECStatus rv = exportKeyingMaterial(fd, &exporters[i]);
1629+ if (rv != SECSuccess) {
1630+ return rv;
1631+ }
1632+ }
1633+
1634+ return SECSuccess;
1635+}
1636diff --git a/nss/cmd/lib/secutil.h b/nss/cmd/lib/secutil.h
1637index 90d7639..c6da961 100644
1638--- a/nss/cmd/lib/secutil.h
1639+++ b/nss/cmd/lib/secutil.h
1640@@ -409,6 +409,20 @@ SECStatus parseGroupList(const char *arg, SSLNamedGroup **enabledGroups,
1641 SECStatus parseSigSchemeList(const char *arg,
1642 const SSLSignatureScheme **enabledSigSchemes,
1643 unsigned int *enabledSigSchemeCount);
1644+typedef struct {
1645+ SECItem label;
1646+ PRBool hasContext;
1647+ SECItem context;
1648+ unsigned int outputLength;
1649+} secuExporter;
1650+
1651+SECStatus parseExporters(const char *arg,
1652+ const secuExporter **enabledExporters,
1653+ unsigned int *enabledExporterCount);
1654+
1655+SECStatus exportKeyingMaterials(PRFileDesc *fd,
1656+ const secuExporter *exporters,
1657+ unsigned int exporterCount);
1658
1659 /*
1660 *
1661diff --git a/nss/cmd/p7env/p7env.c b/nss/cmd/p7env/p7env.c
1662index b35bf9a..453cbee 100644
1663--- a/nss/cmd/p7env/p7env.c
1664+++ b/nss/cmd/p7env/p7env.c
1665@@ -66,7 +66,7 @@ EncryptFile(FILE *outFile, FILE *inFile, struct recipient *recipients,
1666 SEC_PKCS7ContentInfo *cinfo;
1667 SEC_PKCS7EncoderContext *ecx;
1668 struct recipient *rcpt;
1669- SECStatus rv;
1670+ SECStatus rv = SECFailure;
1671
1672 if (outFile == NULL || inFile == NULL || recipients == NULL)
1673 return -1;
1674@@ -133,7 +133,7 @@ main(int argc, char **argv)
1675 struct recipient *recipients, *rcpt;
1676 PLOptState *optstate;
1677 PLOptStatus status;
1678- SECStatus rv;
1679+ SECStatus rv = SECFailure;
1680
1681 progName = strrchr(argv[0], '/');
1682 progName = progName ? progName + 1 : argv[0];
1683diff --git a/nss/cmd/pk11importtest/pk11importtest.c b/nss/cmd/pk11importtest/pk11importtest.c
1684index eb8e359..e832659 100644
1685--- a/nss/cmd/pk11importtest/pk11importtest.c
1686+++ b/nss/cmd/pk11importtest/pk11importtest.c
1687@@ -176,7 +176,9 @@ cleanup:
1688 }
1689 SECITEM_FreeItem(&pubValue, PR_FALSE);
1690 SECITEM_FreeItem(&privID, PR_FALSE);
1691- PORT_FreeArena(epki->arena, PR_TRUE);
1692+ if (epki && epki->arena) {
1693+ PORT_FreeArena(epki->arena, PR_TRUE);
1694+ }
1695 SECKEY_DestroyPublicKey(pubKey);
1696 SECKEY_DestroyPrivateKey(privKey);
1697 fprintf(stderr, "%s PrivateKeyImport %s ***********************\n",
1698diff --git a/nss/cmd/pk11mode/pk11mode.c b/nss/cmd/pk11mode/pk11mode.c
1699index 9989109..1655453 100644
1700--- a/nss/cmd/pk11mode/pk11mode.c
1701+++ b/nss/cmd/pk11mode/pk11mode.c
1702@@ -5229,7 +5229,7 @@ PKM_Digest(CK_FUNCTION_LIST_PTR pFunctionList,
1703 char *
1704 PKM_FilePasswd(char *pwFile)
1705 {
1706- unsigned char phrase[200];
1707+ unsigned char phrase[500];
1708 PRFileDesc *fd;
1709 PRInt32 nb;
1710 int i;
1711diff --git a/nss/cmd/pk12util/pk12util.c b/nss/cmd/pk12util/pk12util.c
1712index 5884713..794f17b 100644
1713--- a/nss/cmd/pk12util/pk12util.c
1714+++ b/nss/cmd/pk12util/pk12util.c
1715@@ -644,6 +644,7 @@ P12U_ExportPKCS12Object(char *nn, char *outfile, PK11SlotInfo *inSlot,
1716 }
1717 certlist = PK11_FindCertsFromNickname(nn, slotPw);
1718 if (!certlist) {
1719+ PORT_SetError(SEC_ERROR_UNKNOWN_CERT);
1720 SECU_PrintError(progName, "find user certs from nickname failed");
1721 pk12uErrno = PK12UERR_FINDCERTBYNN;
1722 return;
1723diff --git a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk
1724index a59d03d..6401778 100644
1725--- a/nss/cmd/platlibs.mk
1726+++ b/nss/cmd/platlibs.mk
1727@@ -144,8 +144,8 @@ endif
1728 ifeq ($(OS_ARCH), WINNT)
1729
1730 EXTRA_LIBS += \
1731- $(NSS_LIBS_1) \
1732 $(SECTOOL_LIB) \
1733+ $(NSS_LIBS_1) \
1734 $(NSS_LIBS_2) \
1735 $(SOFTOKENLIB) \
1736 $(CRYPTOLIB) \
1737@@ -161,8 +161,8 @@ EXTRA_LIBS += \
1738 else
1739
1740 EXTRA_LIBS += \
1741- $(NSS_LIBS_1) \
1742 $(SECTOOL_LIB) \
1743+ $(NSS_LIBS_1) \
1744 $(NSS_LIBS_2) \
1745 $(SOFTOKENLIB) \
1746 $(NSS_LIBS_3) \
1747diff --git a/nss/cmd/selfserv/selfserv.c b/nss/cmd/selfserv/selfserv.c
1748index f2b1273..03e39d6 100644
1749--- a/nss/cmd/selfserv/selfserv.c
1750+++ b/nss/cmd/selfserv/selfserv.c
1751@@ -235,7 +235,13 @@ PrintParameterUsage()
1752 " rsa_pss_pss_sha256, rsa_pss_pss_sha384, rsa_pss_pss_sha512,\n"
1753 "-Z enable 0-RTT (for TLS 1.3; also use -u)\n"
1754 "-E enable post-handshake authentication\n"
1755- " (for TLS 1.3; only has an effect with 3 or more -r options)\n",
1756+ " (for TLS 1.3; only has an effect with 3 or more -r options)\n"
1757+ "-x Export and print keying material after successful handshake\n"
1758+ " The argument is a comma separated list of exporters in the form:\n"
1759+ " LABEL[:OUTPUT-LENGTH[:CONTEXT]]\n"
1760+ " where LABEL and CONTEXT can be either a free-form string or\n"
1761+ " a hex string if it is preceded by \"0x\"; OUTPUT-LENGTH\n"
1762+ " is a decimal integer.\n",
1763 stderr);
1764 }
1765
1766@@ -812,6 +818,8 @@ SSLNamedGroup *enabledGroups = NULL;
1767 unsigned int enabledGroupsCount = 0;
1768 const SSLSignatureScheme *enabledSigSchemes = NULL;
1769 unsigned int enabledSigSchemeCount = 0;
1770+const secuExporter *enabledExporters = NULL;
1771+unsigned int enabledExporterCount = 0;
1772
1773 static char *virtServerNameArray[MAX_VIRT_SERVER_NAME_ARRAY_INDEX];
1774 static int virtServerNameIndex = 1;
1775@@ -1822,6 +1830,15 @@ handshakeCallback(PRFileDesc *fd, void *client_data)
1776 SECITEM_FreeItem(hostInfo, PR_TRUE);
1777 }
1778 }
1779+ if (enabledExporters) {
1780+ SECStatus rv = exportKeyingMaterials(fd, enabledExporters, enabledExporterCount);
1781+ if (rv != SECSuccess) {
1782+ PRErrorCode err = PR_GetError();
1783+ fprintf(stderr,
1784+ "couldn't export keying material: %s\n",
1785+ SECU_Strerror(err));
1786+ }
1787+ }
1788 }
1789
1790 void
1791@@ -2012,7 +2029,7 @@ server_main(
1792 errExit("SSL_CipherPrefSetDefault:TLS_RSA_WITH_NULL_MD5");
1793 }
1794
1795- if (expectedHostNameVal) {
1796+ if (expectedHostNameVal || enabledExporters) {
1797 SSL_HandshakeCallback(model_sock, handshakeCallback,
1798 (void *)expectedHostNameVal);
1799 }
1800@@ -2246,11 +2263,11 @@ main(int argc, char **argv)
1801
1802 /* please keep this list of options in ASCII collating sequence.
1803 ** numbers, then capital letters, then lower case, alphabetical.
1804- ** XXX: 'B', 'E', 'q', and 'x' were used in the past but removed
1805+ ** XXX: 'B', and 'q' were used in the past but removed
1806 ** in 3.28, please leave some time before resuing those.
1807 ** 'z' was removed in 3.39. */
1808 optstate = PL_CreateOptState(argc, argv,
1809- "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");
1810+ "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");
1811 while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
1812 ++optionsFound;
1813 switch (optstate->option) {
1814@@ -2496,6 +2513,17 @@ main(int argc, char **argv)
1815 }
1816 break;
1817
1818+ case 'x':
1819+ rv = parseExporters(optstate->value,
1820+ &enabledExporters, &enabledExporterCount);
1821+ if (rv != SECSuccess) {
1822+ PL_DestroyOptState(optstate);
1823+ fprintf(stderr, "Bad exporter specified.\n");
1824+ fprintf(stderr, "Run '%s -h' for usage information.\n", progName);
1825+ exit(5);
1826+ }
1827+ break;
1828+
1829 default:
1830 case '?':
1831 fprintf(stderr, "Unrecognized or bad option specified.\n");
1832@@ -2685,8 +2713,10 @@ main(int argc, char **argv)
1833 }
1834 if (cipher > 0) {
1835 rv = SSL_CipherPrefSetDefault(cipher, SSL_ALLOWED);
1836- if (rv != SECSuccess)
1837- SECU_PrintError(progName, "SSL_CipherPrefSet()");
1838+ if (rv != SECSuccess) {
1839+ SECU_PrintError(progName, "SSL_CipherPrefSetDefault()");
1840+ exit(9);
1841+ }
1842 } else {
1843 fprintf(stderr,
1844 "Invalid cipher specification (-c arg).\n");
1845diff --git a/nss/cmd/shlibsign/shlibsign.c b/nss/cmd/shlibsign/shlibsign.c
1846index 221d1e6..b0a7512 100644
1847--- a/nss/cmd/shlibsign/shlibsign.c
1848+++ b/nss/cmd/shlibsign/shlibsign.c
1849@@ -614,7 +614,7 @@ cleanup:
1850 static char *
1851 filePasswd(char *pwFile)
1852 {
1853- unsigned char phrase[200];
1854+ unsigned char phrase[500];
1855 PRFileDesc *fd;
1856 PRInt32 nb;
1857 int i;
1858diff --git a/nss/cmd/strsclnt/strsclnt.c b/nss/cmd/strsclnt/strsclnt.c
1859index 099b7bf..3d9fc4f 100644
1860--- a/nss/cmd/strsclnt/strsclnt.c
1861+++ b/nss/cmd/strsclnt/strsclnt.c
1862@@ -166,6 +166,9 @@ Usage(void)
1863 " -u enable TLS Session Ticket extension\n"
1864 " -z enable compression\n"
1865 " -g enable false start\n"
1866+ " -4 Enforce using an IPv4 destination address\n"
1867+ " -6 Enforce using an IPv6 destination address\n"
1868+ " Note: Default behavior is both IPv4 and IPv6 enabled\n"
1869 " -J enable signature schemes\n"
1870 " This takes a comma separated list of signature schemes in preference\n"
1871 " order.\n"
1872@@ -1061,7 +1064,9 @@ client_main(
1873 int connections,
1874 cert_and_key *Cert_And_Key,
1875 const char *hostName,
1876- const char *sniHostName)
1877+ const char *sniHostName,
1878+ PRBool allowIPv4,
1879+ PRBool allowIPv6)
1880 {
1881 PRFileDesc *model_sock = NULL;
1882 int i;
1883@@ -1083,11 +1088,15 @@ client_main(
1884 SECU_PrintError(progName, "error looking up host");
1885 return;
1886 }
1887- do {
1888+ for (;;) {
1889 enumPtr = PR_EnumerateAddrInfo(enumPtr, addrInfo, port, &addr);
1890- } while (enumPtr != NULL &&
1891- addr.raw.family != PR_AF_INET &&
1892- addr.raw.family != PR_AF_INET6);
1893+ if (enumPtr == NULL)
1894+ break;
1895+ if (addr.raw.family == PR_AF_INET && allowIPv4)
1896+ break;
1897+ if (addr.raw.family == PR_AF_INET6 && allowIPv6)
1898+ break;
1899+ }
1900 PR_FreeAddrInfo(addrInfo);
1901 if (enumPtr == NULL) {
1902 SECU_PrintError(progName, "error looking up host address");
1903@@ -1319,6 +1328,8 @@ main(int argc, char **argv)
1904 int connections = 1;
1905 int exitVal;
1906 int tmpInt;
1907+ PRBool allowIPv4 = PR_TRUE;
1908+ PRBool allowIPv6 = PR_TRUE;
1909 unsigned short port = 443;
1910 SECStatus rv;
1911 PLOptState *optstate;
1912@@ -1338,9 +1349,25 @@ main(int argc, char **argv)
1913 /* XXX: 'B' was used in the past but removed in 3.28,
1914 * please leave some time before resuing it. */
1915 optstate = PL_CreateOptState(argc, argv,
1916- "C:DJ:NP:TUV:W:a:c:d:f:gin:op:qst:uvw:z");
1917+ "46C:DJ:NP:TUV:W:a:c:d:f:gin:op:qst:uvw:z");
1918 while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
1919 switch (optstate->option) {
1920+ case '4':
1921+ if (!allowIPv4) {
1922+ fprintf(stderr, "Only one of [-4, -6] can be specified.\n");
1923+ Usage();
1924+ }
1925+ allowIPv6 = PR_FALSE;
1926+ break;
1927+
1928+ case '6':
1929+ if (!allowIPv6) {
1930+ fprintf(stderr, "Only one of [-4, -6] can be specified.\n");
1931+ Usage();
1932+ }
1933+ allowIPv4 = PR_FALSE;
1934+ break;
1935+
1936 case 'C':
1937 cipherString = optstate->value;
1938 break;
1939@@ -1523,7 +1550,7 @@ main(int argc, char **argv)
1940 }
1941
1942 client_main(port, connections, &Cert_And_Key, hostName,
1943- sniHostName);
1944+ sniHostName, allowIPv4, allowIPv6);
1945
1946 /* clean up */
1947 if (Cert_And_Key.cert) {
1948diff --git a/nss/cmd/symkeyutil/symkeyutil.c b/nss/cmd/symkeyutil/symkeyutil.c
1949index 31ab4dd..6304338 100644
1950--- a/nss/cmd/symkeyutil/symkeyutil.c
1951+++ b/nss/cmd/symkeyutil/symkeyutil.c
1952@@ -254,7 +254,7 @@ HexToBuf(char *inString, SECItem *outbuf)
1953 int trueLen = 0;
1954
1955 outbuf->data = PORT_Alloc(outlen);
1956- if (outbuf->data) {
1957+ if (!outbuf->data) {
1958 return -1;
1959 }
1960
1961diff --git a/nss/cmd/tstclnt/tstclnt.c b/nss/cmd/tstclnt/tstclnt.c
1962index 12c6df0..6fa1541 100644
1963--- a/nss/cmd/tstclnt/tstclnt.c
1964+++ b/nss/cmd/tstclnt/tstclnt.c
1965@@ -318,6 +318,13 @@ PrintParameterUsage()
1966 fprintf(stderr, "%-20s Enable post-handshake authentication\n"
1967 "%-20s for TLS 1.3; need to specify -n\n",
1968 "-E", "");
1969+ fprintf(stderr, "%-20s Export and print keying material after successful handshake.\n"
1970+ "%-20s The argument is a comma separated list of exporters in the form:\n"
1971+ "%-20s LABEL[:OUTPUT-LENGTH[:CONTEXT]]\n"
1972+ "%-20s where LABEL and CONTEXT can be either a free-form string or\n"
1973+ "%-20s a hex string if it is preceded by \"0x\"; OUTPUT-LENGTH\n"
1974+ "%-20s is a decimal integer.\n",
1975+ "-x", "", "", "", "", "");
1976 }
1977
1978 static void
1979@@ -924,7 +931,7 @@ restartHandshakeAfterServerCertIfNeeded(PRFileDesc *fd,
1980 PRBool override)
1981 {
1982 SECStatus rv;
1983- PRErrorCode error;
1984+ PRErrorCode error = 0;
1985
1986 if (!serverCertAuth->isPaused)
1987 return SECSuccess;
1988@@ -998,6 +1005,8 @@ PRBool handshakeComplete = PR_FALSE;
1989 char *encryptedSNIKeys = NULL;
1990 PRBool enablePostHandshakeAuth = PR_FALSE;
1991 PRBool enableDelegatedCredentials = PR_FALSE;
1992+const secuExporter *enabledExporters = NULL;
1993+unsigned int enabledExporterCount = 0;
1994
1995 static int
1996 writeBytesToServer(PRFileDesc *s, const PRUint8 *buf, int nb)
1997@@ -1093,6 +1102,18 @@ handshakeCallback(PRFileDesc *fd, void *client_data)
1998 requestToExit = PR_TRUE;
1999 }
2000 handshakeComplete = PR_TRUE;
2001+
2002+ if (enabledExporters) {
2003+ SECStatus rv;
2004+
2005+ rv = exportKeyingMaterials(fd, enabledExporters, enabledExporterCount);
2006+ if (rv != SECSuccess) {
2007+ PRErrorCode err = PR_GetError();
2008+ FPRINTF(stderr,
2009+ "couldn't export keying material: %s\n",
2010+ SECU_Strerror(err));
2011+ }
2012+ }
2013 }
2014
2015 static SECStatus
2016@@ -1313,8 +1334,11 @@ run()
2017 }
2018 if (cipher > 0) {
2019 rv = SSL_CipherPrefSet(s, cipher, SSL_ALLOWED);
2020- if (rv != SECSuccess)
2021+ if (rv != SECSuccess) {
2022 SECU_PrintError(progName, "SSL_CipherPrefSet()");
2023+ error = 1;
2024+ goto done;
2025+ }
2026 } else {
2027 Usage();
2028 }
2029@@ -1732,7 +1756,7 @@ main(int argc, char **argv)
2030 * Please leave some time before reusing these.
2031 */
2032 optstate = PL_CreateOptState(argc, argv,
2033- "46A:BCDEFGHI:J:KL:M:N:OP:QR:STUV:W:X:YZa:bc:d:fgh:m:n:op:qr:st:uvw:");
2034+ "46A:BCDEFGHI:J:KL:M:N:OP:QR:STUV:W:X:YZa:bc:d:fgh:m:n:op:qr:st:uvw:x:");
2035 while ((optstatus = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
2036 switch (optstate->option) {
2037 case '?':
2038@@ -1980,6 +2004,17 @@ main(int argc, char **argv)
2039 Usage();
2040 }
2041 break;
2042+
2043+ case 'x':
2044+ rv = parseExporters(optstate->value,
2045+ &enabledExporters,
2046+ &enabledExporterCount);
2047+ if (rv != SECSuccess) {
2048+ PL_DestroyOptState(optstate);
2049+ fprintf(stderr, "Bad exporter specified.\n");
2050+ Usage();
2051+ }
2052+ break;
2053 }
2054 }
2055 PL_DestroyOptState(optstate);
2056diff --git a/nss/cmd/vfyserv/vfyserv.c b/nss/cmd/vfyserv/vfyserv.c
2057index 4234ecd..3c6d014 100644
2058--- a/nss/cmd/vfyserv/vfyserv.c
2059+++ b/nss/cmd/vfyserv/vfyserv.c
2060@@ -544,7 +544,12 @@ main(int argc, char **argv)
2061 }
2062 }
2063 if (cipher > 0) {
2064- SSL_CipherPrefSetDefault(cipher, PR_TRUE);
2065+ SECStatus rv = SSL_CipherPrefSetDefault(cipher, PR_TRUE);
2066+ if (rv != SECSuccess) {
2067+ SECU_PrintError(progName,
2068+ "error setting cipher default preference");
2069+ goto cleanup;
2070+ }
2071 } else {
2072 Usage(progName);
2073 }
2074diff --git a/nss/coreconf/UNIX.mk b/nss/coreconf/UNIX.mk
2075index b448e75..8f6042e 100644
2076--- a/nss/coreconf/UNIX.mk
2077+++ b/nss/coreconf/UNIX.mk
2078@@ -14,9 +14,7 @@ ifdef BUILD_OPT
2079 DEFINES += -UDEBUG -DNDEBUG
2080 else
2081 OPTIMIZER += -g
2082- USERNAME := $(shell whoami)
2083- USERNAME := $(subst -,_,$(USERNAME))
2084- DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
2085+ DEFINES += -DDEBUG -UNDEBUG
2086 endif
2087
2088 ifdef BUILD_TREE
2089diff --git a/nss/coreconf/WIN32.mk b/nss/coreconf/WIN32.mk
2090index be795f0..7269cc7 100644
2091--- a/nss/coreconf/WIN32.mk
2092+++ b/nss/coreconf/WIN32.mk
2093@@ -104,7 +104,7 @@ endif
2094 DLL_SUFFIX = dll
2095
2096 ifdef NS_USE_GCC
2097- OS_CFLAGS += -mwindows -mms-bitfields
2098+ OS_CFLAGS += -mwindows
2099 _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
2100 DLLFLAGS += -mwindows -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
2101 ifdef BUILD_OPT
2102@@ -116,11 +116,7 @@ ifdef NS_USE_GCC
2103 DEFINES += -UDEBUG -DNDEBUG
2104 else
2105 OPTIMIZER += -g
2106- NULLSTRING :=
2107- SPACE := $(NULLSTRING) # end of the line
2108- USERNAME := $(subst $(SPACE),_,$(USERNAME))
2109- USERNAME := $(subst -,_,$(USERNAME))
2110- DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
2111+ DEFINES += -DDEBUG -UNDEBUG
2112 endif
2113 else # !NS_USE_GCC
2114 WARNING_CFLAGS = -W3 -nologo -D_CRT_SECURE_NO_WARNINGS \
2115@@ -179,10 +175,7 @@ else # !NS_USE_GCC
2116 else
2117 OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od
2118 NULLSTRING :=
2119- SPACE := $(NULLSTRING) # end of the line
2120- USERNAME := $(subst $(SPACE),_,$(USERNAME))
2121- USERNAME := $(subst -,_,$(USERNAME))
2122- DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
2123+ DEFINES += -DDEBUG -UNDEBUG
2124 DLLFLAGS += -DEBUG -OUT:$@
2125 LDFLAGS += -DEBUG
2126 ifeq ($(_MSC_VER),$(_MSC_VER_6))
2127diff --git a/nss/coreconf/config.gypi b/nss/coreconf/config.gypi
2128index 2f17c82..f4426ac 100644
2129--- a/nss/coreconf/config.gypi
2130+++ b/nss/coreconf/config.gypi
2131@@ -96,6 +96,7 @@
2132 'cc_is_gcc%': '<(cc_is_gcc)',
2133 'cc_use_gnu_ld%': '<(cc_use_gnu_ld)',
2134 # Some defaults
2135+ 'disable_arm_hw_aes%': 0,
2136 'disable_tests%': 0,
2137 'disable_chachapoly%': 0,
2138 'disable_dbm%': 0,
2139diff --git a/nss/coreconf/nspr.sh b/nss/coreconf/nspr.sh
2140index 325a188..d84674e 100644
2141--- a/nss/coreconf/nspr.sh
2142+++ b/nss/coreconf/nspr.sh
2143@@ -36,15 +36,30 @@ nspr_build()
2144 extra_params+=(--enable-64bit)
2145 fi
2146
2147- echo "NSPR [1/3] configure ..."
2148+ echo "NSPR [1/5] configure ..."
2149 pushd "$nspr_dir" >/dev/null
2150 CFLAGS="$nspr_cflags" CXXFLAGS="$nspr_cxxflags" \
2151 LDFLAGS="$nspr_ldflags" CC="$CC" CXX="$CCC" \
2152 run_verbose ../configure "${extra_params[@]}" "$@"
2153 popd >/dev/null
2154- echo "NSPR [2/3] make ..."
2155+ echo "NSPR [2/5] make ..."
2156 run_verbose make -C "$nspr_dir"
2157- echo "NSPR [3/3] install ..."
2158+
2159+ if [ "$build_nspr_tests" = 1 ]; then
2160+ echo "NSPR [3/5] build tests ..."
2161+ run_verbose make -C "$nspr_dir/pr/tests"
2162+ else
2163+ echo "NSPR [3/5] NOT building tests"
2164+ fi
2165+
2166+ if [[ "$build_nspr_tests" = 1 && "$run_nspr_tests" = 1 ]]; then
2167+ echo "NSPR [4/5] run tests ..."
2168+ run_verbose make -C "$nspr_dir/pr/tests" runtests
2169+ else
2170+ echo "NSPR [4/5] NOT running tests"
2171+ fi
2172+
2173+ echo "NSPR [5/5] install ..."
2174 run_verbose make -C "$nspr_dir" install
2175 }
2176
2177diff --git a/nss/cpputil/freebl_scoped_ptrs.h b/nss/cpputil/freebl_scoped_ptrs.h
2178new file mode 100644
2179index 0000000..2f21ca9
2180--- /dev/null
2181+++ b/nss/cpputil/freebl_scoped_ptrs.h
2182@@ -0,0 +1,33 @@
2183+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2184+/* vim: set ts=2 et sw=2 tw=80: */
2185+/* This Source Code Form is subject to the terms of the Mozilla Public
2186+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
2187+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
2188+
2189+#ifndef freebl_scoped_ptrs_h__
2190+#define freebl_scoped_ptrs_h__
2191+
2192+#include <memory>
2193+#include "blapi.h"
2194+
2195+struct ScopedDelete {
2196+ void operator()(CMACContext* ctx) { CMAC_Destroy(ctx, PR_TRUE); }
2197+};
2198+
2199+template <class T>
2200+struct ScopedMaybeDelete {
2201+ void operator()(T* ptr) {
2202+ if (ptr) {
2203+ ScopedDelete del;
2204+ del(ptr);
2205+ }
2206+ }
2207+};
2208+
2209+#define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x> > Scoped##x
2210+
2211+SCOPED(CMACContext);
2212+
2213+#undef SCOPED
2214+
2215+#endif // freebl_scoped_ptrs_h__
2216diff --git a/nss/cpputil/nss_scoped_ptrs.h b/nss/cpputil/nss_scoped_ptrs.h
2217index 9b1fbb4..3ee7c9e 100644
2218--- a/nss/cpputil/nss_scoped_ptrs.h
2219+++ b/nss/cpputil/nss_scoped_ptrs.h
2220@@ -21,13 +21,19 @@ struct ScopedDelete {
2221 void operator()(CERTCertificateList* list) {
2222 CERT_DestroyCertificateList(list);
2223 }
2224+ void operator()(CERTDistNames* names) { CERT_FreeDistNames(names); }
2225 void operator()(CERTName* name) { CERT_DestroyName(name); }
2226 void operator()(CERTCertList* list) { CERT_DestroyCertList(list); }
2227 void operator()(CERTSubjectPublicKeyInfo* spki) {
2228 SECKEY_DestroySubjectPublicKeyInfo(spki);
2229 }
2230+ void operator()(PK11Context* context) { PK11_DestroyContext(context, true); }
2231+ void operator()(PK11GenericObject* obj) { PK11_DestroyGenericObject(obj); }
2232 void operator()(PK11SlotInfo* slot) { PK11_FreeSlot(slot); }
2233 void operator()(PK11SymKey* key) { PK11_FreeSymKey(key); }
2234+ void operator()(PK11URI* uri) { PK11URI_DestroyURI(uri); }
2235+ void operator()(PLArenaPool* arena) { PORT_FreeArena(arena, PR_FALSE); }
2236+ void operator()(PQGParams* pqg) { PK11_PQG_DestroyParams(pqg); }
2237 void operator()(PRFileDesc* fd) { PR_Close(fd); }
2238 void operator()(SECAlgorithmID* id) { SECOID_DestroyAlgorithmID(id, true); }
2239 void operator()(SECKEYEncryptedPrivateKeyInfo* e) {
2240@@ -39,16 +45,10 @@ struct ScopedDelete {
2241 void operator()(SECKEYPrivateKeyList* list) {
2242 SECKEY_DestroyPrivateKeyList(list);
2243 }
2244- void operator()(PK11URI* uri) { PK11URI_DestroyURI(uri); }
2245- void operator()(PLArenaPool* arena) { PORT_FreeArena(arena, PR_FALSE); }
2246- void operator()(PK11Context* context) { PK11_DestroyContext(context, true); }
2247- void operator()(PK11GenericObject* obj) { PK11_DestroyGenericObject(obj); }
2248- void operator()(PQGParams* pqg) { PK11_PQG_DestroyParams(pqg); }
2249+ void operator()(SECMODModule* module) { SECMOD_DestroyModule(module); }
2250 void operator()(SEC_PKCS12DecoderContext* dcx) {
2251 SEC_PKCS12DecoderFinish(dcx);
2252 }
2253- void operator()(CERTDistNames* names) { CERT_FreeDistNames(names); }
2254- void operator()(SECMODModule* module) { SECMOD_DestroyModule(module); }
2255 };
2256
2257 template <class T>
2258@@ -63,34 +63,35 @@ struct ScopedMaybeDelete {
2259
2260 #define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x> > Scoped##x
2261
2262+SCOPED(CERTCertList);
2263 SCOPED(CERTCertificate);
2264 SCOPED(CERTCertificateList);
2265-SCOPED(CERTCertList);
2266+SCOPED(CERTDistNames);
2267 SCOPED(CERTName);
2268 SCOPED(CERTSubjectPublicKeyInfo);
2269+SCOPED(PK11Context);
2270+SCOPED(PK11GenericObject);
2271 SCOPED(PK11SlotInfo);
2272 SCOPED(PK11SymKey);
2273+SCOPED(PK11URI);
2274+SCOPED(PLArenaPool);
2275 SCOPED(PQGParams);
2276 SCOPED(PRFileDesc);
2277 SCOPED(SECAlgorithmID);
2278-SCOPED(SECKEYEncryptedPrivateKeyInfo);
2279 SCOPED(SECItem);
2280-SCOPED(SECKEYPublicKey);
2281+SCOPED(SECKEYEncryptedPrivateKeyInfo);
2282 SCOPED(SECKEYPrivateKey);
2283 SCOPED(SECKEYPrivateKeyList);
2284-SCOPED(PK11URI);
2285-SCOPED(PLArenaPool);
2286-SCOPED(PK11Context);
2287-SCOPED(PK11GenericObject);
2288-SCOPED(SEC_PKCS12DecoderContext);
2289-SCOPED(CERTDistNames);
2290+SCOPED(SECKEYPublicKey);
2291 SCOPED(SECMODModule);
2292+SCOPED(SEC_PKCS12DecoderContext);
2293
2294 #undef SCOPED
2295
2296 struct StackSECItem : public SECItem {
2297 StackSECItem() : SECItem({siBuffer, nullptr, 0}) {}
2298- ~StackSECItem() { SECITEM_FreeItem(this, PR_FALSE); }
2299+ ~StackSECItem() { Reset(); }
2300+ void Reset() { SECITEM_FreeItem(this, PR_FALSE); }
2301 };
2302
2303 #endif // nss_scoped_ptrs_h__
2304diff --git a/nss/cpputil/scoped_ptrs_util.h b/nss/cpputil/scoped_ptrs_util.h
2305index dc6e1d7..d0a42ee 100644
2306--- a/nss/cpputil/scoped_ptrs_util.h
2307+++ b/nss/cpputil/scoped_ptrs_util.h
2308@@ -37,4 +37,9 @@ SCOPED(PLArenaPool);
2309
2310 #undef SCOPED
2311
2312+struct StackSECItem : public SECItem {
2313+ StackSECItem() : SECItem({siBuffer, nullptr, 0}) {}
2314+ ~StackSECItem() { SECITEM_FreeItem(this, PR_FALSE); }
2315+};
2316+
2317 #endif // scoped_ptrs_util_h__
2318diff --git a/nss/cpputil/tls_parser.h b/nss/cpputil/tls_parser.h
2319index 2aa7a0e..015bd20 100644
2320--- a/nss/cpputil/tls_parser.h
2321+++ b/nss/cpputil/tls_parser.h
2322@@ -47,6 +47,7 @@ const uint8_t kTlsAlertIllegalParameter = 47;
2323 const uint8_t kTlsAlertDecodeError = 50;
2324 const uint8_t kTlsAlertDecryptError = 51;
2325 const uint8_t kTlsAlertProtocolVersion = 70;
2326+const uint8_t kTlsAlertInsufficientSecurity = 71;
2327 const uint8_t kTlsAlertInternalError = 80;
2328 const uint8_t kTlsAlertInappropriateFallback = 86;
2329 const uint8_t kTlsAlertMissingExtension = 109;
2330diff --git a/nss/fuzz/fuzz.gyp b/nss/fuzz/fuzz.gyp
2331index 91e9b25..292930a 100644
2332--- a/nss/fuzz/fuzz.gyp
2333+++ b/nss/fuzz/fuzz.gyp
2334@@ -43,6 +43,7 @@
2335 '<(DEPTH)/lib/pkcs7/pkcs7.gyp:pkcs7',
2336 # This is a static build of pk11wrap, softoken, and freebl.
2337 '<(DEPTH)/lib/pk11wrap/pk11wrap.gyp:pk11wrap_static',
2338+ '<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
2339 ],
2340 'cflags_cc': [
2341 '-Wno-error=shadow',
2342diff --git a/nss/gtests/common/testvectors/curve25519-vectors.h b/nss/gtests/common/testvectors/curve25519-vectors.h
2343index de44444..bf350cf 100644
2344--- a/nss/gtests/common/testvectors/curve25519-vectors.h
2345+++ b/nss/gtests/common/testvectors/curve25519-vectors.h
2346@@ -48,9 +48,9 @@ const curve25519_testvector kCurve25519Vectors[] = {
2347 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a},
2348 {0x30, 0x38, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
2349 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01,
2350- 0x03, 0x20, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3, 0x5b,
2351- 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78,
2352- 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f},
2353+ 0x03, 0x20, 0x00, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3,
2354+ 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
2355+ 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b},
2356 {},
2357 false},
2358
2359@@ -70,6 +70,66 @@ const curve25519_testvector kCurve25519Vectors[] = {
2360 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
2361 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f, 0x34},
2362 {},
2363+ false},
2364+
2365+ // A private key with leading zeros (they should not be stripped)
2366+ {{0x30, 0x67, 0x02, 0x01, 0x00, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48,
2367+ 0xce, 0x3d, 0x02, 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda,
2368+ 0x47, 0x0f, 0x01, 0x04, 0x4c, 0x30, 0x4a, 0x02, 0x01, 0x01, 0x04, 0x20,
2369+ 0x00, 0x99, 0xD1, 0x90, 0x60, 0xCF, 0x79, 0xF0, 0x6F, 0x4F, 0x2E, 0x47,
2370+ 0x97, 0x5B, 0x2A, 0x90, 0x01, 0x6C, 0x94, 0xF4, 0x3D, 0x94, 0x02, 0x57,
2371+ 0x13, 0xDB, 0xB2, 0xA3, 0xD9, 0x54, 0x0B, 0xE5, 0xa1, 0x23, 0x03, 0x21,
2372+ 0x05, 0x66, 0xA7, 0x26, 0xE0, 0xFC, 0x83, 0xEF, 0xA2, 0x56, 0xF4, 0xCC,
2373+ 0xEA, 0x71, 0x07, 0x4D, 0xBB, 0x5C, 0x76, 0x0A, 0x9F, 0xF4, 0x7E, 0x5C,
2374+ 0x5D, 0x4C, 0xB8, 0xDA, 0x9E, 0x44, 0x60, 0x52, 0x00},
2375+ {0x30, 0x39, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
2376+ 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01,
2377+ 0x03, 0x21, 0x00, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3,
2378+ 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
2379+ 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f},
2380+ {0xB9, 0x4B, 0x92, 0xEA, 0xDA, 0x64, 0x40, 0xD3, 0x08, 0x63, 0x06,
2381+ 0x45, 0xF4, 0x4C, 0xCD, 0x19, 0x7B, 0xE6, 0x0A, 0xBC, 0x6C, 0x9D,
2382+ 0x96, 0x8F, 0x5D, 0x70, 0x44, 0x55, 0xD0, 0x1B, 0xEE, 0x4A},
2383+ true},
2384+
2385+ // A private key that's too short
2386+ {{0x30, 0x66, 0x02, 0x01, 0x00, 0x30, 0x14, 0x06, 0x07, 0x2A, 0x86, 0x48,
2387+ 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA,
2388+ 0x47, 0x0F, 0x01, 0x04, 0x4B, 0x30, 0x49, 0x02, 0x01, 0x01, 0x04, 0x1F,
2389+ 0x07, 0x6D, 0x0A, 0x73, 0x18, 0xA5, 0x7D, 0x3C, 0x16, 0xC1, 0x72, 0x51,
2390+ 0xB2, 0x66, 0x45, 0xDF, 0x4C, 0x2F, 0x87, 0xEB, 0xC0, 0x99, 0x2A, 0xB1,
2391+ 0x77, 0xFB, 0xA5, 0x1D, 0xB9, 0x2C, 0x2A, 0xA1, 0x23, 0x03, 0x21, 0x00,
2392+ 0x85, 0x20, 0xF0, 0x09, 0x89, 0x30, 0xA7, 0x54, 0x74, 0x8B, 0x7D, 0xDC,
2393+ 0xB4, 0x3E, 0xF7, 0x5A, 0x0D, 0xBF, 0x3A, 0x0D, 0x26, 0x38, 0x1A, 0xF4,
2394+ 0xEB, 0xA4, 0xA9, 0x8E, 0xAA, 0x9B, 0x4E, 0x6A},
2395+ {0x30, 0x39, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
2396+ 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01,
2397+ 0x03, 0x21, 0x00, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3,
2398+ 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
2399+ 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f},
2400+ {0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1, 0x72, 0x8e, 0x3b,
2401+ 0xf4, 0x80, 0x35, 0x0f, 0x25, 0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1,
2402+ 0x9e, 0x33, 0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42},
2403+ false},
2404+
2405+ // A private key that's too long
2406+ {{0x30, 0x68, 0x02, 0x01, 0x00, 0x30, 0x14, 0x06, 0x07, 0x2A, 0x86, 0x48,
2407+ 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA,
2408+ 0x47, 0x0F, 0x01, 0x04, 0x4D, 0x30, 0x4B, 0x02, 0x01, 0x01, 0x04, 0x21,
2409+ 0x43, 0x77, 0x07, 0x6D, 0x0A, 0x73, 0x18, 0xA5, 0x7D, 0x3C, 0x16, 0xC1,
2410+ 0x72, 0x51, 0xB2, 0x66, 0x45, 0xDF, 0x4C, 0x2F, 0x87, 0xEB, 0xC0, 0x99,
2411+ 0x2A, 0xB1, 0x77, 0xFB, 0xA5, 0x1D, 0xB9, 0x2C, 0x2A, 0xA1, 0x23, 0x03,
2412+ 0x21, 0x00, 0x85, 0x20, 0xF0, 0x09, 0x89, 0x30, 0xA7, 0x54, 0x74, 0x8B,
2413+ 0x7D, 0xDC, 0xB4, 0x3E, 0xF7, 0x5A, 0x0D, 0xBF, 0x3A, 0x0D, 0x26, 0x38,
2414+ 0x1A, 0xF4, 0xEB, 0xA4, 0xA9, 0x8E, 0xAA, 0x9B, 0x4E, 0x6A},
2415+ {0x30, 0x39, 0x30, 0x14, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
2416+ 0x01, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01,
2417+ 0x03, 0x21, 0x00, 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3,
2418+ 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b,
2419+ 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f},
2420+ {0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1, 0x72, 0x8e, 0x3b,
2421+ 0xf4, 0x80, 0x35, 0x0f, 0x25, 0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1,
2422+ 0x9e, 0x33, 0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42},
2423 false}};
2424
2425 // Testvectors from project wycheproof
2426diff --git a/nss/gtests/common/testvectors/kw-vectors.h b/nss/gtests/common/testvectors/kw-vectors.h
2427new file mode 100644
2428index 0000000..38e641a
2429--- /dev/null
2430+++ b/nss/gtests/common/testvectors/kw-vectors.h
2431@@ -0,0 +1,1940 @@
2432+/* vim: set ts=2 et sw=2 tw=80: */
2433+/* This Source Code Form is subject to the terms of the Mozilla Public
2434+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
2435+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
2436+
2437+#ifndef kw_vectors_h__
2438+#define kw_vectors_h__
2439+
2440+#include <string>
2441+#include <vector>
2442+#include <map>
2443+
2444+/* The result struct adds some granularity to what we are testing.
2445+ * With the single "valid" boolean, we don't know whether the function under
2446+ * test itself is expected to fail (i.e. return SECFailure), or if we simply
2447+ * expect the output to differ from what's in the test vector. Therefore,
2448+ * each vector contains a map of Actions (i.e. NSS capabilities that we wish to
2449+ * test) mapping to expected Result values (both in terms of return code as
2450+ * well as whether or not the output should match the test vector).
2451+ *
2452+ * - If |output_match| is true, the function under test MUST return the same
2453+ * data (length and contents).
2454+ * - If |output_match| is false, the function under test MUST NOT return the
2455+ * same data (length or contents must be different).
2456+ */
2457+
2458+typedef struct Result {
2459+ SECStatus expect_rv;
2460+ bool output_match;
2461+} Result;
2462+
2463+enum Action { WRAP, UNWRAP };
2464+
2465+typedef struct keywrap_vector {
2466+ uint32_t test_id;
2467+ std::vector<uint8_t> key;
2468+ std::vector<uint8_t> msg;
2469+ std::vector<uint8_t> ct;
2470+ std::map<Action, Result> tests;
2471+} keywrap_vector;
2472+
2473+const keywrap_vector kWycheproofAesKWVectors[] = {
2474+ {1,
2475+ {0x6f, 0x67, 0x48, 0x6d, 0x1e, 0x91, 0x44, 0x19, 0xcb, 0x43, 0xc2, 0x85,
2476+ 0x09, 0xc7, 0xc1, 0xea},
2477+ {0x8d, 0xc0, 0x63, 0x2d, 0x92, 0xee, 0x0b, 0xe4, 0xf7, 0x40, 0x02, 0x84,
2478+ 0x10, 0xb0, 0x82, 0x70},
2479+ {0x9d, 0xe4, 0x53, 0xce, 0xd5, 0xd4, 0xab, 0x46, 0xa5, 0x60, 0x17, 0x08,
2480+ 0xee, 0xef, 0xef, 0xb5, 0xe5, 0x93, 0xe6, 0xae, 0x8e, 0x86, 0xb2, 0x6b},
2481+ {{Action::WRAP, {SECSuccess, true}},
2482+ {Action::UNWRAP, {SECSuccess, true}}}},
2483+
2484+ {2,
2485+ {0xa0, 0xb1, 0x71, 0x72, 0xbb, 0x29, 0x6d, 0xb7, 0xf5, 0xc8, 0x69, 0xe9,
2486+ 0xa3, 0x6b, 0x5c, 0xe3},
2487+ {0x61, 0x5d, 0xd0, 0x22, 0xd6, 0x07, 0xc9, 0x10, 0xf2, 0x01, 0x78, 0xcb,
2488+ 0xdf, 0x42, 0x06, 0x0f},
2489+ {0x8c, 0x3a, 0xba, 0x85, 0xcc, 0x0a, 0xe1, 0xae, 0x10, 0xb3, 0x66, 0x58,
2490+ 0xb0, 0x68, 0xf5, 0x95, 0xba, 0xf8, 0xca, 0xaf, 0xb7, 0x45, 0xef, 0x3c},
2491+ {{Action::WRAP, {SECSuccess, true}},
2492+ {Action::UNWRAP, {SECSuccess, true}}}},
2493+
2494+ {3,
2495+ {0x0e, 0x49, 0xd5, 0x71, 0xc1, 0x9b, 0x52, 0x50, 0xef, 0xfd, 0x41, 0xd9,
2496+ 0x4b, 0xde, 0x39, 0xd6},
2497+ {0xf2, 0x5e, 0x4d, 0xe8, 0xca, 0xca, 0x36, 0x3f, 0xd5, 0xf2, 0x94, 0x42,
2498+ 0xeb, 0x14, 0x7b, 0x55},
2499+ {0x1d, 0xe0, 0x93, 0x65, 0x48, 0x26, 0xf1, 0x8f, 0xcd, 0x0f, 0x3f, 0xd4,
2500+ 0x99, 0x41, 0x6f, 0xf2, 0x2e, 0xd7, 0x5e, 0xe1, 0x2f, 0xe0, 0xb6, 0x24},
2501+ {{Action::WRAP, {SECSuccess, true}},
2502+ {Action::UNWRAP, {SECSuccess, true}}}},
2503+
2504+ {4, // wrapped key is longer than wrapping key
2505+ {0xe0, 0xe1, 0x29, 0x59, 0x10, 0x91, 0x03, 0xe3, 0x0a, 0xe8, 0xb5, 0x68,
2506+ 0x4a, 0x22, 0xe6, 0x62},
2507+ {0xdb, 0xb0, 0xf2, 0xbb, 0x2b, 0xe9, 0x12, 0xa2, 0x04, 0x30, 0x97, 0x2d,
2508+ 0x98, 0x42, 0xce, 0x3f, 0xd3, 0xb9, 0x28, 0xe5, 0x73, 0xe1, 0xac, 0x8e},
2509+ {0x9c, 0x3d, 0xdc, 0x23, 0x82, 0x7b, 0x7b, 0x3c, 0x13, 0x10, 0x5f,
2510+ 0x9e, 0x8b, 0x11, 0x52, 0x3b, 0xac, 0xcd, 0xfb, 0x6c, 0x8b, 0x7e,
2511+ 0x78, 0x25, 0x49, 0x6e, 0x7a, 0x84, 0x0b, 0xd3, 0x2a, 0xec},
2512+ {{Action::WRAP, {SECSuccess, true}},
2513+ {Action::UNWRAP, {SECSuccess, true}}}},
2514+
2515+ {5, // wrapped key is longer than wrapping key
2516+ {0xdd, 0x58, 0x3d, 0x9f, 0x10, 0x59, 0x86, 0x14, 0x30, 0xec, 0x8b, 0x5d,
2517+ 0x8a, 0x18, 0x0e, 0x9b},
2518+ {0xf2, 0xe3, 0x4f, 0x35, 0x63, 0x62, 0xa3, 0x1b, 0x51, 0xd6, 0xe0, 0x2b,
2519+ 0xcd, 0x33, 0x3c, 0x9e, 0x61, 0x70, 0x49, 0x4c, 0xa5, 0xff, 0x54, 0x87},
2520+ {0xaf, 0xb7, 0x44, 0xaa, 0xf7, 0x46, 0xdc, 0xc0, 0xb5, 0x7f, 0x8b,
2521+ 0x37, 0x8c, 0x40, 0x4c, 0xbe, 0x87, 0x7f, 0x44, 0xcf, 0x3d, 0x45,
2522+ 0x14, 0x0d, 0x60, 0x81, 0x4e, 0xda, 0x3f, 0x54, 0x1f, 0x01},
2523+ {{Action::WRAP, {SECSuccess, true}},
2524+ {Action::UNWRAP, {SECSuccess, true}}}},
2525+
2526+ {6, // wrapped key is longer than wrapping key
2527+ {0xfa, 0xf5, 0xcc, 0xfa, 0xe4, 0x2b, 0x43, 0xce, 0xe2, 0xc5, 0xf0, 0xf3,
2528+ 0x17, 0x7a, 0x7c, 0x5d},
2529+ {0x4e, 0x02, 0x08, 0x48, 0x33, 0x66, 0x0c, 0x46, 0x38, 0x30, 0x48, 0x3b,
2530+ 0x36, 0xda, 0xb8, 0x66, 0xc6, 0x4c, 0x8c, 0xf7, 0x42, 0x9c, 0xac, 0x3d},
2531+ {0xcf, 0xf9, 0x8c, 0xd6, 0x4c, 0xb5, 0x1a, 0xb9, 0x9b, 0x81, 0xae,
2532+ 0xe8, 0x2c, 0xee, 0x42, 0x74, 0xd0, 0xdf, 0x3e, 0x1b, 0x6a, 0x49,
2533+ 0x43, 0xd3, 0x92, 0x36, 0xea, 0x98, 0x98, 0x46, 0xd0, 0xcc},
2534+ {{Action::WRAP, {SECSuccess, true}},
2535+ {Action::UNWRAP, {SECSuccess, true}}}},
2536+
2537+ {7, // wrapped key is longer than wrapping key
2538+ {0xc2, 0xb9, 0xd2, 0x3f, 0x28, 0x31, 0xdd, 0xcd, 0xeb, 0x45, 0x68, 0x53,
2539+ 0xd4, 0x01, 0x4d, 0xb9},
2540+ {0xf4, 0xcf, 0xea, 0x98, 0xe5, 0x8b, 0x93, 0x9c, 0xc8, 0x59, 0x55,
2541+ 0x43, 0x85, 0xcf, 0x3a, 0x6c, 0x7f, 0x82, 0x17, 0xf7, 0x28, 0xef,
2542+ 0xb4, 0x31, 0xc9, 0x64, 0x78, 0x6d, 0xe8, 0x27, 0x49, 0x07},
2543+ {0x58, 0xdc, 0xfb, 0x0e, 0x7e, 0xc4, 0xd3, 0xbc, 0x80, 0x03,
2544+ 0x41, 0x8d, 0x86, 0x5f, 0xbd, 0x52, 0x0c, 0x6b, 0x24, 0xb2,
2545+ 0xbd, 0xe3, 0x5b, 0x1b, 0xe5, 0xb1, 0xc5, 0xff, 0x32, 0xa1,
2546+ 0x30, 0xf3, 0x3d, 0x03, 0x5e, 0x59, 0x32, 0x61, 0x60, 0x83},
2547+ {{Action::WRAP, {SECSuccess, true}},
2548+ {Action::UNWRAP, {SECSuccess, true}}}},
2549+
2550+ {8, // wrapped key is longer than wrapping key
2551+ {0x62, 0x0a, 0x08, 0xf3, 0x20, 0xcd, 0xed, 0xbf, 0x7a, 0xe5, 0x51, 0xad,
2552+ 0xd3, 0x48, 0xd9, 0x5e},
2553+ {0xce, 0xc3, 0x4e, 0xaf, 0x8e, 0x67, 0xe1, 0xce, 0x61, 0x9d, 0xdf,
2554+ 0xc3, 0x09, 0x53, 0x1c, 0x42, 0xf1, 0x60, 0x33, 0xa7, 0xe2, 0xcb,
2555+ 0xc4, 0xf5, 0xeb, 0x3a, 0x54, 0x81, 0x64, 0xe9, 0xb2, 0x91},
2556+ {0x4e, 0xe4, 0x7b, 0xd6, 0x8d, 0x41, 0x85, 0x86, 0xc4, 0x47,
2557+ 0xa3, 0x91, 0x11, 0xe2, 0xec, 0x15, 0x02, 0xff, 0x0f, 0x17,
2558+ 0x26, 0xea, 0x91, 0xc5, 0xd9, 0x73, 0x70, 0x40, 0x9d, 0x89,
2559+ 0xb8, 0xe6, 0x6e, 0x88, 0x9b, 0x63, 0x8a, 0xc4, 0x0c, 0xed},
2560+ {{Action::WRAP, {SECSuccess, true}},
2561+ {Action::UNWRAP, {SECSuccess, true}}}},
2562+
2563+ {9, // wrapped key is longer than wrapping key
2564+ {0xed, 0x08, 0x9a, 0xc2, 0x74, 0xf8, 0xc7, 0xce, 0xa2, 0x41, 0x56, 0x71,
2565+ 0xa9, 0x4b, 0x5e, 0x53},
2566+ {0x60, 0x65, 0xe4, 0x1d, 0xf1, 0x4d, 0xae, 0xee, 0xfa, 0xca, 0xc5,
2567+ 0xda, 0xeb, 0x76, 0x74, 0xcd, 0xc9, 0xc1, 0xf6, 0x86, 0x01, 0x3b,
2568+ 0x79, 0x71, 0x53, 0xe8, 0x0e, 0xf2, 0x15, 0x89, 0x32, 0x99},
2569+ {0xd3, 0xb0, 0x93, 0xfd, 0x82, 0x2c, 0xe4, 0x54, 0xeb, 0xc2,
2570+ 0x51, 0xc6, 0xf2, 0x1f, 0xa7, 0x1c, 0x38, 0x58, 0xee, 0x7e,
2571+ 0x62, 0x3e, 0xcb, 0xfb, 0xbf, 0x88, 0x73, 0x98, 0xa3, 0x0b,
2572+ 0x40, 0xc5, 0x5d, 0x05, 0x65, 0xc7, 0xa1, 0x5e, 0x40, 0x15},
2573+ {{Action::WRAP, {SECSuccess, true}},
2574+ {Action::UNWRAP, {SECSuccess, true}}}},
2575+
2576+ {10, // Round counter overflows 256
2577+ {0x31, 0xca, 0xcb, 0xb1, 0x7d, 0x6d, 0xbb, 0xec, 0xae, 0x40, 0x72, 0x7c,
2578+ 0x50, 0x48, 0xfe, 0x0c},
2579+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2580+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2581+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2582+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2583+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2584+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2585+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2586+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2587+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2588+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2589+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2590+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2591+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2592+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2593+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2594+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2595+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2596+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2597+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2598+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2599+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2600+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2601+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2602+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2603+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2604+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2605+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2606+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2607+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2608+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2609+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2610+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
2611+ {0x22, 0x2d, 0xea, 0xdd, 0xe6, 0xef, 0xb7, 0x60, 0xca, 0xe4, 0x2f, 0xa1,
2612+ 0x88, 0x31, 0x0e, 0x0c, 0x07, 0xe7, 0xd5, 0x57, 0x52, 0x97, 0x66, 0x44,
2613+ 0x4a, 0x9e, 0xfb, 0x33, 0x09, 0x07, 0xd4, 0x2f, 0x0d, 0xd8, 0xf3, 0xd1,
2614+ 0x7b, 0x3a, 0x38, 0xbf, 0x40, 0xd6, 0x8c, 0x09, 0x5a, 0x9c, 0xce, 0x19,
2615+ 0xda, 0xf9, 0x07, 0xbf, 0x2c, 0x92, 0xf1, 0xe5, 0x9b, 0x18, 0xb2, 0x77,
2616+ 0xff, 0x03, 0x97, 0xfc, 0x50, 0xf4, 0x5f, 0x58, 0x2d, 0xb9, 0x36, 0xaa,
2617+ 0x8a, 0xfb, 0x94, 0x3d, 0xe0, 0x1b, 0x58, 0xab, 0xfd, 0xc8, 0x1d, 0xae,
2618+ 0xf4, 0xe0, 0x38, 0xc9, 0x9e, 0x4c, 0x1e, 0xb3, 0xee, 0x44, 0x74, 0x64,
2619+ 0xbb, 0x8f, 0x89, 0xa4, 0xea, 0x81, 0xe5, 0x65, 0x56, 0xcc, 0x26, 0xc7,
2620+ 0x28, 0x83, 0xc0, 0x6a, 0x7f, 0xe8, 0x50, 0xd0, 0x43, 0x47, 0xd6, 0x8b,
2621+ 0xba, 0xdc, 0x4a, 0x06, 0x77, 0x50, 0x30, 0x67, 0x6d, 0xb8, 0xcc, 0x34,
2622+ 0xae, 0xb0, 0x7e, 0x39, 0xc7, 0xf0, 0x59, 0xc2, 0xbf, 0xf7, 0x6a, 0x7f,
2623+ 0x2b, 0xaf, 0x07, 0x67, 0x49, 0x00, 0x4e, 0xf7, 0x18, 0x9f, 0x88, 0x7f,
2624+ 0x89, 0x02, 0x9f, 0x88, 0xc5, 0xc1, 0xd0, 0xf5, 0xee, 0x62, 0x32, 0x0b,
2625+ 0x42, 0x30, 0x48, 0xe2, 0xad, 0x81, 0x86, 0xe6, 0x3b, 0xe2, 0x3c, 0x55,
2626+ 0x3f, 0x55, 0x76, 0xa4, 0x0d, 0x96, 0x7e, 0x8b, 0x52, 0x7c, 0xcd, 0x78,
2627+ 0x3c, 0x41, 0xab, 0xc6, 0x4b, 0xea, 0x1a, 0xec, 0x8a, 0x76, 0xde, 0xb3,
2628+ 0xe9, 0xc9, 0xa6, 0x65, 0x67, 0x56, 0xe1, 0xda, 0xc3, 0x8b, 0xd2, 0x5f,
2629+ 0xf0, 0x08, 0x88, 0x8a, 0x55, 0x91, 0xaf, 0x76, 0x3f, 0xd7, 0x3f, 0x5a,
2630+ 0xdd, 0xd7, 0x49, 0x79, 0x48, 0x17, 0x07, 0x09, 0x90, 0x48, 0x46, 0x54,
2631+ 0xa4, 0x6e, 0xf4, 0x42, 0xad, 0xae, 0xac, 0xab, 0x14, 0xd1, 0x2d, 0xaa,
2632+ 0xf8, 0x7b, 0xcb, 0x91, 0x66, 0x1a, 0x21, 0x59, 0x37, 0x17, 0xd9, 0xb9,
2633+ 0x35, 0x29, 0xd8, 0x13, 0xea, 0x5f, 0xc8, 0x12, 0xd7, 0x08, 0xc0, 0xd8,
2634+ 0xe9, 0xb6, 0x81, 0x22, 0xd9, 0xf5, 0xe6, 0x26, 0x7c, 0xde, 0x36, 0x37,
2635+ 0x80, 0xa4, 0x5d, 0x07, 0xe4, 0xca, 0xa5, 0xbf, 0x14, 0xf2, 0x33, 0x4f,
2636+ 0x25, 0xb9, 0xd1, 0x77, 0x63, 0x2b, 0xb8, 0x0a, 0x82, 0x89, 0x4a, 0xa4,
2637+ 0x7b, 0x6f, 0x36, 0x0b, 0x2d, 0xa1, 0x13, 0x8d, 0xed, 0xd4, 0x33, 0x1f,
2638+ 0x07, 0x7c, 0x90, 0x05, 0x54, 0xc7, 0xa6, 0x8b, 0x5d, 0x15, 0x49, 0x80,
2639+ 0xbb, 0x35, 0x17, 0xac, 0x20, 0xa7, 0x8a, 0x51, 0xf6, 0xf2, 0x1e, 0x42,
2640+ 0xb2, 0xc4, 0xc9, 0x60, 0xd3, 0x1c, 0xbd, 0x22, 0xbd, 0x61, 0x08, 0x19,
2641+ 0x18, 0x2c, 0x5e, 0x45, 0x6b, 0xa7, 0xd7, 0xe9, 0x03, 0xf5, 0xe6, 0x0f,
2642+ 0x6e, 0x0c, 0x4c, 0xc0, 0x14, 0xfe, 0xb4, 0xf8, 0x19, 0x73, 0xce, 0x48,
2643+ 0xad, 0x6f, 0x4d, 0xab, 0x8d, 0xa5, 0x1e, 0xb7},
2644+ {{Action::WRAP, {SECSuccess, true}},
2645+ {Action::UNWRAP, {SECSuccess, true}}}},
2646+
2647+ {11, // empty keys cannot be wrapped
2648+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2649+ 0xa7, 0xda, 0x64, 0x95},
2650+ {},
2651+ {0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6},
2652+ {{Action::WRAP, {SECFailure, false}},
2653+ {Action::UNWRAP, {SECFailure, false}}}},
2654+
2655+ {12, // keys of size 8 byte cannot be wrapped
2656+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2657+ 0xa7, 0xda, 0x64, 0x95},
2658+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
2659+ {0xdc, 0x26, 0xfb, 0x69, 0x11, 0xd7, 0x19, 0x71, 0xdf, 0x03, 0x56, 0xd6,
2660+ 0xbb, 0x9e, 0xd6, 0xe6},
2661+ {{Action::WRAP, {SECFailure, false}},
2662+ {Action::UNWRAP, {SECFailure, false}}}},
2663+
2664+ {13, // wrapped key size must be divisible by 8
2665+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2666+ 0xa7, 0xda, 0x64, 0x95},
2667+ {0x00},
2668+ {},
2669+ {{Action::WRAP, {SECFailure, false}},
2670+ {Action::UNWRAP, {SECFailure, false}}}},
2671+
2672+ {14, // wrapped key size must be divisible by 8
2673+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2674+ 0xa7, 0xda, 0x64, 0x95},
2675+ {0x00, 0x01},
2676+ {},
2677+ {{Action::WRAP, {SECFailure, false}},
2678+ {Action::UNWRAP, {SECFailure, false}}}},
2679+
2680+ {15, // wrapped key size must be divisible by 8
2681+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2682+ 0xa7, 0xda, 0x64, 0x95},
2683+ {0x00, 0x01, 0x02},
2684+ {},
2685+ {{Action::WRAP, {SECFailure, false}},
2686+ {Action::UNWRAP, {SECFailure, false}}}},
2687+
2688+ {16, // wrapped key size must be divisible by 8
2689+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2690+ 0xa7, 0xda, 0x64, 0x95},
2691+ {0x00, 0x01, 0x02, 0x03},
2692+ {},
2693+ {{Action::WRAP, {SECFailure, false}},
2694+ {Action::UNWRAP, {SECFailure, false}}}},
2695+
2696+ {17, // wrapped key size must be divisible by 8
2697+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2698+ 0xa7, 0xda, 0x64, 0x95},
2699+ {0x00, 0x01, 0x02, 0x03, 0x04},
2700+ {},
2701+ {{Action::WRAP, {SECFailure, false}},
2702+ {Action::UNWRAP, {SECFailure, false}}}},
2703+
2704+ {18, // wrapped key size must be divisible by 8
2705+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2706+ 0xa7, 0xda, 0x64, 0x95},
2707+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05},
2708+ {},
2709+ {{Action::WRAP, {SECFailure, false}}}},
2710+
2711+ {19, // wrapped key size must be divisible by 8
2712+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2713+ 0xa7, 0xda, 0x64, 0x95},
2714+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06},
2715+ {},
2716+ {{Action::WRAP, {SECFailure, false}},
2717+ {Action::UNWRAP, {SECFailure, false}}}},
2718+
2719+ {20, // wrapped key size must be divisible by 8
2720+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
2721+ 0xa7, 0xda, 0x64, 0x95},
2722+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
2723+ 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
2724+ {},
2725+ {{Action::WRAP, {SECFailure, false}},
2726+ {Action::UNWRAP, {SECFailure, false}}}},
2727+
2728+ {21, // invalid size of wrapped key
2729+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
2730+ 0xe8, 0x21, 0x82, 0xf7},
2731+ {},
2732+ {},
2733+ {{Action::WRAP, {SECFailure, false}},
2734+ {Action::UNWRAP, {SECFailure, false}}}},
2735+
2736+ {22, // invalid size of wrapped key
2737+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
2738+ 0xe8, 0x21, 0x82, 0xf7},
2739+ {},
2740+ {0x9f},
2741+ {{Action::WRAP, {SECFailure, false}},
2742+ {Action::UNWRAP, {SECFailure, false}}}},
2743+
2744+ {23, // invalid size of wrapped key
2745+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
2746+ 0xe8, 0x21, 0x82, 0xf7},
2747+ {},
2748+ {0xdc, 0x9e, 0x95, 0x80},
2749+ {{Action::WRAP, {SECFailure, false}},
2750+ {Action::UNWRAP, {SECFailure, false}}}},
2751+
2752+ {24, // invalid size of wrapped key
2753+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
2754+ 0xe8, 0x21, 0x82, 0xf7},
2755+ {},
2756+ {0xb9, 0xb2, 0x82, 0xd1, 0x38, 0x69, 0x30, 0x00},
2757+ {{Action::WRAP, {SECFailure, false}},
2758+ {Action::UNWRAP, {SECFailure, false}}}},
2759+
2760+ {25, // invalid size of wrapped key
2761+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
2762+ 0xe8, 0x21, 0x82, 0xf7},
2763+ {},
2764+ {0x0e, 0xfc, 0x63, 0x5b, 0x2d, 0x61, 0xe2, 0x44, 0x05, 0x6b, 0x9d, 0x45,
2765+ 0x91, 0xca, 0x6b},
2766+ {{Action::WRAP, {SECFailure, false}},
2767+ {Action::UNWRAP, {SECFailure, false}}}},
2768+
2769+ {26, // invalid size of wrapped key
2770+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
2771+ 0xe8, 0x21, 0x82, 0xf7},
2772+ {},
2773+ {0x4a, 0x30, 0x5d, 0xae, 0x08, 0x7b, 0x0d, 0x24, 0xd6, 0x2a, 0xf4, 0x18,
2774+ 0x31, 0x33, 0x8f, 0x33, 0xae},
2775+ {{Action::WRAP, {SECFailure, false}},
2776+ {Action::UNWRAP, {SECFailure, false}}}},
2777+
2778+ {27, // invalid size of wrapped key
2779+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
2780+ 0xe8, 0x21, 0x82, 0xf7},
2781+ {},
2782+ {0x82, 0xcb, 0x92, 0x70, 0x97, 0xcf, 0x31, 0xea, 0x4a, 0xff,
2783+ 0xea, 0x44, 0x0b, 0x0d, 0x8c, 0xa6, 0xa2, 0x40, 0xb9, 0x00},
2784+ {{Action::WRAP, {SECFailure, false}},
2785+ {Action::UNWRAP, {SECFailure, false}}}},
2786+
2787+ {28, // bytes appended to wrapped key
2788+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
2789+ 0xe8, 0x21, 0x82, 0xf7},
2790+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
2791+ 0x0c, 0x0d, 0x0e, 0x0f},
2792+ {0x97, 0x90, 0xab, 0x51, 0xfb, 0xcb, 0x85, 0x0d, 0xf6, 0x76, 0x4e, 0x01,
2793+ 0x1a, 0xe9, 0x7c, 0x85, 0x78, 0x5b, 0xed, 0x26, 0x33, 0xae, 0xa6, 0x65},
2794+ {{Action::WRAP, {SECSuccess, true}},
2795+ {Action::UNWRAP, {SECSuccess, true}}}},
2796+
2797+ {28, // Bytes appended to wrapped key
2798+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
2799+ 0xe8, 0x21, 0x82, 0xf7},
2800+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
2801+ 0x0c, 0x0d, 0x0e, 0x0f},
2802+ {0x97, 0x90, 0xab, 0x51, 0xfb, 0xcb, 0x85, 0x0d, 0xf6,
2803+ 0x76, 0x4e, 0x01, 0x1a, 0xe9, 0x7c, 0x85, 0x78, 0x5b,
2804+ 0xed, 0x26, 0x33, 0xae, 0xa6, 0x65, 0x00},
2805+ {{Action::UNWRAP, {SECFailure, false}}}},
2806+
2807+ {29, // Incorrect IV
2808+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2809+ 0x52, 0xfa, 0x8b, 0xc1},
2810+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2811+ 0x01, 0xd0, 0x70, 0xa5},
2812+ {0x0a, 0xac, 0x32, 0x9c, 0xcd, 0x51, 0x3e, 0xdb, 0xdd, 0x63, 0x67, 0xdf,
2813+ 0x67, 0x99, 0x9e, 0xaa, 0xc9, 0xe7, 0xb5, 0x19, 0x84, 0xc4, 0xd3, 0x8d},
2814+ {{Action::WRAP, {SECSuccess, false}},
2815+ {Action::UNWRAP, {SECFailure, false}}}},
2816+
2817+ {30, // Incorrect IV
2818+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2819+ 0x52, 0xfa, 0x8b, 0xc1},
2820+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2821+ 0x01, 0xd0, 0x70, 0xa5},
2822+ {0x5a, 0x55, 0xdc, 0x42, 0x97, 0x49, 0xca, 0x49, 0xbb, 0x4a, 0xb0, 0x1d,
2823+ 0x96, 0x6b, 0x19, 0xea, 0x9a, 0x9e, 0x14, 0x02, 0xe6, 0xab, 0x29, 0x62},
2824+ {{Action::WRAP, {SECSuccess, false}},
2825+ {Action::UNWRAP, {SECFailure, false}}}},
2826+
2827+ {31, // Incorrect IV
2828+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2829+ 0x52, 0xfa, 0x8b, 0xc1},
2830+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2831+ 0x01, 0xd0, 0x70, 0xa5},
2832+ {0x45, 0xf5, 0x33, 0xf6, 0x07, 0x2f, 0x64, 0x0e, 0xb7, 0xe1, 0xe5, 0x12,
2833+ 0xd5, 0x60, 0x72, 0x08, 0x55, 0x67, 0xf4, 0xad, 0x60, 0x12, 0xa9, 0x7a},
2834+ {{Action::WRAP, {SECSuccess, false}},
2835+ {Action::UNWRAP, {SECFailure, false}}}},
2836+
2837+ {32, // Incorrect IV
2838+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2839+ 0x52, 0xfa, 0x8b, 0xc1},
2840+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2841+ 0x01, 0xd0, 0x70, 0xa5},
2842+ {0x84, 0xf2, 0x84, 0x56, 0x5d, 0xf4, 0x7c, 0x40, 0x91, 0x07, 0xf7, 0xa0,
2843+ 0xa7, 0x1b, 0xc3, 0x70, 0xa8, 0xed, 0x44, 0x89, 0xd4, 0x14, 0xb9, 0xe9},
2844+ {{Action::WRAP, {SECSuccess, false}},
2845+ {Action::UNWRAP, {SECFailure, false}}}},
2846+
2847+ {33, // Incorrect IV
2848+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2849+ 0x52, 0xfa, 0x8b, 0xc1},
2850+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2851+ 0x01, 0xd0, 0x70, 0xa5},
2852+ {0x39, 0x41, 0xc3, 0x66, 0x55, 0x4f, 0xc8, 0x96, 0xe9, 0xfe, 0x52, 0xf0,
2853+ 0x24, 0x93, 0xca, 0x03, 0xd4, 0x39, 0xeb, 0x17, 0xc2, 0x36, 0x14, 0x6d},
2854+ {{Action::WRAP, {SECSuccess, false}},
2855+ {Action::UNWRAP, {SECFailure, false}}}},
2856+
2857+ {34, // Incorrect IV
2858+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2859+ 0x52, 0xfa, 0x8b, 0xc1},
2860+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2861+ 0x01, 0xd0, 0x70, 0xa5},
2862+ {0x45, 0xc9, 0xd4, 0x23, 0x63, 0xd9, 0x81, 0xd0, 0x86, 0xa9, 0x72, 0x72,
2863+ 0x8e, 0x13, 0x0a, 0x42, 0xf5, 0xdd, 0x90, 0xbd, 0xa5, 0x62, 0xa8, 0x5a},
2864+ {{Action::WRAP, {SECSuccess, false}},
2865+ {Action::UNWRAP, {SECFailure, false}}}},
2866+
2867+ {35, // Incorrect IV
2868+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2869+ 0x52, 0xfa, 0x8b, 0xc1},
2870+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2871+ 0x01, 0xd0, 0x70, 0xa5},
2872+ {0x03, 0x7d, 0x17, 0x85, 0x95, 0x19, 0xd6, 0xc0, 0x72, 0x8a, 0x9e, 0xb6,
2873+ 0xe6, 0x41, 0x13, 0xe8, 0x69, 0x19, 0xde, 0xca, 0xbd, 0x3b, 0xbb, 0x88},
2874+ {{Action::WRAP, {SECSuccess, false}},
2875+ {Action::UNWRAP, {SECFailure, false}}}},
2876+
2877+ {36, // Incorrect IV
2878+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2879+ 0x52, 0xfa, 0x8b, 0xc1},
2880+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2881+ 0x01, 0xd0, 0x70, 0xa5},
2882+ {0x1a, 0xd1, 0x0a, 0xf7, 0xf6, 0xc0, 0x42, 0xb2, 0x67, 0xa0, 0xc7, 0xbc,
2883+ 0x4d, 0x25, 0xd2, 0x7c, 0x00, 0x3d, 0xeb, 0x50, 0xe2, 0xcc, 0x56, 0x6a},
2884+ {{Action::WRAP, {SECSuccess, false}},
2885+ {Action::UNWRAP, {SECFailure, false}}}},
2886+
2887+ {37, // Incorrect IV
2888+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2889+ 0x52, 0xfa, 0x8b, 0xc1},
2890+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2891+ 0x01, 0xd0, 0x70, 0xa5},
2892+ {0x63, 0x0c, 0x57, 0x1b, 0x7f, 0xb8, 0x64, 0x7a, 0xc5, 0x36, 0x0a, 0x25,
2893+ 0x5f, 0x9f, 0x5d, 0x36, 0x45, 0x79, 0x5a, 0xc4, 0x52, 0x85, 0xcb, 0xaa},
2894+ {{Action::WRAP, {SECSuccess, false}},
2895+ {Action::UNWRAP, {SECFailure, false}}}},
2896+
2897+ {38, // Incorrect IV
2898+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2899+ 0x52, 0xfa, 0x8b, 0xc1},
2900+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2901+ 0x01, 0xd0, 0x70, 0xa5},
2902+ {0x16, 0xdb, 0x55, 0x3e, 0x46, 0x7d, 0x40, 0x29, 0xd0, 0xfe, 0xa6, 0x2b,
2903+ 0x2c, 0x44, 0x0e, 0x5d, 0xf6, 0xc6, 0x59, 0x1f, 0x04, 0x97, 0xa9, 0x9d},
2904+ {{Action::WRAP, {SECSuccess, false}},
2905+ {Action::UNWRAP, {SECFailure, false}}}},
2906+
2907+ {39, // Incorrect IV
2908+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2909+ 0x52, 0xfa, 0x8b, 0xc1},
2910+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2911+ 0x01, 0xd0, 0x70, 0xa5},
2912+ {0x09, 0x79, 0x91, 0x09, 0x0a, 0x15, 0x60, 0x47, 0xd4, 0x78, 0x4b, 0x75,
2913+ 0x7f, 0x26, 0x2e, 0x12, 0xce, 0x57, 0xe1, 0x3a, 0x3d, 0x5d, 0x28, 0x6c},
2914+ {{Action::WRAP, {SECSuccess, false}},
2915+ {Action::UNWRAP, {SECFailure, false}}}},
2916+
2917+ {40, // Incorrect IV
2918+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
2919+ 0x52, 0xfa, 0x8b, 0xc1},
2920+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
2921+ 0x01, 0xd0, 0x70, 0xa5},
2922+ {0x39, 0x57, 0xc3, 0x38, 0xb7, 0x50, 0xa3, 0x28, 0x5e, 0xb7, 0xb6, 0x5c,
2923+ 0x9c, 0xfe, 0x77, 0x05, 0x3d, 0xd7, 0xd8, 0x14, 0x9f, 0x42, 0xca, 0xa1},
2924+ {{Action::WRAP, {SECSuccess, false}},
2925+ {Action::UNWRAP, {SECFailure, false}}}},
2926+
2927+ {41, // RFC 3394
2928+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
2929+ 0x0c, 0x0d, 0x0e, 0x0f},
2930+ {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
2931+ 0xcc, 0xdd, 0xee, 0xff},
2932+ {0x1f, 0xa6, 0x8b, 0x0a, 0x81, 0x12, 0xb4, 0x47, 0xae, 0xf3, 0x4b, 0xd8,
2933+ 0xfb, 0x5a, 0x7b, 0x82, 0x9d, 0x3e, 0x86, 0x23, 0x71, 0xd2, 0xcf, 0xe5},
2934+ {{Action::WRAP, {SECSuccess, true}},
2935+ {Action::UNWRAP, {SECSuccess, true}}}},
2936+
2937+ {42,
2938+ {0xf7, 0x5a, 0x2f, 0x49, 0xa6, 0x30, 0xc7, 0xdc, 0x91, 0x62, 0x6b, 0x00,
2939+ 0xce, 0x02, 0x9f, 0x0b, 0xd2, 0x98, 0x1d, 0x7c, 0x74, 0xa9, 0x3e, 0xbe},
2940+ {0x9a, 0xdb, 0xc0, 0x0c, 0x71, 0x0b, 0x11, 0x01, 0xbd, 0xf6, 0xa4, 0xed,
2941+ 0x65, 0xb3, 0x2d, 0x72},
2942+ {0x00, 0xbe, 0x1c, 0xad, 0xdf, 0xd5, 0xad, 0x76, 0x97, 0x87, 0x70, 0x17,
2943+ 0x79, 0x5f, 0x9c, 0xee, 0x4b, 0xce, 0x5a, 0x61, 0x68, 0x7a, 0x61, 0x26},
2944+ {{Action::WRAP, {SECSuccess, true}},
2945+ {Action::UNWRAP, {SECSuccess, true}}}},
2946+
2947+ {43,
2948+ {0xb7, 0x13, 0xf6, 0xb7, 0x81, 0x4f, 0x98, 0x89, 0x4d, 0x7b, 0x15, 0x39,
2949+ 0x74, 0x68, 0x43, 0x59, 0xf1, 0x46, 0x02, 0x13, 0xeb, 0x74, 0xbe, 0x68},
2950+ {0x78, 0x58, 0x5f, 0x0c, 0x49, 0x92, 0x2e, 0x82, 0xca, 0xf1, 0x7e, 0xbc,
2951+ 0x37, 0x21, 0xb4, 0xdb},
2952+ {0x54, 0xe7, 0xf2, 0x78, 0xb5, 0xa1, 0xfb, 0x4c, 0x31, 0xa0, 0xd7, 0x9a,
2953+ 0xc1, 0xf6, 0x15, 0xed, 0xd9, 0x10, 0xbf, 0x22, 0x01, 0x5a, 0x06, 0x68},
2954+ {{Action::WRAP, {SECSuccess, true}},
2955+ {Action::UNWRAP, {SECSuccess, true}}}},
2956+
2957+ {44,
2958+ {0x13, 0xec, 0xf4, 0x23, 0x21, 0x1c, 0xaa, 0x33, 0x4b, 0xa6, 0xdb, 0x37,
2959+ 0x25, 0x9a, 0x53, 0x5c, 0x20, 0xde, 0x8a, 0xd1, 0x0f, 0xc8, 0xc4, 0x32},
2960+ {0x4f, 0xc7, 0x5d, 0x0f, 0x22, 0x1e, 0x22, 0x40, 0x8a, 0x37, 0xe1, 0x12,
2961+ 0x65, 0xd4, 0x9a, 0x05},
2962+ {0x51, 0x04, 0x55, 0xbd, 0x9c, 0x07, 0x8a, 0xc1, 0xf0, 0x7b, 0xb3, 0x75,
2963+ 0x2c, 0xbd, 0x04, 0xe4, 0x21, 0xb0, 0xdd, 0x63, 0x51, 0x90, 0xfa, 0x62},
2964+ {{Action::WRAP, {SECSuccess, true}},
2965+ {Action::UNWRAP, {SECSuccess, true}}}},
2966+
2967+ {45,
2968+ {0x44, 0x17, 0xfb, 0xbe, 0xa5, 0x1b, 0xdd, 0x91, 0x81, 0x8d, 0x74, 0x05,
2969+ 0x19, 0x57, 0xdd, 0x70, 0xe1, 0x35, 0xc5, 0xcf, 0x37, 0x32, 0xbd, 0xf1},
2970+ {0xf5, 0x35, 0x7d, 0xa9, 0xf8, 0xfd, 0x4a, 0x11, 0x90, 0xf3, 0x6e, 0x9f,
2971+ 0xa0, 0x9a, 0x90, 0xfc, 0xf1, 0x4d, 0x87, 0xd6, 0x23, 0x32, 0xf1, 0xa5},
2972+ {0x88, 0x0d, 0xa5, 0xb4, 0x10, 0xf9, 0x13, 0xad, 0x72, 0xcc, 0x93,
2973+ 0xf4, 0x63, 0x44, 0xf1, 0x15, 0x21, 0x65, 0xbd, 0xea, 0x14, 0x66,
2974+ 0x4f, 0xd2, 0xd3, 0xaf, 0xbd, 0x87, 0xb8, 0xcc, 0x5c, 0xfd},
2975+ {{Action::WRAP, {SECSuccess, true}},
2976+ {Action::UNWRAP, {SECSuccess, true}}}},
2977+
2978+ {46,
2979+ {0xb3, 0xf2, 0x6d, 0x8a, 0x22, 0xfd, 0xd6, 0x1f, 0x70, 0x98, 0x41, 0x23,
2980+ 0x1f, 0xbd, 0xe6, 0x95, 0xb3, 0xf2, 0x8d, 0xdd, 0xce, 0xd6, 0xd4, 0x1e},
2981+ {0x0d, 0x0a, 0xf9, 0x55, 0xd2, 0xe3, 0x82, 0x9c, 0xc3, 0xd6, 0x43, 0x21,
2982+ 0x9b, 0x30, 0x1e, 0x64, 0xe0, 0x51, 0x0d, 0xfb, 0xc4, 0x28, 0x11, 0x9a},
2983+ {0x27, 0x65, 0x4c, 0xf6, 0xa6, 0x3d, 0x60, 0x04, 0xae, 0x83, 0xda,
2984+ 0x54, 0xc2, 0xe5, 0xd7, 0xb5, 0xfa, 0xd2, 0x08, 0x78, 0xf3, 0x50,
2985+ 0x08, 0x7d, 0xdd, 0x17, 0xac, 0x44, 0xa2, 0xbe, 0x86, 0x8f},
2986+ {{Action::WRAP, {SECSuccess, true}},
2987+ {Action::UNWRAP, {SECSuccess, true}}}},
2988+
2989+ {47,
2990+ {0xf7, 0x0c, 0xfb, 0x26, 0x2c, 0x72, 0x9a, 0x18, 0x20, 0x6c, 0x8a, 0xfd,
2991+ 0x74, 0x35, 0x6e, 0xc7, 0xe0, 0x49, 0xd1, 0x0b, 0x44, 0xa6, 0xe0, 0x00},
2992+ {0x24, 0x1c, 0xed, 0xfa, 0x64, 0xc4, 0xe7, 0xbe, 0xc5, 0x41, 0xa2, 0xeb,
2993+ 0x4c, 0x36, 0x82, 0x69, 0xe0, 0xf0, 0xdd, 0xeb, 0xc5, 0x82, 0x67, 0xea},
2994+ {0xad, 0x7c, 0xa6, 0x6a, 0xd4, 0x66, 0x4f, 0x43, 0xe4, 0xdd, 0x09,
2995+ 0x29, 0x6a, 0x6e, 0x6f, 0x02, 0xd5, 0xaf, 0x44, 0x08, 0xf2, 0x25,
2996+ 0xc0, 0xab, 0xeb, 0x0d, 0x9b, 0x76, 0xc8, 0xd1, 0xe9, 0x82},
2997+ {{Action::WRAP, {SECSuccess, true}},
2998+ {Action::UNWRAP, {SECSuccess, true}}}},
2999+
3000+ {48, // wrapped key is longer than wrapping key
3001+ {0x16, 0x39, 0xf9, 0xf8, 0x1e, 0x53, 0xe2, 0xee, 0xb6, 0x77, 0xa2, 0x49,
3002+ 0xe5, 0xec, 0xed, 0x3a, 0xf1, 0x08, 0x97, 0x13, 0x01, 0x60, 0x1a, 0x7b},
3003+ {0xec, 0x3c, 0x6a, 0x1f, 0x1a, 0x95, 0x85, 0x32, 0x7f, 0xe6, 0x58,
3004+ 0x49, 0x0c, 0x74, 0x63, 0x5e, 0x53, 0x00, 0x87, 0x6d, 0xa5, 0x84,
3005+ 0x6a, 0x62, 0x93, 0x98, 0x98, 0x4f, 0xb5, 0x51, 0xd6, 0x91},
3006+ {0xe2, 0x45, 0xc9, 0x0a, 0x6b, 0x46, 0xca, 0xec, 0xe9, 0x4f,
3007+ 0x47, 0x11, 0x7d, 0x60, 0x83, 0x31, 0x95, 0x8c, 0x8f, 0x75,
3008+ 0xf5, 0x31, 0xeb, 0xcd, 0xc9, 0x02, 0xc0, 0x21, 0x3d, 0x91,
3009+ 0x05, 0xf2, 0x15, 0x5a, 0xf0, 0x7d, 0xaa, 0x62, 0xd1, 0x32},
3010+ {{Action::WRAP, {SECSuccess, true}},
3011+ {Action::UNWRAP, {SECSuccess, true}}}},
3012+
3013+ {49, // wrapped key is longer than wrapping key
3014+ {0x1f, 0x22, 0xd5, 0x65, 0x8a, 0xa6, 0x85, 0xb8, 0xba, 0x86, 0x59, 0xdc,
3015+ 0x34, 0x28, 0x80, 0xd5, 0xb2, 0x39, 0x9e, 0x6a, 0x81, 0x50, 0x05, 0xb0},
3016+ {0x50, 0xbe, 0x4c, 0x1b, 0x2f, 0x29, 0xa6, 0x3f, 0x44, 0xd7, 0xfc,
3017+ 0x63, 0x73, 0x7f, 0x60, 0x0f, 0x01, 0x94, 0xea, 0x3f, 0xb3, 0x6e,
3018+ 0x17, 0x3d, 0x2d, 0xdd, 0x19, 0xf2, 0x18, 0x65, 0x63, 0x80},
3019+ {0x8a, 0x32, 0xb9, 0xf2, 0x07, 0xae, 0x5a, 0xae, 0xdb, 0x7e,
3020+ 0x8a, 0x0d, 0x94, 0x51, 0x07, 0x41, 0x2c, 0x1b, 0xd0, 0x69,
3021+ 0x99, 0xbc, 0x5a, 0xc8, 0x3c, 0x1f, 0x95, 0x8d, 0xfb, 0x77,
3022+ 0xeb, 0xdc, 0xf9, 0xd9, 0x8c, 0x60, 0xdb, 0xd4, 0x65, 0x0a},
3023+ {{Action::WRAP, {SECSuccess, true}},
3024+ {Action::UNWRAP, {SECSuccess, true}}}},
3025+
3026+ {50, // wrapped key is longer than wrapping key
3027+ {0x3a, 0x2f, 0x4a, 0xa5, 0x04, 0x41, 0x95, 0x4b, 0xba, 0x5a, 0x18, 0x36,
3028+ 0x29, 0x4c, 0xe0, 0x71, 0xf9, 0x29, 0x6b, 0x23, 0xdb, 0xed, 0x67, 0x71},
3029+ {0x65, 0xda, 0x02, 0xff, 0x21, 0xb4, 0x83, 0xa1, 0xe3, 0x95, 0x75,
3030+ 0x49, 0x0b, 0x43, 0x19, 0xe8, 0x4a, 0xe0, 0x29, 0x9f, 0x1f, 0x00,
3031+ 0xb3, 0x85, 0x9f, 0xbe, 0x2e, 0x74, 0xb3, 0xec, 0x2a, 0xaf},
3032+ {0x4a, 0x58, 0x42, 0xb1, 0x0d, 0x2d, 0xb9, 0x6e, 0xa1, 0x03,
3033+ 0x9e, 0xf4, 0x78, 0x5c, 0xe7, 0x22, 0x55, 0x5b, 0x37, 0x51,
3034+ 0xa9, 0xb6, 0xdd, 0x39, 0x12, 0x6a, 0xd3, 0x63, 0x37, 0x8c,
3035+ 0x72, 0x32, 0x0d, 0x83, 0xea, 0x7a, 0xdb, 0x81, 0x61, 0x5a},
3036+ {{Action::WRAP, {SECSuccess, true}},
3037+ {Action::UNWRAP, {SECSuccess, true}}}},
3038+
3039+ {51, // Round counter overflows 256
3040+ {0x31, 0xca, 0xcb, 0xb1, 0x7d, 0x6d, 0xbb, 0xec, 0xae, 0x40, 0x72, 0x7c,
3041+ 0x50, 0x48, 0xfe, 0x0c, 0x01, 0xbc, 0x53, 0xb2, 0x3a, 0xb6, 0x35, 0x02},
3042+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3043+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3044+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3045+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3046+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3047+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3048+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3049+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3050+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3051+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3052+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3053+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3054+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3055+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3056+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3057+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3058+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3059+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3060+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3061+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3062+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3063+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3064+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3065+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3066+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3067+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3068+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3069+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3070+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3071+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3072+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3073+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
3074+ {0xe2, 0x19, 0x25, 0x98, 0xe6, 0x12, 0x4f, 0x27, 0x91, 0xb2, 0x75, 0x1f,
3075+ 0x93, 0x09, 0x58, 0x43, 0x5b, 0xb1, 0xd0, 0x2e, 0x98, 0xaa, 0x1e, 0x09,
3076+ 0x78, 0x1b, 0xba, 0x0b, 0x15, 0x94, 0x35, 0xdb, 0x65, 0x9f, 0xa7, 0x3f,
3077+ 0xa3, 0x10, 0x11, 0x17, 0x04, 0x69, 0x2c, 0x68, 0xe1, 0x6d, 0xdf, 0x4b,
3078+ 0xe0, 0x60, 0x22, 0xc5, 0x2f, 0xe9, 0xdb, 0xa6, 0x27, 0x9a, 0xad, 0x1a,
3079+ 0xeb, 0x81, 0x41, 0x25, 0xd0, 0xdd, 0xf3, 0x3f, 0x31, 0xe5, 0x8e, 0x62,
3080+ 0x5a, 0xf3, 0x23, 0x05, 0x05, 0x0c, 0xfe, 0xa3, 0x90, 0xd8, 0x78, 0x2d,
3081+ 0x32, 0xca, 0xac, 0x55, 0x88, 0x89, 0xca, 0x8e, 0x64, 0x19, 0x08, 0x20,
3082+ 0x8d, 0xa6, 0x97, 0x65, 0x42, 0xb4, 0x0d, 0xbd, 0x09, 0x01, 0x78, 0xe2,
3083+ 0xa6, 0x81, 0x2a, 0x43, 0x6c, 0x18, 0xa5, 0xe8, 0x91, 0xac, 0x80, 0x83,
3084+ 0x17, 0x6a, 0xce, 0x1d, 0xdf, 0xee, 0x4d, 0x38, 0x28, 0x56, 0xa5, 0x9c,
3085+ 0x80, 0xc6, 0x43, 0xec, 0xd5, 0xc1, 0xab, 0x68, 0xc6, 0x6b, 0x2b, 0x89,
3086+ 0x84, 0xce, 0x6e, 0x0e, 0x38, 0x6f, 0x65, 0x54, 0xa9, 0xcb, 0x91, 0xd3,
3087+ 0x63, 0xbb, 0x4a, 0xcc, 0xf0, 0x28, 0x87, 0x8e, 0xc2, 0x0b, 0x8b, 0x2e,
3088+ 0x37, 0x21, 0x4f, 0x7b, 0x12, 0xdb, 0xcd, 0x78, 0xfb, 0x38, 0xf7, 0x11,
3089+ 0xa9, 0x0f, 0xe2, 0x62, 0xc7, 0x84, 0x91, 0xb9, 0x05, 0x83, 0x54, 0xe2,
3090+ 0x7b, 0x34, 0xfc, 0x92, 0xef, 0x0d, 0x70, 0x28, 0x59, 0x4c, 0xb0, 0x82,
3091+ 0x59, 0xf8, 0x6b, 0x54, 0xcb, 0x1d, 0x31, 0x7e, 0xc5, 0x5f, 0x2e, 0xf2,
3092+ 0xab, 0x7e, 0x8b, 0x14, 0x16, 0x71, 0xf8, 0xbc, 0xb1, 0xa9, 0x0b, 0xb7,
3093+ 0xd8, 0x2b, 0xc8, 0xcb, 0x4f, 0xb0, 0x2c, 0x9c, 0xe4, 0x30, 0xef, 0x4a,
3094+ 0xe0, 0xdc, 0x84, 0x7e, 0x91, 0xe7, 0xd4, 0xfb, 0x46, 0x3e, 0xb9, 0xdd,
3095+ 0x87, 0xfc, 0x9d, 0xc9, 0x56, 0x8f, 0x3a, 0x4e, 0xf5, 0x04, 0xd7, 0x4c,
3096+ 0x13, 0x4d, 0xcb, 0x60, 0xca, 0x01, 0xb3, 0x6c, 0xe1, 0x0c, 0xb4, 0x67,
3097+ 0x26, 0x8e, 0xa2, 0x97, 0xc0, 0x51, 0x8a, 0x50, 0xd1, 0x2c, 0xc0, 0x25,
3098+ 0xcf, 0xee, 0xa1, 0x38, 0x1d, 0xdd, 0x7d, 0xd6, 0x3e, 0x4a, 0xc9, 0x48,
3099+ 0x90, 0xa0, 0xea, 0xe9, 0xdb, 0xd8, 0xdb, 0x24, 0x46, 0x25, 0xa3, 0xc8,
3100+ 0xaf, 0x2e, 0x1a, 0xff, 0x6a, 0x81, 0x12, 0xc4, 0xd3, 0xd9, 0x8e, 0x82,
3101+ 0x63, 0x58, 0x8e, 0xe1, 0xdd, 0x90, 0x63, 0xb7, 0x09, 0xb8, 0xec, 0x00,
3102+ 0x47, 0x4c, 0x4e, 0xa4, 0x13, 0xa8, 0x02, 0xb8, 0xcd, 0xe8, 0x14, 0xe7,
3103+ 0xb3, 0x73, 0x14, 0x10, 0x80, 0x9e, 0xd0, 0x00, 0x06, 0x0f, 0xb7, 0xb9,
3104+ 0xb0, 0xbf, 0x85, 0x09, 0xef, 0x17, 0x51, 0x5f, 0x33, 0x3e, 0x86, 0x8b,
3105+ 0x18, 0x8e, 0xa1, 0x64, 0x45, 0xf3, 0x80, 0xb3, 0xa7, 0xd4, 0x27, 0x74,
3106+ 0xf6, 0x45, 0x6c, 0xdf, 0x72, 0x42, 0x46, 0xfa},
3107+ {{Action::WRAP,
3108+ {SECSuccess, true}}, // Round counter overflows - acceptable
3109+ {Action::UNWRAP, {SECSuccess, true}}}},
3110+
3111+ {52, // empty keys cannot be wrapped
3112+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3113+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3114+ {},
3115+ {0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6},
3116+ {{Action::WRAP, {SECFailure, false}},
3117+ {Action::UNWRAP, {SECFailure, false}}}},
3118+
3119+ {53, // keys of size 8 byte cannot be wrapped
3120+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3121+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3122+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
3123+ {0x38, 0xd8, 0x23, 0x8c, 0xdb, 0x0d, 0x9a, 0x2d, 0xa2, 0x8d, 0x6d, 0x56,
3124+ 0x19, 0x4f, 0x2e, 0x78},
3125+ {{Action::WRAP, {SECFailure, false}},
3126+ {Action::UNWRAP, {SECFailure, false}}}},
3127+
3128+ {54, // wrapped key size must be divisible by 8
3129+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3130+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3131+ {0x00},
3132+ {},
3133+ {{Action::WRAP, {SECFailure, false}},
3134+ {Action::UNWRAP, {SECFailure, false}}}},
3135+
3136+ {55, // wrapped key size must be divisible by 8
3137+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3138+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3139+ {0x00, 0x01},
3140+ {},
3141+ {{Action::WRAP, {SECFailure, false}},
3142+ {Action::UNWRAP, {SECFailure, false}}}},
3143+
3144+ {56, // wrapped key size must be divisible by 8
3145+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3146+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3147+ {0x00, 0x01, 0x02},
3148+ {},
3149+ {{Action::WRAP, {SECFailure, false}},
3150+ {Action::UNWRAP, {SECFailure, false}}}},
3151+
3152+ {57, // wrapped key size must be divisible by 8
3153+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3154+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3155+ {0x00, 0x01, 0x02, 0x03},
3156+ {},
3157+ {{Action::WRAP, {SECFailure, false}},
3158+ {Action::UNWRAP, {SECFailure, false}}}},
3159+
3160+ {58, // wrapped key size must be divisible by 8
3161+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3162+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3163+ {0x00, 0x01, 0x02, 0x03, 0x04},
3164+ {},
3165+ {{Action::WRAP, {SECFailure, false}},
3166+ {Action::UNWRAP, {SECFailure, false}}}},
3167+
3168+ {59, // wrapped key size must be divisible by 8
3169+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3170+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3171+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05},
3172+ {},
3173+ {{Action::WRAP, {SECFailure, false}},
3174+ {Action::UNWRAP, {SECFailure, false}}}},
3175+
3176+ {60, // wrapped key size must be divisible by 8
3177+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3178+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3179+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06},
3180+ {},
3181+ {{Action::WRAP, {SECFailure, false}},
3182+ {Action::UNWRAP, {SECFailure, false}}}},
3183+
3184+ {61, // wrapped key size must be divisible by 8
3185+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7, 0xa9,
3186+ 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e, 0xed, 0x76},
3187+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
3188+ 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
3189+ {},
3190+ {{Action::WRAP, {SECFailure, false}},
3191+ {Action::UNWRAP, {SECFailure, false}}}},
3192+
3193+ {62, // invalid size of wrapped key
3194+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
3195+ 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
3196+ {},
3197+ {},
3198+ {{Action::WRAP, {SECFailure, false}},
3199+ {Action::UNWRAP, {SECFailure, false}}}},
3200+
3201+ {63, // invalid size of wrapped key
3202+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
3203+ 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
3204+ {},
3205+ {0x9f},
3206+ {{Action::WRAP, {SECFailure, false}},
3207+ {Action::UNWRAP, {SECFailure, false}}}},
3208+
3209+ {64, // invalid size of wrapped key
3210+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
3211+ 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
3212+ {},
3213+ {0xdc, 0x9e, 0x95, 0x80},
3214+ {{Action::WRAP, {SECFailure, false}},
3215+ {Action::UNWRAP, {SECFailure, false}}}},
3216+
3217+ {65, // invalid size of wrapped key
3218+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
3219+ 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
3220+ {},
3221+ {0xb9, 0xb2, 0x82, 0xd1, 0x38, 0x69, 0x30, 0x00},
3222+ {{Action::WRAP, {SECFailure, false}},
3223+ {Action::UNWRAP, {SECFailure, false}}}},
3224+
3225+ {66, // invalid size of wrapped key
3226+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
3227+ 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
3228+ {},
3229+ {0x0e, 0xfc, 0x63, 0x5b, 0x2d, 0x61, 0xe2, 0x44, 0x05, 0x6b, 0x9d, 0x45,
3230+ 0x91, 0xca, 0x6b},
3231+ {{Action::WRAP, {SECFailure, false}},
3232+ {Action::UNWRAP, {SECFailure, false}}}},
3233+
3234+ {67, // invalid size of wrapped key
3235+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
3236+ 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
3237+ {},
3238+ {0x4a, 0x30, 0x5d, 0xae, 0x08, 0x7b, 0x0d, 0x24, 0xd6, 0x2a, 0xf4, 0x18,
3239+ 0x31, 0x33, 0x8f, 0x33, 0xae},
3240+ {{Action::WRAP, {SECFailure, false}},
3241+ {Action::UNWRAP, {SECFailure, false}}}},
3242+
3243+ {68, // invalid size of wrapped key
3244+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
3245+ 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
3246+ {},
3247+ {0x82, 0xcb, 0x92, 0x70, 0x97, 0xcf, 0x31, 0xea, 0x4a, 0xff,
3248+ 0xea, 0x44, 0x0b, 0x0d, 0x8c, 0xa6, 0xa2, 0x40, 0xb9, 0x00},
3249+ {{Action::WRAP, {SECFailure, false}},
3250+ {Action::UNWRAP, {SECFailure, false}}}},
3251+
3252+ {69, // bytes appended to wrapped key
3253+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c, 0xa4,
3254+ 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10, 0xfd, 0x97},
3255+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
3256+ 0x0c, 0x0d, 0x0e, 0x0f},
3257+ {0x55, 0xdf, 0xb2, 0xf7, 0xe0, 0xc1, 0xea, 0x04, 0xfe,
3258+ 0xad, 0x89, 0x7c, 0x45, 0x1c, 0x05, 0x05, 0x92, 0x1d,
3259+ 0xc4, 0x7f, 0x30, 0x8c, 0x49, 0x17, 0x00},
3260+ {{Action::WRAP, {SECSuccess, false}},
3261+ {Action::UNWRAP, {SECFailure, false}}}},
3262+
3263+ {70, // Incorrect IV
3264+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3265+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3266+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3267+ 0x01, 0xd0, 0x70, 0xa5},
3268+ {0x9b, 0x15, 0x93, 0xfd, 0x7d, 0x4f, 0xe2, 0x5a, 0x66, 0x0b, 0xbc, 0x19,
3269+ 0x76, 0xea, 0x4a, 0xb6, 0x8b, 0xcc, 0x53, 0xf8, 0x48, 0xa8, 0xeb, 0x9d},
3270+ {{Action::WRAP, {SECSuccess, false}},
3271+ {Action::UNWRAP, {SECFailure, false}}}},
3272+
3273+ {71, // Incorrect IV
3274+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3275+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3276+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3277+ 0x01, 0xd0, 0x70, 0xa5},
3278+ {0xe7, 0xed, 0xb8, 0x47, 0xfa, 0x91, 0xe2, 0xde, 0xde, 0xd7, 0x26, 0xed,
3279+ 0xf3, 0xab, 0x93, 0xda, 0x91, 0x15, 0x16, 0x97, 0x42, 0x5f, 0xee, 0x28},
3280+ {{Action::WRAP, {SECSuccess, false}},
3281+ {Action::UNWRAP, {SECFailure, false}}}},
3282+
3283+ {72, // Incorrect IV
3284+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3285+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3286+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3287+ 0x01, 0xd0, 0x70, 0xa5},
3288+ {0x1b, 0x51, 0xa7, 0xc0, 0x33, 0xc1, 0xef, 0xb5, 0xee, 0x29, 0x94, 0x25,
3289+ 0x9c, 0x40, 0xf0, 0x3b, 0xb5, 0x7d, 0x8c, 0xc0, 0x9e, 0x50, 0x7e, 0x6e},
3290+ {{Action::WRAP, {SECSuccess, false}},
3291+ {Action::UNWRAP, {SECFailure, false}}}},
3292+
3293+ {73, // Incorrect IV
3294+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3295+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3296+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3297+ 0x01, 0xd0, 0x70, 0xa5},
3298+ {0xc4, 0x0b, 0x61, 0x4a, 0x50, 0x62, 0xf5, 0xfd, 0x04, 0x9c, 0x53, 0x79,
3299+ 0xb3, 0xe8, 0x14, 0x16, 0x14, 0xc2, 0xda, 0x97, 0x89, 0x35, 0x89, 0xfb},
3300+ {{Action::WRAP, {SECSuccess, false}},
3301+ {Action::UNWRAP, {SECFailure, false}}}},
3302+
3303+ {74, // Incorrect IV
3304+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3305+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3306+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3307+ 0x01, 0xd0, 0x70, 0xa5},
3308+ {0xd7, 0x57, 0x5e, 0xf0, 0x2d, 0xf5, 0x4b, 0x30, 0x86, 0xeb, 0x49, 0x03,
3309+ 0x5e, 0xea, 0xfb, 0xce, 0x0e, 0x08, 0x33, 0x6e, 0x89, 0xb3, 0x5a, 0xb0},
3310+ {{Action::WRAP, {SECSuccess, false}},
3311+ {Action::UNWRAP, {SECFailure, false}}}},
3312+
3313+ {75, // Incorrect IV
3314+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3315+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3316+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3317+ 0x01, 0xd0, 0x70, 0xa5},
3318+ {0x0d, 0x61, 0x7f, 0x1c, 0x12, 0x48, 0x5a, 0x35, 0x91, 0x7d, 0x2a, 0x94,
3319+ 0x1e, 0x94, 0x9d, 0x2f, 0xdb, 0xf0, 0x3a, 0x34, 0x68, 0x89, 0xb8, 0x50},
3320+ {{Action::WRAP, {SECSuccess, false}},
3321+ {Action::UNWRAP, {SECFailure, false}}}},
3322+
3323+ {76, // Incorrect IV
3324+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3325+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3326+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3327+ 0x01, 0xd0, 0x70, 0xa5},
3328+ {0xc7, 0xdf, 0x34, 0x72, 0x91, 0x74, 0xdb, 0x2e, 0x83, 0xee, 0x16, 0xc6,
3329+ 0xde, 0x74, 0xd5, 0xeb, 0x97, 0x66, 0x71, 0x5f, 0xad, 0x04, 0x9b, 0x40},
3330+ {{Action::WRAP, {SECSuccess, false}},
3331+ {Action::UNWRAP, {SECFailure, false}}}},
3332+
3333+ {77, // Incorrect IV
3334+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3335+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3336+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3337+ 0x01, 0xd0, 0x70, 0xa5},
3338+ {0xc3, 0xed, 0x38, 0xd6, 0xf9, 0xcc, 0xb9, 0xbf, 0x3c, 0x56, 0xbb, 0x31,
3339+ 0x76, 0xf0, 0x0d, 0x3c, 0xe9, 0x88, 0x75, 0x21, 0xf8, 0xd4, 0xc7, 0x0b},
3340+ {{Action::WRAP, {SECSuccess, false}},
3341+ {Action::UNWRAP, {SECFailure, false}}}},
3342+
3343+ {78, // Incorrect IV
3344+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3345+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3346+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3347+ 0x01, 0xd0, 0x70, 0xa5},
3348+ {0x65, 0x82, 0xb5, 0xf4, 0x65, 0x27, 0x44, 0xb0, 0x53, 0x7e, 0x97, 0xe7,
3349+ 0xcd, 0xae, 0x0f, 0x44, 0x31, 0x30, 0x14, 0x0d, 0xba, 0xea, 0x60, 0x4c},
3350+ {{Action::WRAP, {SECSuccess, false}},
3351+ {Action::UNWRAP, {SECFailure, false}}}},
3352+
3353+ {79, // Incorrect IV
3354+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3355+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3356+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3357+ 0x01, 0xd0, 0x70, 0xa5},
3358+ {0xfc, 0x9b, 0x9b, 0xdf, 0x25, 0xf2, 0xb4, 0x8a, 0xd7, 0x99, 0x34, 0xc8,
3359+ 0xd3, 0x48, 0x97, 0xcd, 0xbf, 0x4c, 0x84, 0x6f, 0x8c, 0xb4, 0xb1, 0x1d},
3360+ {{Action::WRAP, {SECSuccess, false}},
3361+ {Action::UNWRAP, {SECFailure, false}}}},
3362+
3363+ {80, // Incorrect IV
3364+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3365+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3366+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3367+ 0x01, 0xd0, 0x70, 0xa5},
3368+ {0xfc, 0x23, 0xc7, 0xf4, 0xfe, 0x20, 0xaa, 0x81, 0x10, 0x5e, 0xfc, 0x1a,
3369+ 0x71, 0x05, 0xa5, 0x31, 0x6b, 0x23, 0x39, 0x9a, 0xc7, 0x92, 0xc8, 0x24},
3370+ {{Action::WRAP, {SECSuccess, false}},
3371+ {Action::UNWRAP, {SECFailure, false}}}},
3372+
3373+ {81, // Incorrect IV
3374+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3375+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3376+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3377+ 0x01, 0xd0, 0x70, 0xa5},
3378+ {0x37, 0xb4, 0xa2, 0x61, 0xb9, 0x6b, 0xce, 0xc9, 0xcc, 0x93, 0xee, 0xf5,
3379+ 0xb2, 0xfb, 0xbb, 0xe8, 0x46, 0x34, 0xf9, 0x78, 0xc5, 0x89, 0x3d, 0xda},
3380+ {{Action::WRAP, {SECSuccess, false}},
3381+ {Action::UNWRAP, {SECFailure, false}}}},
3382+
3383+ {82, // Incorrect IV
3384+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3385+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3386+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3387+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3388+ {0x18, 0x31, 0x10, 0x98, 0x47, 0xd1, 0x7d, 0x01, 0x0b, 0xfc, 0xd9,
3389+ 0x3f, 0xb4, 0x6f, 0x31, 0x50, 0xcd, 0xaf, 0xd5, 0x27, 0x33, 0xdb,
3390+ 0x74, 0xc2, 0x21, 0xb0, 0x34, 0xfe, 0x8e, 0x15, 0x52, 0xc0},
3391+ {{Action::WRAP, {SECSuccess, false}},
3392+ {Action::UNWRAP, {SECFailure, false}}}},
3393+
3394+ {83, // Incorrect IV
3395+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3396+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3397+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3398+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3399+ {0x2b, 0x2b, 0x89, 0xc3, 0xc6, 0xb2, 0xdb, 0x49, 0x03, 0x87, 0x7a,
3400+ 0xd4, 0x62, 0x2c, 0xa3, 0x3f, 0x3a, 0x3c, 0xb7, 0xe6, 0x70, 0x1d,
3401+ 0x13, 0x40, 0xe6, 0xaf, 0xc0, 0xfd, 0xab, 0x7d, 0xbd, 0x72},
3402+ {{Action::WRAP, {SECSuccess, false}},
3403+ {Action::UNWRAP, {SECFailure, false}}}},
3404+
3405+ {84, // Incorrect IV
3406+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3407+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3408+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3409+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3410+ {0x3c, 0x69, 0x03, 0xf3, 0x7d, 0xa5, 0x71, 0x61, 0xaf, 0x67, 0x06,
3411+ 0x05, 0x0a, 0x2e, 0xd7, 0x47, 0xcd, 0x55, 0x34, 0x4d, 0x86, 0x91,
3412+ 0x89, 0xfd, 0x49, 0xd2, 0x53, 0x6f, 0xf9, 0x48, 0x12, 0x9d},
3413+ {{Action::WRAP, {SECSuccess, false}},
3414+ {Action::UNWRAP, {SECFailure, false}}}},
3415+
3416+ {85, // Incorrect IV
3417+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3418+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3419+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3420+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3421+ {0x8a, 0x8d, 0xc8, 0xb1, 0x31, 0xc6, 0xb9, 0x68, 0xb6, 0x0c, 0x1d,
3422+ 0xd8, 0x19, 0xa6, 0x55, 0x39, 0x2d, 0x1a, 0x96, 0xd6, 0xca, 0xfa,
3423+ 0x48, 0xe3, 0x0f, 0xb1, 0x14, 0x6f, 0x09, 0x62, 0x29, 0xc6},
3424+ {{Action::WRAP, {SECSuccess, false}},
3425+ {Action::UNWRAP, {SECFailure, false}}}},
3426+
3427+ {86, // Incorrect IV
3428+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3429+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3430+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3431+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3432+ {0x30, 0x3e, 0x0b, 0x36, 0x02, 0xd5, 0x14, 0xa7, 0xd5, 0x2e, 0xdb,
3433+ 0xa3, 0x30, 0x6d, 0x73, 0x83, 0xe8, 0x99, 0x9e, 0x7c, 0x65, 0x2a,
3434+ 0x51, 0x03, 0x35, 0xa8, 0x94, 0x9e, 0xfb, 0x42, 0xeb, 0x66},
3435+ {{Action::WRAP, {SECSuccess, false}},
3436+ {Action::UNWRAP, {SECFailure, false}}}},
3437+
3438+ {87, // Incorrect IV
3439+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3440+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3441+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3442+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3443+ {0x31, 0x9b, 0xef, 0xbf, 0x2d, 0xdb, 0xb4, 0x75, 0x72, 0x3f, 0xb2,
3444+ 0xfa, 0x30, 0xf2, 0xae, 0x7f, 0xc1, 0xce, 0xb1, 0xe6, 0xf3, 0x61,
3445+ 0x71, 0x5e, 0xca, 0x72, 0x09, 0x60, 0x88, 0x73, 0xc7, 0xfc},
3446+ {{Action::WRAP, {SECSuccess, false}},
3447+ {Action::UNWRAP, {SECFailure, false}}}},
3448+
3449+ {88, // Incorrect IV
3450+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3451+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3452+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3453+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3454+ {0x9b, 0x3e, 0x44, 0x03, 0x41, 0xc5, 0xda, 0x13, 0x15, 0x59, 0x95,
3455+ 0x9d, 0xb6, 0xb3, 0x55, 0x3a, 0x53, 0x46, 0x91, 0x16, 0x2f, 0x4f,
3456+ 0x00, 0x93, 0x27, 0xbf, 0x2c, 0x21, 0xd6, 0xfe, 0x5a, 0xda},
3457+ {{Action::WRAP, {SECSuccess, false}},
3458+ {Action::UNWRAP, {SECFailure, false}}}},
3459+
3460+ {89, // Incorrect IV
3461+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3462+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3463+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3464+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3465+ {0xeb, 0xa6, 0xcc, 0x09, 0x59, 0xe6, 0xa5, 0x63, 0x39, 0xb1, 0x41,
3466+ 0x62, 0x98, 0x40, 0xad, 0xd8, 0x0f, 0x45, 0x65, 0x65, 0x6d, 0xc6,
3467+ 0x87, 0xa3, 0xb9, 0x96, 0x96, 0x0c, 0x99, 0x4d, 0xfd, 0x26},
3468+ {{Action::WRAP, {SECSuccess, false}},
3469+ {Action::UNWRAP, {SECFailure, false}}}},
3470+
3471+ {90, // Incorrect IV
3472+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3473+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3474+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3475+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3476+ {0xb7, 0x03, 0xb6, 0xcf, 0x45, 0x87, 0x70, 0x93, 0x53, 0xc7, 0xe4,
3477+ 0x00, 0x4d, 0x3d, 0xa6, 0x1c, 0xe5, 0xf5, 0xde, 0xaf, 0x71, 0x63,
3478+ 0xca, 0x9d, 0x61, 0x58, 0xdd, 0xe9, 0x19, 0xe0, 0xac, 0x34},
3479+ {{Action::WRAP, {SECSuccess, false}},
3480+ {Action::UNWRAP, {SECFailure, false}}}},
3481+
3482+ {91, // Incorrect IV
3483+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3484+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3485+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3486+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3487+ {0x72, 0x54, 0x9d, 0x52, 0xd6, 0xf4, 0xff, 0x91, 0x2d, 0x83, 0x3c,
3488+ 0x74, 0x13, 0x6d, 0x90, 0x63, 0x4c, 0xe8, 0xaf, 0xa4, 0xf8, 0x44,
3489+ 0x12, 0xbb, 0xee, 0x80, 0x74, 0x08, 0x4d, 0x4c, 0xec, 0xff},
3490+ {{Action::WRAP, {SECSuccess, false}},
3491+ {Action::UNWRAP, {SECFailure, false}}}},
3492+
3493+ {92, // Incorrect IV
3494+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3495+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3496+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3497+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3498+ {0x13, 0x37, 0xc8, 0xbd, 0x6c, 0x8a, 0x5d, 0xd4, 0x3a, 0xba, 0x8d,
3499+ 0x29, 0x88, 0x64, 0xff, 0xe7, 0x6a, 0xd6, 0xea, 0x90, 0x9f, 0x34,
3500+ 0x88, 0x15, 0x7a, 0x15, 0xe6, 0xc4, 0x6a, 0xcf, 0x22, 0x14},
3501+ {{Action::WRAP, {SECSuccess, false}},
3502+ {Action::UNWRAP, {SECFailure, false}}}},
3503+
3504+ {93, // Incorrect IV
3505+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3, 0xdc,
3506+ 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a, 0x84, 0xb4},
3507+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3508+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
3509+ {0x4a, 0xaf, 0xfa, 0xca, 0x5f, 0xe8, 0x58, 0x14, 0xd0, 0x40, 0xaa,
3510+ 0x2a, 0x30, 0x6b, 0xa4, 0xd1, 0xd4, 0x47, 0x46, 0xcf, 0xe4, 0x6c,
3511+ 0x97, 0x8a, 0xa0, 0x57, 0xb5, 0x3f, 0xd2, 0x53, 0x16, 0xc1},
3512+ {{Action::WRAP, {SECSuccess, false}},
3513+ {Action::UNWRAP, {SECFailure, false}}}},
3514+
3515+ {94, // RFC 3394
3516+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
3517+ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
3518+ {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
3519+ 0xcc, 0xdd, 0xee, 0xff},
3520+ {0x96, 0x77, 0x8b, 0x25, 0xae, 0x6c, 0xa4, 0x35, 0xf9, 0x2b, 0x5b, 0x97,
3521+ 0xc0, 0x50, 0xae, 0xd2, 0x46, 0x8a, 0xb8, 0xa1, 0x7a, 0xd8, 0x4e, 0x5d},
3522+ {{Action::WRAP, {SECSuccess, true}},
3523+ {Action::UNWRAP, {SECSuccess, true}}}},
3524+
3525+ {95, // RFC 3394
3526+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
3527+ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
3528+ {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
3529+ 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
3530+ {0x03, 0x1d, 0x33, 0x26, 0x4e, 0x15, 0xd3, 0x32, 0x68, 0xf2, 0x4e,
3531+ 0xc2, 0x60, 0x74, 0x3e, 0xdc, 0xe1, 0xc6, 0xc7, 0xdd, 0xee, 0x72,
3532+ 0x5a, 0x93, 0x6b, 0xa8, 0x14, 0x91, 0x5c, 0x67, 0x62, 0xd2},
3533+ {{Action::WRAP, {SECSuccess, true}},
3534+ {Action::UNWRAP, {SECSuccess, true}}}},
3535+
3536+ {96,
3537+ {0xfc, 0xe0, 0x42, 0x9c, 0x61, 0x06, 0x58, 0xef, 0x8e, 0x7c, 0xfb,
3538+ 0x01, 0x54, 0xc5, 0x1d, 0xe2, 0x23, 0x9a, 0x8a, 0x31, 0x7f, 0x5a,
3539+ 0xf5, 0xb6, 0x71, 0x4f, 0x98, 0x5f, 0xb5, 0xc4, 0xd7, 0x5c},
3540+ {0x28, 0x73, 0x26, 0xb5, 0xed, 0x00, 0x78, 0xe7, 0xca, 0x01, 0x64, 0xd7,
3541+ 0x48, 0xf6, 0x67, 0xe7},
3542+ {0x94, 0x0b, 0x1c, 0x58, 0x0e, 0x0c, 0x72, 0x33, 0xa7, 0x91, 0xb0, 0xf1,
3543+ 0x92, 0x43, 0x8d, 0x2e, 0xac, 0xe1, 0x42, 0x14, 0xce, 0xe4, 0x55, 0xb7},
3544+ {{Action::WRAP, {SECSuccess, true}},
3545+ {Action::UNWRAP, {SECSuccess, true}}}},
3546+
3547+ {97,
3548+ {0x0d, 0xda, 0x6d, 0xa5, 0x12, 0x3e, 0x2c, 0x37, 0xc6, 0xfa, 0x16,
3549+ 0xba, 0x0d, 0x33, 0x4c, 0xd0, 0x1a, 0xcd, 0x65, 0x2f, 0x89, 0x94,
3550+ 0x21, 0x17, 0x51, 0xdf, 0xab, 0x4f, 0xaa, 0xc2, 0xfc, 0x22},
3551+ {0xb4, 0x0b, 0x68, 0x28, 0x72, 0x9b, 0x45, 0x63, 0x22, 0xa8, 0xd0, 0x65,
3552+ 0xab, 0xc0, 0xd0, 0x81},
3553+ {0x93, 0x9b, 0x33, 0x89, 0x33, 0x6f, 0xea, 0x4a, 0x97, 0x51, 0xbf, 0x01,
3554+ 0x4e, 0xf1, 0x80, 0x11, 0x32, 0x30, 0x90, 0xe8, 0xa0, 0x50, 0x0b, 0xc4},
3555+ {{Action::WRAP, {SECSuccess, true}},
3556+ {Action::UNWRAP, {SECSuccess, true}}}},
3557+
3558+ {98,
3559+ {0xd6, 0x92, 0x59, 0x14, 0xcd, 0x06, 0x30, 0x8f, 0x81, 0xad, 0x91,
3560+ 0xe2, 0x30, 0x73, 0x59, 0x3d, 0x99, 0xd4, 0xe5, 0x03, 0x51, 0xb2,
3561+ 0x0e, 0xb2, 0xa8, 0xd1, 0xa1, 0xac, 0x4c, 0xed, 0x65, 0x88},
3562+ {0x03, 0x7b, 0x27, 0xb3, 0xdc, 0x95, 0xb1, 0x9d, 0x15, 0xbd, 0x40, 0x91,
3563+ 0xe3, 0x20, 0xbf, 0xe1},
3564+ {0x59, 0xee, 0x8e, 0x51, 0x98, 0x86, 0x12, 0x37, 0xf6, 0x82, 0xed, 0xec,
3565+ 0x6b, 0xa9, 0x06, 0x52, 0x6c, 0x01, 0x6d, 0x4d, 0x93, 0x59, 0x42, 0xbd},
3566+ {{Action::WRAP, {SECSuccess, true}},
3567+ {Action::UNWRAP, {SECSuccess, true}}}},
3568+
3569+ {99,
3570+ {0x07, 0x51, 0x8a, 0x82, 0xcb, 0xc8, 0xda, 0x1d, 0xce, 0xc5, 0x5f,
3571+ 0x37, 0x63, 0xa2, 0x06, 0xd2, 0x77, 0x48, 0x7a, 0xbd, 0x03, 0xce,
3572+ 0xdd, 0x0b, 0x8b, 0xef, 0x9e, 0xe2, 0xfb, 0x15, 0x71, 0x21},
3573+ {0xfa, 0xa4, 0x66, 0x4d, 0x79, 0xfc, 0xe3, 0xc7, 0xd2, 0xfd, 0xd4, 0x62,
3574+ 0xf6, 0xc1, 0xc4, 0x23, 0xc2, 0xf8, 0xe6, 0xb6, 0x9b, 0xe2, 0xe0, 0x71},
3575+ {0x1a, 0xb5, 0x3a, 0x06, 0x5d, 0x8f, 0x77, 0x6a, 0x08, 0xb3, 0x3e,
3576+ 0x51, 0x38, 0x30, 0x71, 0xb6, 0xf1, 0x54, 0x61, 0x21, 0x16, 0x65,
3577+ 0x51, 0x37, 0xbd, 0x3b, 0x7e, 0xc2, 0x9b, 0x70, 0xfd, 0x56},
3578+ {{Action::WRAP, {SECSuccess, true}},
3579+ {Action::UNWRAP, {SECSuccess, true}}}},
3580+
3581+ {100,
3582+ {0xea, 0x46, 0x99, 0x1d, 0x4e, 0x71, 0xf5, 0x3d, 0xd6, 0x24, 0xe7,
3583+ 0xfe, 0x7f, 0xde, 0x11, 0x94, 0x4a, 0x7c, 0x59, 0x42, 0xd2, 0x32,
3584+ 0x36, 0x9b, 0x80, 0x65, 0xd4, 0x2b, 0x8c, 0xd2, 0xdd, 0xe1},
3585+ {0xdf, 0xfc, 0x5c, 0xf1, 0xdd, 0x54, 0x11, 0xd0, 0x15, 0xd8, 0x46, 0x01,
3586+ 0xfa, 0x38, 0xdf, 0x5e, 0xff, 0xe8, 0x85, 0xc7, 0xf2, 0x6a, 0x48, 0x25},
3587+ {0xa1, 0xbf, 0x8e, 0x73, 0xe3, 0xfa, 0x1d, 0xb7, 0x59, 0xf0, 0xab,
3588+ 0x2a, 0xb0, 0xb1, 0xca, 0x6f, 0x2c, 0x85, 0xb6, 0x3d, 0x83, 0xe2,
3589+ 0x5f, 0x7a, 0x0b, 0x52, 0x93, 0xd0, 0xa2, 0x16, 0xa2, 0xb7},
3590+ {{Action::WRAP, {SECSuccess, true}},
3591+ {Action::UNWRAP, {SECSuccess, true}}}},
3592+
3593+ {101,
3594+ {0xfd, 0xcf, 0xa9, 0x02, 0xc6, 0xf2, 0x22, 0xf5, 0x27, 0xaf, 0x84,
3595+ 0xda, 0x53, 0x3b, 0x14, 0xb5, 0x2e, 0x26, 0x15, 0xda, 0x3a, 0x89,
3596+ 0xd1, 0xd3, 0x57, 0x08, 0xb0, 0xcd, 0x49, 0xf6, 0x0d, 0x87},
3597+ {0x96, 0x6b, 0x07, 0x04, 0x73, 0x54, 0x96, 0x6a, 0x70, 0x3e, 0x79, 0x60,
3598+ 0x7b, 0x55, 0x60, 0x32, 0xf4, 0xf5, 0x96, 0xb7, 0xf9, 0x20, 0x6f, 0x05},
3599+ {0x27, 0x30, 0x8a, 0x0e, 0x1a, 0x6c, 0x0a, 0x1d, 0x15, 0xd6, 0x17,
3600+ 0x4a, 0xb7, 0xd6, 0x86, 0x75, 0x20, 0x7b, 0x61, 0x5d, 0xf1, 0x6f,
3601+ 0xcf, 0x7a, 0x3c, 0x69, 0xb2, 0x5f, 0x55, 0x1c, 0xca, 0x9f},
3602+ {{Action::WRAP, {SECSuccess, true}},
3603+ {Action::UNWRAP, {SECSuccess, true}}}},
3604+
3605+ {102,
3606+ {0x38, 0xe1, 0xb1, 0xd0, 0x75, 0xd9, 0xd8, 0x52, 0xb9, 0xa6, 0xc0,
3607+ 0x1c, 0x8f, 0xf6, 0x96, 0x5a, 0xf0, 0x1b, 0xac, 0x45, 0x7a, 0x4e,
3608+ 0x33, 0x9a, 0xe3, 0xe1, 0xd7, 0xb2, 0xff, 0xac, 0xc0, 0xcd},
3609+ {0x80, 0xad, 0x68, 0x20, 0xf1, 0xc9, 0x09, 0x81, 0xe2, 0xca, 0x42,
3610+ 0xb8, 0x17, 0xa3, 0x45, 0xc1, 0x17, 0x9d, 0x0a, 0x11, 0xd8, 0xe2,
3611+ 0x3a, 0x8a, 0xdc, 0x05, 0x05, 0xe1, 0x3d, 0x87, 0x29, 0x5a},
3612+ {0x71, 0x55, 0xee, 0x93, 0x2b, 0x03, 0x58, 0xd9, 0x81, 0x82,
3613+ 0xa2, 0x3f, 0x7f, 0x42, 0x7c, 0x77, 0x4a, 0xb3, 0x40, 0xa4,
3614+ 0x75, 0x7d, 0x0b, 0x6a, 0x63, 0xfa, 0xcd, 0x3d, 0xe9, 0x05,
3615+ 0x78, 0x43, 0x8c, 0xf0, 0x32, 0x01, 0xc3, 0xf8, 0x80, 0x57},
3616+ {{Action::WRAP, {SECSuccess, true}},
3617+ {Action::UNWRAP, {SECSuccess, true}}}},
3618+
3619+ {103,
3620+ {0xc6, 0x41, 0xf1, 0x68, 0x9d, 0x81, 0xca, 0xa8, 0xba, 0x37, 0xd8,
3621+ 0x95, 0x27, 0x22, 0x40, 0x66, 0x40, 0x54, 0xed, 0x97, 0x4c, 0xff,
3622+ 0xfc, 0x40, 0xe6, 0xc5, 0xc0, 0xca, 0xd1, 0xb9, 0x16, 0xc7},
3623+ {0x3f, 0xd0, 0xba, 0x19, 0x95, 0x5e, 0x46, 0x74, 0x9f, 0x54, 0xd8,
3624+ 0x8e, 0x99, 0xd0, 0x80, 0xb7, 0x33, 0x9d, 0x58, 0x8f, 0xe6, 0x12,
3625+ 0xec, 0x0f, 0x40, 0x21, 0xca, 0x3c, 0xa2, 0x10, 0x42, 0x70},
3626+ {0xf2, 0x0b, 0x9b, 0x55, 0x3b, 0xc0, 0x84, 0x75, 0x29, 0xf8,
3627+ 0xd4, 0x37, 0x9f, 0xa9, 0x09, 0x21, 0x1e, 0x68, 0x24, 0x9b,
3628+ 0xd4, 0x29, 0xf4, 0x36, 0xc6, 0x15, 0xc4, 0xc4, 0xa5, 0xd9,
3629+ 0xf1, 0xa1, 0x96, 0x8f, 0x0b, 0x89, 0xc5, 0x23, 0x7b, 0x30},
3630+ {{Action::WRAP, {SECSuccess, true}},
3631+ {Action::UNWRAP, {SECSuccess, true}}}},
3632+
3633+ {104,
3634+ {0xaa, 0x0a, 0xb9, 0xd6, 0x8e, 0xd4, 0xa0, 0x4e, 0x72, 0x3f, 0x81,
3635+ 0xb4, 0x4c, 0x0c, 0x88, 0xd0, 0xbc, 0xde, 0x7a, 0x80, 0xcf, 0xd4,
3636+ 0x76, 0xeb, 0x4b, 0x88, 0x36, 0xd9, 0xaa, 0x01, 0xec, 0x4c},
3637+ {0x57, 0xfa, 0xa8, 0x76, 0x6f, 0x6d, 0x6a, 0x0a, 0xa1, 0xcf, 0x64,
3638+ 0x3f, 0x85, 0x7c, 0x15, 0x0d, 0xf5, 0xb3, 0x13, 0x03, 0xb5, 0x0a,
3639+ 0xf4, 0x80, 0xe2, 0x1c, 0x4b, 0x5e, 0x8c, 0x8a, 0x15, 0xd5},
3640+ {0x28, 0x11, 0x71, 0x68, 0x54, 0xa2, 0x14, 0xae, 0xcd, 0xd3,
3641+ 0x18, 0xc6, 0x67, 0x0b, 0x9b, 0x2a, 0x75, 0x11, 0x71, 0x3c,
3642+ 0x9a, 0x0c, 0x0f, 0xa8, 0x05, 0x23, 0x0f, 0xf0, 0x5c, 0xf8,
3643+ 0x4a, 0xf7, 0x95, 0xdd, 0x72, 0xf6, 0xc1, 0xa4, 0x45, 0x12},
3644+ {{Action::WRAP, {SECSuccess, true}},
3645+ {Action::UNWRAP, {SECSuccess, true}}}},
3646+
3647+ {105, // Round counter overflows 256
3648+ {0x31, 0xca, 0xcb, 0xb1, 0x7d, 0x6d, 0xbb, 0xec, 0xae, 0x40, 0x72,
3649+ 0x7c, 0x50, 0x48, 0xfe, 0x0c, 0x01, 0xbc, 0x53, 0xb2, 0x3a, 0xb6,
3650+ 0x35, 0x02, 0x5c, 0xba, 0xc1, 0xec, 0xf5, 0x2c, 0xa4, 0x95},
3651+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3652+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3653+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3654+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3655+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3656+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3657+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3658+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3659+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3660+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3661+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3662+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3663+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3664+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3665+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3666+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3667+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3668+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3669+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3670+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3671+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3672+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3673+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3674+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3675+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3676+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3677+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3678+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3679+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3680+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3681+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3682+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
3683+ {0x53, 0x22, 0xbc, 0x62, 0xbd, 0x83, 0x79, 0xab, 0xbb, 0x75, 0xf6, 0x96,
3684+ 0x88, 0xb8, 0xf0, 0x0e, 0x31, 0x96, 0x2b, 0x8f, 0x9a, 0xe1, 0xe8, 0x97,
3685+ 0x71, 0x95, 0x2d, 0x8a, 0x2a, 0x74, 0x9e, 0x13, 0x52, 0xec, 0x33, 0xb5,
3686+ 0x43, 0x5a, 0x67, 0x42, 0x71, 0xb3, 0x14, 0x76, 0x0a, 0xb9, 0xf7, 0x53,
3687+ 0xb1, 0x67, 0x26, 0x18, 0x5e, 0xc7, 0xd3, 0x19, 0xac, 0x60, 0x53, 0x13,
3688+ 0x55, 0x34, 0x4c, 0x1d, 0x53, 0xc7, 0x90, 0x30, 0x00, 0xa8, 0x03, 0x9e,
3689+ 0xb4, 0x0f, 0x70, 0x56, 0x4a, 0x0a, 0xd3, 0xf4, 0x1b, 0x23, 0x55, 0xea,
3690+ 0x5d, 0xfa, 0x6a, 0x1d, 0x46, 0x39, 0x2f, 0x1d, 0x10, 0x6a, 0x5d, 0xa5,
3691+ 0x69, 0xbf, 0xb0, 0x49, 0x3b, 0xf7, 0xc1, 0x2d, 0xff, 0x04, 0xba, 0xfe,
3692+ 0xae, 0x37, 0x7d, 0xf4, 0xbb, 0x47, 0xcd, 0x44, 0x0b, 0x6f, 0x60, 0xfb,
3693+ 0xab, 0x2a, 0x54, 0xa9, 0x85, 0x51, 0xb7, 0x62, 0x73, 0xe0, 0x2c, 0xac,
3694+ 0x8d, 0x7b, 0xe9, 0xf2, 0x34, 0x3d, 0x3a, 0xbb, 0x2a, 0x23, 0xaf, 0x1c,
3695+ 0x91, 0xa7, 0x01, 0x1c, 0x67, 0xa7, 0x90, 0x72, 0x60, 0x11, 0x6b, 0x67,
3696+ 0xd5, 0x10, 0xaa, 0xbe, 0x5c, 0x7c, 0xa4, 0x6c, 0x1c, 0x20, 0xf7, 0x71,
3697+ 0x06, 0xc4, 0x59, 0x66, 0x58, 0x3b, 0x3e, 0x4e, 0xd7, 0x99, 0xa4, 0x7e,
3698+ 0xe1, 0x9b, 0xb4, 0x22, 0x32, 0x09, 0x26, 0x5c, 0x2b, 0x1a, 0xc8, 0x18,
3699+ 0x3a, 0x67, 0x8f, 0xf4, 0x3b, 0xc9, 0xa3, 0x47, 0x0a, 0x50, 0xb9, 0xee,
3700+ 0x4d, 0x10, 0xf6, 0x06, 0x74, 0x26, 0x8d, 0x72, 0xc6, 0x8b, 0xe0, 0x03,
3701+ 0xa0, 0xd9, 0xdd, 0x68, 0x49, 0xab, 0xa8, 0x36, 0xfe, 0x8a, 0x17, 0x92,
3702+ 0xb8, 0x1c, 0x90, 0xe1, 0x29, 0x45, 0xbf, 0xe1, 0xf2, 0x7a, 0x9c, 0x6b,
3703+ 0x2a, 0xf6, 0x6a, 0x06, 0x3c, 0xdb, 0x77, 0x21, 0xa7, 0xf2, 0x3f, 0xb3,
3704+ 0x0a, 0xfd, 0xbd, 0x8b, 0x18, 0xdb, 0x37, 0x7d, 0xd1, 0x69, 0x7f, 0x15,
3705+ 0x7b, 0xe8, 0x1c, 0x15, 0x78, 0xd0, 0x8b, 0x06, 0x6c, 0x71, 0xb0, 0xc5,
3706+ 0xca, 0x7f, 0xee, 0xca, 0xc1, 0xcd, 0xd9, 0x38, 0xcf, 0x9a, 0xd5, 0x25,
3707+ 0xf7, 0x48, 0x44, 0x66, 0x09, 0x08, 0x19, 0x4b, 0x28, 0xe5, 0x4e, 0xdd,
3708+ 0xb1, 0x58, 0xf6, 0xe4, 0xc9, 0x21, 0xb8, 0x11, 0xd9, 0x0d, 0xb7, 0x1a,
3709+ 0x92, 0xff, 0x87, 0x2d, 0xb2, 0x25, 0x0d, 0xcc, 0x3f, 0x84, 0x7f, 0xc7,
3710+ 0x52, 0xb6, 0x6d, 0x77, 0xe3, 0x3c, 0x85, 0x08, 0x4d, 0x3f, 0xa5, 0x3b,
3711+ 0x4f, 0x30, 0x50, 0x3d, 0x2a, 0x06, 0xe6, 0xca, 0xbb, 0x90, 0x33, 0xd5,
3712+ 0x9f, 0xc1, 0xdc, 0x15, 0xe3, 0x2f, 0x19, 0x84, 0x6a, 0x03, 0x9b, 0x91,
3713+ 0x59, 0x7b, 0x0b, 0xa3, 0x14, 0x1a, 0x7d, 0x97, 0x17, 0x63, 0x00, 0x62,
3714+ 0x17, 0x01, 0x17, 0xb2, 0x13, 0x1d, 0xab, 0x77, 0x40, 0x6e, 0x9e, 0xd7,
3715+ 0xd6, 0x6b, 0x2c, 0x75, 0x4d, 0x84, 0x9c, 0x60},
3716+ {{Action::WRAP,
3717+ {SECSuccess, true}}, // Round counter overflows - acceptable
3718+ {Action::UNWRAP, {SECSuccess, true}}}},
3719+
3720+ {106, // empty keys cannot be wrapped
3721+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3722+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3723+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3724+ {},
3725+ {0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6},
3726+ {{Action::WRAP, {SECFailure, false}},
3727+ {Action::UNWRAP, {SECFailure, false}}}},
3728+
3729+ {107, // keys of size 8 byte cannot be wrapped
3730+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3731+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3732+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3733+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
3734+ {0x18, 0x1b, 0xa6, 0xa3, 0xa4, 0x39, 0x24, 0x69, 0xe3, 0xde, 0x98, 0xdd,
3735+ 0xbb, 0xdd, 0x24, 0x32},
3736+ {{Action::WRAP, {SECFailure, false}},
3737+ {Action::UNWRAP, {SECFailure, false}}}},
3738+
3739+ {108, // wrapped key size must be divisible by 8
3740+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3741+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3742+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3743+ {0x00},
3744+ {},
3745+ {{Action::WRAP, {SECFailure, false}},
3746+ {Action::UNWRAP, {SECFailure, false}}}},
3747+
3748+ {109, // wrapped key size must be divisible by 8
3749+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3750+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3751+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3752+ {0x00, 0x01},
3753+ {},
3754+ {{Action::WRAP, {SECFailure, false}},
3755+ {Action::UNWRAP, {SECFailure, false}}}},
3756+
3757+ {110, // wrapped key size must be divisible by 8
3758+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3759+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3760+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3761+ {0x00, 0x01, 0x02},
3762+ {},
3763+ {{Action::WRAP, {SECFailure, false}},
3764+ {Action::UNWRAP, {SECFailure, false}}}},
3765+
3766+ {111, // wrapped key size must be divisible by 8
3767+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3768+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3769+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3770+ {0x00, 0x01, 0x02, 0x03},
3771+ {},
3772+ {{Action::WRAP, {SECFailure, false}},
3773+ {Action::UNWRAP, {SECFailure, false}}}},
3774+
3775+ {112, // wrapped key size must be divisible by 8
3776+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3777+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3778+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3779+ {0x00, 0x01, 0x02, 0x03, 0x04},
3780+ {},
3781+ {{Action::WRAP, {SECFailure, false}},
3782+ {Action::UNWRAP, {SECFailure, false}}}},
3783+
3784+ {113, // wrapped key size must be divisible by 8
3785+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3786+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3787+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3788+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05},
3789+ {},
3790+ {{Action::WRAP, {SECFailure, false}},
3791+ {Action::UNWRAP, {SECFailure, false}}}},
3792+
3793+ {114, // wrapped key size must be divisible by 8
3794+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3795+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3796+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3797+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06},
3798+ {},
3799+ {{Action::WRAP, {SECFailure, false}},
3800+ {Action::UNWRAP, {SECFailure, false}}}},
3801+
3802+ {115, // wrapped key size must be divisible by 8
3803+ {0x57, 0x49, 0x57, 0x15, 0x1f, 0xc2, 0xaf, 0xe0, 0xfa, 0x3d, 0xc7,
3804+ 0xa9, 0xa7, 0xda, 0x64, 0x95, 0x39, 0x8f, 0x18, 0xea, 0x0d, 0x8e,
3805+ 0xed, 0x76, 0xa5, 0x1a, 0xac, 0x96, 0x03, 0x8a, 0xd6, 0x92},
3806+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
3807+ 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13},
3808+ {},
3809+ {{Action::WRAP, {SECFailure, false}},
3810+ {Action::UNWRAP, {SECFailure, false}}}},
3811+
3812+ {116, // invalid size of wrapped key
3813+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
3814+ 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
3815+ 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
3816+ {},
3817+ {},
3818+ {{Action::WRAP, {SECFailure, false}},
3819+ {Action::UNWRAP, {SECFailure, false}}}},
3820+
3821+ {117, // invalid size of wrapped key
3822+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
3823+ 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
3824+ 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
3825+ {},
3826+ {0x9f},
3827+ {{Action::WRAP, {SECFailure, false}},
3828+ {Action::UNWRAP, {SECFailure, false}}}},
3829+
3830+ {118, // invalid size of wrapped key
3831+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
3832+ 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
3833+ 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
3834+ {},
3835+ {0xdc, 0x9e, 0x95, 0x80},
3836+ {{Action::WRAP, {SECFailure, false}},
3837+ {Action::UNWRAP, {SECFailure, false}}}},
3838+
3839+ {119, // invalid size of wrapped key
3840+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
3841+ 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
3842+ 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
3843+ {},
3844+ {0xb9, 0xb2, 0x82, 0xd1, 0x38, 0x69, 0x30, 0x00},
3845+ {{Action::WRAP, {SECFailure, false}},
3846+ {Action::UNWRAP, {SECFailure, false}}}},
3847+
3848+ {120, // invalid size of wrapped key
3849+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
3850+ 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
3851+ 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
3852+ {},
3853+ {0x0e, 0xfc, 0x63, 0x5b, 0x2d, 0x61, 0xe2, 0x44, 0x05, 0x6b, 0x9d, 0x45,
3854+ 0x91, 0xca, 0x6b},
3855+ {{Action::WRAP, {SECFailure, false}},
3856+ {Action::UNWRAP, {SECFailure, false}}}},
3857+
3858+ {121, // invalid size of wrapped key
3859+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
3860+ 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
3861+ 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
3862+ {},
3863+ {0x4a, 0x30, 0x5d, 0xae, 0x08, 0x7b, 0x0d, 0x24, 0xd6, 0x2a, 0xf4, 0x18,
3864+ 0x31, 0x33, 0x8f, 0x33, 0xae},
3865+ {{Action::WRAP, {SECFailure, false}},
3866+ {Action::UNWRAP, {SECFailure, false}}}},
3867+
3868+ {122, // invalid size of wrapped key
3869+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
3870+ 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
3871+ 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
3872+ {},
3873+ {0x82, 0xcb, 0x92, 0x70, 0x97, 0xcf, 0x31, 0xea, 0x4a, 0xff,
3874+ 0xea, 0x44, 0x0b, 0x0d, 0x8c, 0xa6, 0xa2, 0x40, 0xb9, 0x00},
3875+ {{Action::WRAP, {SECFailure, false}},
3876+ {Action::UNWRAP, {SECFailure, false}}}},
3877+
3878+ {123, // bytes appended to wrapped key
3879+ {0xfe, 0x60, 0xfc, 0x8d, 0xf7, 0xd9, 0xf4, 0xeb, 0xb5, 0x41, 0x6c,
3880+ 0xa4, 0xe8, 0x21, 0x82, 0xf7, 0xe9, 0x92, 0x3a, 0x74, 0x61, 0x10,
3881+ 0xfd, 0x97, 0x8e, 0x3b, 0xd2, 0xde, 0xfc, 0x1c, 0x10, 0xd7},
3882+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
3883+ 0x0c, 0x0d, 0x0e, 0x0f},
3884+ {0x7d, 0xfb, 0xd7, 0xcf, 0x61, 0x58, 0xd7, 0x5b, 0xb5,
3885+ 0x90, 0x0b, 0x3b, 0xf1, 0xe3, 0x87, 0x10, 0x03, 0x40,
3886+ 0x2a, 0x65, 0x08, 0xb1, 0x91, 0x28, 0x00},
3887+ {{Action::WRAP, {SECSuccess, false}},
3888+ {Action::UNWRAP, {SECFailure, false}}}},
3889+
3890+ {124, // Incorrect IV
3891+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3892+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3893+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3894+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3895+ 0x01, 0xd0, 0x70, 0xa5},
3896+ {0xa4, 0x17, 0x67, 0x1b, 0xc6, 0x2a, 0x23, 0xc7, 0xa6, 0x55, 0x43, 0x09,
3897+ 0x21, 0x24, 0x02, 0x4d, 0xf7, 0x2c, 0x04, 0x8d, 0x8d, 0xb3, 0x30, 0xc7},
3898+ {{Action::WRAP, {SECSuccess, false}},
3899+ {Action::UNWRAP, {SECFailure, false}}}},
3900+
3901+ {125, // Incorrect IV
3902+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3903+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3904+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3905+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3906+ 0x01, 0xd0, 0x70, 0xa5},
3907+ {0x95, 0x18, 0xd0, 0xf9, 0x9d, 0x7a, 0x73, 0xed, 0x4a, 0x50, 0x2b, 0x44,
3908+ 0x9c, 0x14, 0xc2, 0x85, 0x97, 0x1b, 0x0e, 0x61, 0x77, 0xce, 0x0e, 0xca},
3909+ {{Action::WRAP, {SECSuccess, false}},
3910+ {Action::UNWRAP, {SECFailure, false}}}},
3911+
3912+ {126, // Incorrect IV
3913+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3914+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3915+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3916+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3917+ 0x01, 0xd0, 0x70, 0xa5},
3918+ {0xf3, 0x51, 0x1f, 0x04, 0x91, 0xbd, 0x74, 0xae, 0x1d, 0xef, 0xb5, 0x30,
3919+ 0x7f, 0x0e, 0x18, 0xdb, 0x86, 0x4b, 0x57, 0xb5, 0xc4, 0x04, 0xd4, 0x28},
3920+ {{Action::WRAP, {SECSuccess, false}},
3921+ {Action::UNWRAP, {SECFailure, false}}}},
3922+
3923+ {127, // Incorrect IV
3924+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3925+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3926+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3927+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3928+ 0x01, 0xd0, 0x70, 0xa5},
3929+ {0x6c, 0x03, 0xce, 0x77, 0x92, 0x59, 0x66, 0x1c, 0x43, 0xd4, 0x1d, 0x5d,
3930+ 0x0e, 0x45, 0x68, 0x7f, 0x87, 0x43, 0x53, 0xbb, 0xa5, 0x16, 0xc7, 0x3e},
3931+ {{Action::WRAP, {SECSuccess, false}},
3932+ {Action::UNWRAP, {SECFailure, false}}}},
3933+
3934+ {128, // Incorrect IV
3935+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3936+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3937+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3938+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3939+ 0x01, 0xd0, 0x70, 0xa5},
3940+ {0x8d, 0xf0, 0x19, 0x69, 0xa1, 0x1c, 0x87, 0x02, 0x65, 0x35, 0xbf, 0xcc,
3941+ 0xf7, 0x2b, 0x1d, 0x06, 0x4c, 0x86, 0xec, 0xc7, 0xe5, 0x22, 0x71, 0x57},
3942+ {{Action::WRAP, {SECSuccess, false}},
3943+ {Action::UNWRAP, {SECFailure, false}}}},
3944+
3945+ {129, // Incorrect IV
3946+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3947+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3948+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3949+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3950+ 0x01, 0xd0, 0x70, 0xa5},
3951+ {0x8e, 0xd1, 0xcd, 0xe2, 0x28, 0xd9, 0xc8, 0xd0, 0x46, 0xdc, 0xa6, 0x5c,
3952+ 0x7a, 0x27, 0xae, 0xf2, 0xed, 0xf8, 0xae, 0x90, 0xc7, 0x05, 0xd1, 0xe9},
3953+ {{Action::WRAP, {SECSuccess, false}},
3954+ {Action::UNWRAP, {SECFailure, false}}}},
3955+
3956+ {130, // Incorrect IV
3957+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3958+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3959+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3960+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3961+ 0x01, 0xd0, 0x70, 0xa5},
3962+ {0xd6, 0x9b, 0x3e, 0x34, 0xe9, 0xde, 0x38, 0xd4, 0x4d, 0xe1, 0x99, 0x89,
3963+ 0x92, 0x36, 0x2a, 0x6f, 0xa1, 0xf6, 0x96, 0xb5, 0xac, 0xab, 0x3f, 0x10},
3964+ {{Action::WRAP, {SECSuccess, false}},
3965+ {Action::UNWRAP, {SECFailure, false}}}},
3966+
3967+ {131, // Incorrect IV
3968+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3969+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3970+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3971+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3972+ 0x01, 0xd0, 0x70, 0xa5},
3973+ {0x67, 0x86, 0x51, 0x22, 0xaf, 0x32, 0x94, 0xb8, 0xda, 0x05, 0x88, 0x77,
3974+ 0x51, 0x25, 0xcb, 0xd6, 0xdc, 0x19, 0xd5, 0xe5, 0xca, 0xb9, 0x7b, 0x6d},
3975+ {{Action::WRAP, {SECSuccess, false}},
3976+ {Action::UNWRAP, {SECFailure, false}}}},
3977+
3978+ {132, // Incorrect IV
3979+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3980+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3981+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3982+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3983+ 0x01, 0xd0, 0x70, 0xa5},
3984+ {0x9f, 0x0f, 0xa5, 0x23, 0x63, 0xdd, 0x55, 0xdf, 0x47, 0x2d, 0x86, 0x7e,
3985+ 0x6f, 0xaf, 0x5d, 0xa8, 0xeb, 0x20, 0x4a, 0x1d, 0x6d, 0x49, 0x70, 0x30},
3986+ {{Action::WRAP, {SECSuccess, false}},
3987+ {Action::UNWRAP, {SECFailure, false}}}},
3988+
3989+ {133, // Incorrect IV
3990+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
3991+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
3992+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
3993+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
3994+ 0x01, 0xd0, 0x70, 0xa5},
3995+ {0xc3, 0x99, 0xf9, 0x99, 0xc9, 0x6a, 0x42, 0x04, 0x32, 0x5e, 0x7f, 0x08,
3996+ 0xd6, 0xa4, 0xde, 0x25, 0x6f, 0xaf, 0x21, 0xec, 0x2c, 0x00, 0x7d, 0xdf},
3997+ {{Action::WRAP, {SECSuccess, false}},
3998+ {Action::UNWRAP, {SECFailure, false}}}},
3999+
4000+ {134, // Incorrect IV
4001+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4002+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4003+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4004+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4005+ 0x01, 0xd0, 0x70, 0xa5},
4006+ {0x28, 0x20, 0x82, 0x26, 0x4a, 0x87, 0xdc, 0x35, 0xce, 0x1c, 0xc5, 0xb9,
4007+ 0x93, 0x1b, 0x77, 0xd8, 0x0d, 0x82, 0xfc, 0xac, 0xc0, 0x92, 0x7f, 0x85},
4008+ {{Action::WRAP, {SECSuccess, false}},
4009+ {Action::UNWRAP, {SECFailure, false}}}},
4010+
4011+ {135, // Incorrect IV
4012+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4013+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4014+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4015+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4016+ 0x01, 0xd0, 0x70, 0xa5},
4017+ {0xc1, 0x92, 0xc9, 0x0b, 0x83, 0x00, 0x3c, 0xa9, 0x67, 0x44, 0x49, 0x80,
4018+ 0x14, 0xb6, 0xad, 0x6b, 0xed, 0xda, 0x83, 0x79, 0x55, 0x26, 0x98, 0x19},
4019+ {{Action::WRAP, {SECSuccess, false}},
4020+ {Action::UNWRAP, {SECFailure, false}}}},
4021+
4022+ {136, // Incorrect IV
4023+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4024+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4025+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4026+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4027+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4028+ {0x30, 0xa9, 0x83, 0xcd, 0x9e, 0x69, 0xd5, 0x61, 0xac, 0xc9, 0x5c,
4029+ 0x42, 0xb2, 0x52, 0xab, 0xa4, 0x18, 0x5f, 0x83, 0x92, 0xf2, 0xe6,
4030+ 0xc9, 0x35, 0xc8, 0xeb, 0x10, 0x5a, 0xf8, 0x08, 0x2e, 0x34},
4031+ {{Action::WRAP, {SECSuccess, false}},
4032+ {Action::UNWRAP, {SECFailure, false}}}},
4033+
4034+ {137, // Incorrect IV
4035+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4036+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4037+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4038+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4039+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4040+ {0x4d, 0xe9, 0xa6, 0x39, 0xb7, 0x99, 0x63, 0x0b, 0x45, 0xb4, 0x9e,
4041+ 0x28, 0xdb, 0xfc, 0x44, 0xda, 0xbb, 0x98, 0x43, 0xee, 0x58, 0x8a,
4042+ 0x8c, 0xff, 0x28, 0x6b, 0x8d, 0x5f, 0xbd, 0x7b, 0x32, 0xee},
4043+ {{Action::WRAP, {SECSuccess, false}},
4044+ {Action::UNWRAP, {SECFailure, false}}}},
4045+
4046+ {138, // Incorrect IV
4047+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4048+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4049+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4050+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4051+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4052+ {0xd9, 0x15, 0xb2, 0xcd, 0xfb, 0x76, 0x9d, 0x9d, 0x82, 0x25, 0x9d,
4053+ 0xc3, 0xd1, 0x24, 0x64, 0x6b, 0xbf, 0x97, 0x2b, 0x83, 0xef, 0xd4,
4054+ 0xc2, 0xea, 0xe9, 0xb9, 0xf7, 0x51, 0x07, 0x3f, 0x78, 0xd6},
4055+ {{Action::WRAP, {SECSuccess, false}},
4056+ {Action::UNWRAP, {SECFailure, false}}}},
4057+
4058+ {139, // Incorrect IV
4059+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4060+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4061+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4062+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4063+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4064+ {0x11, 0x7d, 0x65, 0x3f, 0x48, 0x0b, 0x69, 0xfc, 0xe5, 0x64, 0xf1,
4065+ 0xfe, 0x99, 0x57, 0x24, 0x92, 0x94, 0x51, 0x89, 0xed, 0x5a, 0xf7,
4066+ 0x89, 0xce, 0x05, 0xa2, 0x65, 0x1b, 0xaf, 0x90, 0xbb, 0x5e},
4067+ {{Action::WRAP, {SECSuccess, false}},
4068+ {Action::UNWRAP, {SECFailure, false}}}},
4069+
4070+ {140, // Incorrect IV
4071+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4072+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4073+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4074+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4075+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4076+ {0x82, 0x26, 0xd0, 0x7a, 0x2f, 0x91, 0x9e, 0x24, 0xad, 0xa1, 0x08,
4077+ 0x1c, 0x69, 0xa7, 0x55, 0x20, 0xbe, 0x89, 0x5e, 0x3a, 0x2b, 0xda,
4078+ 0x9b, 0x80, 0x5d, 0x97, 0x47, 0x77, 0x3d, 0xde, 0xaa, 0x38},
4079+ {{Action::WRAP, {SECSuccess, false}},
4080+ {Action::UNWRAP, {SECFailure, false}}}},
4081+
4082+ {141, // Incorrect IV
4083+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4084+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4085+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4086+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4087+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4088+ {0xb0, 0xa7, 0x43, 0x45, 0xbe, 0xdf, 0x88, 0x65, 0x34, 0x8d, 0xaf,
4089+ 0x45, 0xd0, 0x54, 0xb9, 0x9c, 0xe5, 0x15, 0xea, 0x8b, 0xe1, 0x36,
4090+ 0x27, 0x0d, 0x1c, 0xf7, 0x1e, 0x1c, 0xfa, 0x7a, 0xa4, 0xa2},
4091+ {{Action::WRAP, {SECSuccess, false}},
4092+ {Action::UNWRAP, {SECFailure, false}}}},
4093+
4094+ {142, // Incorrect IV
4095+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4096+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4097+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4098+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4099+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4100+ {0xa2, 0x61, 0xdb, 0x77, 0xf1, 0x7f, 0x7e, 0xc7, 0x36, 0xd1, 0xa8,
4101+ 0xbe, 0x16, 0xe5, 0xf9, 0xae, 0x43, 0x2f, 0xe2, 0xa1, 0x70, 0x12,
4102+ 0xe5, 0xa6, 0xf0, 0x7c, 0x54, 0x26, 0xa9, 0xf0, 0xca, 0x59},
4103+ {{Action::WRAP, {SECSuccess, false}},
4104+ {Action::UNWRAP, {SECFailure, false}}}},
4105+
4106+ {143, // Incorrect IV
4107+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4108+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4109+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4110+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4111+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4112+ {0xc5, 0x3a, 0xcb, 0x5e, 0x09, 0x6b, 0x54, 0x54, 0x8e, 0x13, 0x85,
4113+ 0xb2, 0xff, 0x18, 0xea, 0xef, 0x68, 0xd2, 0x35, 0xc9, 0x5b, 0x01,
4114+ 0x94, 0xe7, 0x4a, 0x23, 0x83, 0xd3, 0xa7, 0xa5, 0x30, 0xdc},
4115+ {{Action::WRAP, {SECSuccess, false}},
4116+ {Action::UNWRAP, {SECFailure, false}}}},
4117+
4118+ {144, // Incorrect IV
4119+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4120+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4121+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4122+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4123+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4124+ {0xfa, 0xef, 0x48, 0x2d, 0x99, 0xeb, 0xb1, 0x80, 0xe5, 0xbc, 0x5e,
4125+ 0x3c, 0xf7, 0x75, 0xba, 0x29, 0x2c, 0x2a, 0x3b, 0x6c, 0x44, 0xaa,
4126+ 0x4a, 0x21, 0xad, 0x40, 0x09, 0x06, 0xf1, 0x1a, 0xf3, 0x92},
4127+ {{Action::WRAP, {SECSuccess, false}},
4128+ {Action::UNWRAP, {SECFailure, false}}}},
4129+
4130+ {145, // Incorrect IV
4131+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4132+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4133+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4134+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4135+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4136+ {0x73, 0xa4, 0x50, 0xb6, 0x3b, 0x07, 0xb3, 0xae, 0xce, 0x9d, 0x1a,
4137+ 0xe5, 0xbf, 0x09, 0x7a, 0x3d, 0xd3, 0xfc, 0xf7, 0x3e, 0x3e, 0xc2,
4138+ 0xf1, 0xbd, 0x8f, 0xc3, 0xb5, 0x58, 0x6c, 0xb9, 0xbd, 0x73},
4139+ {{Action::WRAP, {SECSuccess, false}},
4140+ {Action::UNWRAP, {SECFailure, false}}}},
4141+
4142+ {146, // Incorrect IV
4143+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4144+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4145+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4146+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4147+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4148+ {0xd3, 0x4b, 0x6e, 0xe1, 0x84, 0xd3, 0x87, 0xc9, 0xaa, 0x4b, 0x2d,
4149+ 0x18, 0x0a, 0xe0, 0xa8, 0x94, 0x98, 0x01, 0x4e, 0x55, 0xfe, 0x8e,
4150+ 0x41, 0x6b, 0xe4, 0xf8, 0x26, 0xfc, 0xf7, 0xd5, 0x65, 0x22},
4151+ {{Action::WRAP, {SECSuccess, false}},
4152+ {Action::UNWRAP, {SECFailure, false}}}},
4153+
4154+ {147, // Incorrect IV
4155+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4156+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4157+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4158+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84, 0xfa,
4159+ 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b, 0xe4, 0xf1},
4160+ {0x2a, 0xf8, 0x23, 0xd1, 0x60, 0x28, 0x03, 0x74, 0x0b, 0xfa, 0x90,
4161+ 0x40, 0xc2, 0xc4, 0xe7, 0x69, 0xa5, 0xb6, 0xde, 0x91, 0x9d, 0x40,
4162+ 0x3c, 0xfb, 0xa9, 0xad, 0x36, 0x0f, 0x63, 0xaf, 0x11, 0x13},
4163+ {{Action::WRAP, {SECSuccess, false}},
4164+ {Action::UNWRAP, {SECFailure, false}}}},
4165+
4166+ {148, // Incorrect IV
4167+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4168+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4169+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4170+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4171+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4172+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4173+ {0xdd, 0x78, 0xeb, 0xd3, 0x09, 0x1c, 0x55, 0xa5, 0xda, 0x5b,
4174+ 0x24, 0x50, 0x42, 0x00, 0xf7, 0xfa, 0xdd, 0x1b, 0x3a, 0xc6,
4175+ 0xad, 0x35, 0xf8, 0x14, 0xf7, 0x33, 0xe6, 0x03, 0xc1, 0x39,
4176+ 0x36, 0x24, 0x5d, 0x69, 0xd8, 0x3f, 0x26, 0x2f, 0x6b, 0x1e},
4177+ {{Action::WRAP, {SECSuccess, false}},
4178+ {Action::UNWRAP, {SECFailure, false}}}},
4179+
4180+ {149, // Incorrect IV
4181+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4182+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4183+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4184+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4185+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4186+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4187+ {0x3d, 0x83, 0x38, 0xea, 0xe7, 0xde, 0x32, 0x23, 0x99, 0xe1,
4188+ 0xd1, 0xb4, 0xa3, 0xdf, 0x54, 0x32, 0x6b, 0x24, 0x2b, 0x56,
4189+ 0x36, 0x12, 0xea, 0x4b, 0x27, 0xda, 0x22, 0xa0, 0x41, 0xd3,
4190+ 0xc8, 0x09, 0x66, 0x91, 0x1b, 0xc0, 0x09, 0x91, 0x17, 0x61},
4191+ {{Action::WRAP, {SECSuccess, false}},
4192+ {Action::UNWRAP, {SECFailure, false}}}},
4193+
4194+ {150, // Incorrect IV
4195+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4196+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4197+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4198+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4199+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4200+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4201+ {0xd0, 0x4b, 0xf7, 0x5c, 0xad, 0xd3, 0xb5, 0xf0, 0x99, 0xc3,
4202+ 0x4b, 0x27, 0xa9, 0x1e, 0x64, 0xa8, 0xf2, 0xdb, 0xcf, 0x08,
4203+ 0xe8, 0xc5, 0xc1, 0xc9, 0xf0, 0x7a, 0x77, 0x7e, 0xeb, 0x80,
4204+ 0x5d, 0x5d, 0x0e, 0x8c, 0x5c, 0x01, 0xaf, 0xc4, 0x39, 0x44},
4205+ {{Action::WRAP, {SECSuccess, false}},
4206+ {Action::UNWRAP, {SECFailure, false}}}},
4207+
4208+ {151, // Incorrect IV
4209+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4210+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4211+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4212+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4213+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4214+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4215+ {0xbe, 0x0c, 0x5d, 0x19, 0x3b, 0x61, 0xc5, 0x13, 0x7a, 0x8f,
4216+ 0xd8, 0xa6, 0xd7, 0xd1, 0xed, 0x8f, 0x0f, 0xa2, 0x8c, 0xec,
4217+ 0x51, 0x6f, 0x54, 0x46, 0x97, 0xc1, 0x2a, 0xdd, 0x4f, 0x8f,
4218+ 0x4d, 0x5c, 0xfc, 0xa6, 0x5e, 0xde, 0xb1, 0x01, 0x99, 0x74},
4219+ {{Action::WRAP, {SECSuccess, false}},
4220+ {Action::UNWRAP, {SECFailure, false}}}},
4221+
4222+ {152, // Incorrect IV
4223+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4224+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4225+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4226+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4227+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4228+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4229+ {0xa8, 0x3e, 0xbc, 0xbe, 0xb2, 0xbe, 0x9d, 0x68, 0x07, 0xb5,
4230+ 0xcf, 0xc3, 0x1c, 0x89, 0x84, 0x9d, 0x13, 0x43, 0xdd, 0x4e,
4231+ 0xb2, 0x2e, 0x5b, 0xfe, 0x9e, 0x2b, 0x2b, 0x37, 0x90, 0xad,
4232+ 0x89, 0x00, 0x60, 0x1f, 0x1f, 0x5d, 0x54, 0xfd, 0x47, 0x2f},
4233+ {{Action::WRAP, {SECSuccess, false}},
4234+ {Action::UNWRAP, {SECFailure, false}}}},
4235+
4236+ {153, // Incorrect IV
4237+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4238+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4239+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4240+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4241+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4242+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4243+ {0x41, 0x62, 0x21, 0x48, 0x5a, 0x6c, 0xb9, 0x8a, 0xd1, 0x34,
4244+ 0x2e, 0xa9, 0xa1, 0x29, 0x26, 0xa9, 0xa1, 0x33, 0xea, 0xd8,
4245+ 0xbd, 0x91, 0x93, 0x23, 0xfe, 0x78, 0x9b, 0xb8, 0xf8, 0x9a,
4246+ 0x4f, 0xca, 0xf8, 0x1e, 0x1b, 0xe5, 0x4f, 0x9d, 0x35, 0x8e},
4247+ {{Action::WRAP, {SECSuccess, false}},
4248+ {Action::UNWRAP, {SECFailure, false}}}},
4249+
4250+ {154, // Incorrect IV
4251+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4252+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4253+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4254+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4255+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4256+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4257+ {0xbf, 0x6a, 0x53, 0x28, 0x6f, 0xac, 0x48, 0xe7, 0xf2, 0x5d,
4258+ 0x89, 0xb7, 0x05, 0x6b, 0x27, 0xaa, 0x91, 0x7d, 0x5b, 0x54,
4259+ 0xc0, 0xd3, 0x17, 0x1d, 0xff, 0x36, 0x9f, 0x72, 0x49, 0x15,
4260+ 0x3b, 0xf0, 0x9d, 0xa5, 0x89, 0x1e, 0xb4, 0xdc, 0x2d, 0x88},
4261+ {{Action::WRAP, {SECSuccess, false}},
4262+ {Action::UNWRAP, {SECFailure, false}}}},
4263+
4264+ {155, // Incorrect IV
4265+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4266+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4267+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4268+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4269+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4270+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4271+ {0x99, 0xd5, 0x17, 0xa1, 0x32, 0x1b, 0xb6, 0x33, 0xb0, 0xd5,
4272+ 0xf3, 0xaf, 0xda, 0x23, 0x72, 0xd3, 0xab, 0xf6, 0x8b, 0x41,
4273+ 0xd1, 0x3c, 0xbf, 0xdf, 0xfc, 0x78, 0xf1, 0x73, 0xb8, 0x8b,
4274+ 0xc4, 0xb9, 0x7e, 0xfc, 0xab, 0x2b, 0x29, 0x04, 0x78, 0x8d},
4275+ {{Action::WRAP, {SECSuccess, false}},
4276+ {Action::UNWRAP, {SECFailure, false}}}},
4277+
4278+ {156, // Incorrect IV
4279+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4280+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4281+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4282+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4283+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4284+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4285+ {0xd9, 0x24, 0x56, 0xbc, 0x77, 0xa2, 0x68, 0xef, 0x71, 0xcb,
4286+ 0xa7, 0x60, 0x64, 0xa1, 0xb7, 0x72, 0xd1, 0xfe, 0xe2, 0xae,
4287+ 0x4f, 0x0e, 0xe3, 0xbb, 0x93, 0x2a, 0x2a, 0xdb, 0x2b, 0x03,
4288+ 0x17, 0x96, 0xb9, 0xea, 0xdb, 0x51, 0x75, 0x3f, 0x28, 0x68},
4289+ {{Action::WRAP, {SECSuccess, false}},
4290+ {Action::UNWRAP, {SECFailure, false}}}},
4291+
4292+ {157, // Incorrect IV
4293+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4294+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4295+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4296+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4297+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4298+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4299+ {0x5b, 0xb5, 0x46, 0x30, 0xab, 0x8d, 0x73, 0xa0, 0x40, 0xf0,
4300+ 0xf8, 0x7e, 0x70, 0xe2, 0x63, 0xd1, 0xae, 0xb2, 0x35, 0x8b,
4301+ 0xcd, 0xc0, 0xdc, 0xe6, 0x99, 0x4d, 0x0d, 0x87, 0x44, 0x52,
4302+ 0xbb, 0xd8, 0x74, 0x1b, 0x7e, 0xc1, 0xd5, 0x9d, 0x82, 0x98},
4303+ {{Action::WRAP, {SECSuccess, false}},
4304+ {Action::UNWRAP, {SECFailure, false}}}},
4305+
4306+ {158, // Incorrect IV
4307+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4308+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4309+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4310+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4311+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4312+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4313+ {0x45, 0x81, 0xd6, 0x53, 0x60, 0x39, 0xdb, 0x1b, 0x23, 0xda,
4314+ 0x50, 0xc6, 0x48, 0x77, 0x7e, 0x90, 0xc8, 0x2d, 0x61, 0x28,
4315+ 0xbb, 0x92, 0xe2, 0x8b, 0x29, 0x74, 0xba, 0xe1, 0x14, 0x15,
4316+ 0x43, 0xa1, 0x9a, 0x15, 0x92, 0xfd, 0xa1, 0xfb, 0xd6, 0x1f},
4317+ {{Action::WRAP, {SECSuccess, false}},
4318+ {Action::UNWRAP, {SECFailure, false}}}},
4319+
4320+ {159, // Incorrect IV
4321+ {0x4f, 0x71, 0x0e, 0xb6, 0xb5, 0xe2, 0x87, 0x03, 0xbe, 0xcf, 0xc3,
4322+ 0xdc, 0x52, 0xfa, 0x8b, 0xc1, 0xdd, 0x44, 0xa4, 0xa6, 0xd3, 0x8a,
4323+ 0x84, 0xb4, 0xf9, 0x4e, 0x89, 0xac, 0x32, 0xd9, 0x87, 0xe7},
4324+ {0xa8, 0x28, 0xcb, 0xda, 0x9b, 0x5f, 0xf0, 0xae, 0x37, 0x4f, 0x84,
4325+ 0xfa, 0x01, 0xd0, 0x70, 0xa5, 0xf0, 0xa1, 0x7a, 0x0c, 0x46, 0x2b,
4326+ 0xe4, 0xf1, 0xac, 0xce, 0x34, 0x97, 0x35, 0x26, 0x90, 0x8c},
4327+ {0xd3, 0x5b, 0xc6, 0x7e, 0x62, 0x06, 0x4c, 0x34, 0xf4, 0x81,
4328+ 0x50, 0x99, 0x9b, 0xa3, 0x0d, 0xed, 0x47, 0x5d, 0x8c, 0x75,
4329+ 0x97, 0x8f, 0x45, 0x73, 0x73, 0x20, 0xf2, 0x3e, 0xda, 0xaa,
4330+ 0x7a, 0x40, 0xd7, 0x80, 0x3f, 0xc6, 0x1a, 0xdd, 0x34, 0xa4},
4331+ {{Action::WRAP, {SECSuccess, false}},
4332+ {Action::UNWRAP, {SECFailure, false}}}},
4333+
4334+ {160, // RFC 3394
4335+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
4336+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
4337+ 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
4338+ {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
4339+ 0xcc, 0xdd, 0xee, 0xff},
4340+ {0x64, 0xe8, 0xc3, 0xf9, 0xce, 0x0f, 0x5b, 0xa2, 0x63, 0xe9, 0x77, 0x79,
4341+ 0x05, 0x81, 0x8a, 0x2a, 0x93, 0xc8, 0x19, 0x1e, 0x7d, 0x6e, 0x8a, 0xe7},
4342+ {{Action::WRAP, {SECSuccess, true}},
4343+ {Action::UNWRAP, {SECSuccess, true}}}},
4344+
4345+ {161, // RFC 3394
4346+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
4347+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
4348+ 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
4349+ {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
4350+ 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07},
4351+ {0xa8, 0xf9, 0xbc, 0x16, 0x12, 0xc6, 0x8b, 0x3f, 0xf6, 0xe6, 0xf4,
4352+ 0xfb, 0xe3, 0x0e, 0x71, 0xe4, 0x76, 0x9c, 0x8b, 0x80, 0xa3, 0x2c,
4353+ 0xb8, 0x95, 0x8c, 0xd5, 0xd1, 0x7d, 0x6b, 0x25, 0x4d, 0xa1},
4354+ {{Action::WRAP, {SECSuccess, true}},
4355+ {Action::UNWRAP, {SECSuccess, true}}}},
4356+
4357+ {162, // RFC 3394
4358+ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
4359+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
4360+ 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
4361+ {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa,
4362+ 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4363+ 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},
4364+ {0x28, 0xc9, 0xf4, 0x04, 0xc4, 0xb8, 0x10, 0xf4, 0xcb, 0xcc,
4365+ 0xb3, 0x5c, 0xfb, 0x87, 0xf8, 0x26, 0x3f, 0x57, 0x86, 0xe2,
4366+ 0xd8, 0x0e, 0xd3, 0x26, 0xcb, 0xc7, 0xf0, 0xe7, 0x1a, 0x99,
4367+ 0xf4, 0x3b, 0xfb, 0x98, 0x8b, 0x9b, 0x7a, 0x02, 0xdd, 0x21},
4368+ {{Action::WRAP, {SECSuccess, true}},
4369+ {Action::UNWRAP, {SECSuccess, true}}}},
4370+};
4371+#endif // kw_vectors_h__
4372\ No newline at end of file
4373diff --git a/nss/gtests/der_gtest/der_quickder_unittest.cc b/nss/gtests/der_gtest/der_quickder_unittest.cc
4374index 9441179..a5301f1 100644
4375--- a/nss/gtests/der_gtest/der_quickder_unittest.cc
4376+++ b/nss/gtests/der_gtest/der_quickder_unittest.cc
4377@@ -16,17 +16,35 @@
4378 #include "secerr.h"
4379 #include "secitem.h"
4380
4381-const SEC_ASN1Template mySEC_NullTemplate[] = {
4382- {SEC_ASN1_NULL, 0, NULL, sizeof(SECItem)}};
4383-
4384 namespace nss_test {
4385
4386+struct TemplateAndInput {
4387+ const SEC_ASN1Template* t;
4388+ SECItem input;
4389+};
4390+
4391 class QuickDERTest : public ::testing::Test,
4392- public ::testing::WithParamInterface<SECItem> {};
4393+ public ::testing::WithParamInterface<TemplateAndInput> {};
4394
4395+static const uint8_t kBitstringTag = 0x03;
4396 static const uint8_t kNullTag = 0x05;
4397 static const uint8_t kLongLength = 0x80;
4398
4399+const SEC_ASN1Template kBitstringTemplate[] = {
4400+ {SEC_ASN1_BIT_STRING, 0, NULL, sizeof(SECItem)}, {0}};
4401+
4402+// Empty bitstring with unused bits.
4403+static uint8_t kEmptyBitstringUnused[] = {kBitstringTag, 1, 1};
4404+
4405+// Bitstring with 8 unused bits.
4406+static uint8_t kBitstring8Unused[] = {kBitstringTag, 3, 8, 0xff, 0x00};
4407+
4408+// Bitstring with >8 unused bits.
4409+static uint8_t kBitstring9Unused[] = {kBitstringTag, 3, 9, 0xff, 0x80};
4410+
4411+const SEC_ASN1Template kNullTemplate[] = {
4412+ {SEC_ASN1_NULL, 0, NULL, sizeof(SECItem)}, {0}};
4413+
4414 // Length of zero wrongly encoded as 0x80 instead of 0x00.
4415 static uint8_t kOverlongLength_0_0[] = {kNullTag, kLongLength | 0};
4416
4417@@ -53,14 +71,22 @@ static uint8_t kOverlongLength_16_0[] = {kNullTag, kLongLength | 0x10,
4418 0x00, 0x00,
4419 0x00, 0x00};
4420
4421-static const SECItem kInvalidDER[] = {
4422- {siBuffer, kOverlongLength_0_0, sizeof(kOverlongLength_0_0)},
4423- {siBuffer, kOverlongLength_1_0, sizeof(kOverlongLength_1_0)},
4424- {siBuffer, kOverlongLength_16_0, sizeof(kOverlongLength_16_0)},
4425+#define TI(t, x) \
4426+ { \
4427+ t, { siBuffer, x, sizeof(x) } \
4428+ }
4429+static const TemplateAndInput kInvalidDER[] = {
4430+ TI(kBitstringTemplate, kEmptyBitstringUnused),
4431+ TI(kBitstringTemplate, kBitstring8Unused),
4432+ TI(kBitstringTemplate, kBitstring9Unused),
4433+ TI(kNullTemplate, kOverlongLength_0_0),
4434+ TI(kNullTemplate, kOverlongLength_1_0),
4435+ TI(kNullTemplate, kOverlongLength_16_0),
4436 };
4437+#undef TI
4438
4439 TEST_P(QuickDERTest, InvalidLengths) {
4440- const SECItem& original_input(GetParam());
4441+ const SECItem& original_input(GetParam().input);
4442
4443 ScopedSECItem copy_of_input(SECITEM_AllocItem(nullptr, nullptr, 0U));
4444 ASSERT_TRUE(copy_of_input);
4445@@ -69,11 +95,10 @@ TEST_P(QuickDERTest, InvalidLengths) {
4446
4447 PORTCheapArenaPool pool;
4448 PORT_InitCheapArena(&pool, DER_DEFAULT_CHUNKSIZE);
4449- ScopedSECItem parsed_value(SECITEM_AllocItem(nullptr, nullptr, 0U));
4450- ASSERT_TRUE(parsed_value);
4451+ StackSECItem parsed_value;
4452 ASSERT_EQ(SECFailure,
4453- SEC_QuickDERDecodeItem(&pool.arena, parsed_value.get(),
4454- mySEC_NullTemplate, copy_of_input.get()));
4455+ SEC_QuickDERDecodeItem(&pool.arena, &parsed_value, GetParam().t,
4456+ copy_of_input.get()));
4457 ASSERT_EQ(SEC_ERROR_BAD_DER, PR_GetError());
4458 PORT_DestroyCheapArena(&pool);
4459 }
4460diff --git a/nss/gtests/freebl_gtest/cmac_unittests.cc b/nss/gtests/freebl_gtest/cmac_unittests.cc
4461new file mode 100644
4462index 0000000..40088dc
4463--- /dev/null
4464+++ b/nss/gtests/freebl_gtest/cmac_unittests.cc
4465@@ -0,0 +1,187 @@
4466+// This Source Code Form is subject to the terms of the Mozilla Public
4467+// License, v. 2.0. If a copy of the MPL was not distributed with this file,
4468+// You can obtain one at http://mozilla.org/MPL/2.0/.
4469+
4470+#include "gtest/gtest.h"
4471+
4472+#include <stdint.h>
4473+#include <memory>
4474+
4475+#include "blapi.h"
4476+#include "secitem.h"
4477+#include "freebl_scoped_ptrs.h"
4478+
4479+class CmacAesTest : public ::testing::Test {
4480+ protected:
4481+ bool Compare(const uint8_t *actual, const uint8_t *expected,
4482+ unsigned int length) {
4483+ return strncmp((const char *)actual, (const char *)expected, length) == 0;
4484+ }
4485+};
4486+
4487+TEST_F(CmacAesTest, CreateInvalidSize) {
4488+ uint8_t key[1] = {0x00};
4489+ ScopedCMACContext ctx(CMAC_Create(CMAC_AES, key, sizeof(key)));
4490+ ASSERT_EQ(ctx, nullptr);
4491+}
4492+
4493+TEST_F(CmacAesTest, CreateRightSize) {
4494+ uint8_t *key = PORT_NewArray(uint8_t, AES_128_KEY_LENGTH);
4495+ ScopedCMACContext ctx(CMAC_Create(CMAC_AES, key, AES_128_KEY_LENGTH));
4496+
4497+ ASSERT_NE(ctx, nullptr);
4498+ PORT_Free(key);
4499+}
4500+
4501+// The following tests were taken from NIST's Cryptographic Standards and
4502+// Guidelines page for AES-CMAC Examples with Intermediate Values. These same
4503+// test vectors for AES-128 can be found in RFC 4493, Section 4.
4504+
4505+static const uint8_t kNistKeys[][AES_256_KEY_LENGTH] = {
4506+ {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15,
4507+ 0x88, 0x09, 0xCF, 0x4F, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4508+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
4509+ {0x8E, 0x73, 0xB0, 0xF7, 0xDA, 0x0E, 0x64, 0x52, 0xC8, 0x10, 0xF3,
4510+ 0x2B, 0x80, 0x90, 0x79, 0xE5, 0x62, 0xF8, 0xEA, 0xD2, 0x52, 0x2C,
4511+ 0x6B, 0x7B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
4512+ {0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, 0x2B, 0x73, 0xAE,
4513+ 0xF0, 0x85, 0x7D, 0x77, 0x81, 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61,
4514+ 0x08, 0xD7, 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4}};
4515+static const size_t kNistKeyLengthsCount = PR_ARRAY_SIZE(kNistKeys);
4516+static const unsigned int kNistKeyLengths[kNistKeyLengthsCount] = {
4517+ AES_128_KEY_LENGTH, AES_192_KEY_LENGTH, AES_256_KEY_LENGTH};
4518+
4519+static const uint8_t kNistPlaintext[64] = {
4520+ 0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96, 0xE9, 0x3D, 0x7E,
4521+ 0x11, 0x73, 0x93, 0x17, 0x2A, 0xAE, 0x2D, 0x8A, 0x57, 0x1E, 0x03,
4522+ 0xAC, 0x9C, 0x9E, 0xB7, 0x6F, 0xAC, 0x45, 0xAF, 0x8E, 0x51, 0x30,
4523+ 0xC8, 0x1C, 0x46, 0xA3, 0x5C, 0xE4, 0x11, 0xE5, 0xFB, 0xC1, 0x19,
4524+ 0x1A, 0x0A, 0x52, 0xEF, 0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B,
4525+ 0x17, 0xAD, 0x2B, 0x41, 0x7B, 0xE6, 0x6C, 0x37, 0x10};
4526+static const unsigned int kNistPlaintextLengths[] = {0, 16, 20, 64};
4527+static const size_t kNistPlaintextLengthsCount =
4528+ PR_ARRAY_SIZE(kNistPlaintextLengths);
4529+
4530+// This table contains the result of a CMAC over kNistPlaintext using keys from
4531+// kNistKeys. For each key, there are kNistPlaintextLengthsCount answers, all
4532+// listed one after the other as the input is truncated to the different sizes
4533+// in kNistPlaintextLengths.
4534+static const uint8_t kNistKnown[][AES_BLOCK_SIZE] = {
4535+ {0xBB, 0x1D, 0x69, 0x29, 0xE9, 0x59, 0x37, 0x28, 0x7F, 0xA3, 0x7D, 0x12,
4536+ 0x9B, 0x75, 0x67, 0x46},
4537+ {0x07, 0x0A, 0x16, 0xB4, 0x6B, 0x4D, 0x41, 0x44, 0xF7, 0x9B, 0xDD, 0x9D,
4538+ 0xD0, 0x4A, 0x28, 0x7C},
4539+ {0x7D, 0x85, 0x44, 0x9E, 0xA6, 0xEA, 0x19, 0xC8, 0x23, 0xA7, 0xBF, 0x78,
4540+ 0x83, 0x7D, 0xFA, 0xDE},
4541+ {0x51, 0xF0, 0xBE, 0xBF, 0x7E, 0x3B, 0x9D, 0x92, 0xFC, 0x49, 0x74, 0x17,
4542+ 0x79, 0x36, 0x3C, 0xFE},
4543+ {0xD1, 0x7D, 0xDF, 0x46, 0xAD, 0xAA, 0xCD, 0xE5, 0x31, 0xCA, 0xC4, 0x83,
4544+ 0xDE, 0x7A, 0x93, 0x67},
4545+ {0x9E, 0x99, 0xA7, 0xBF, 0x31, 0xE7, 0x10, 0x90, 0x06, 0x62, 0xF6, 0x5E,
4546+ 0x61, 0x7C, 0x51, 0x84},
4547+ {0x3D, 0x75, 0xC1, 0x94, 0xED, 0x96, 0x07, 0x04, 0x44, 0xA9, 0xFA, 0x7E,
4548+ 0xC7, 0x40, 0xEC, 0xF8},
4549+ {0xA1, 0xD5, 0xDF, 0x0E, 0xED, 0x79, 0x0F, 0x79, 0x4D, 0x77, 0x58, 0x96,
4550+ 0x59, 0xF3, 0x9A, 0x11},
4551+ {0x02, 0x89, 0x62, 0xF6, 0x1B, 0x7B, 0xF8, 0x9E, 0xFC, 0x6B, 0x55, 0x1F,
4552+ 0x46, 0x67, 0xD9, 0x83},
4553+ {0x28, 0xA7, 0x02, 0x3F, 0x45, 0x2E, 0x8F, 0x82, 0xBD, 0x4B, 0xF2, 0x8D,
4554+ 0x8C, 0x37, 0xC3, 0x5C},
4555+ {0x15, 0x67, 0x27, 0xDC, 0x08, 0x78, 0x94, 0x4A, 0x02, 0x3C, 0x1F, 0xE0,
4556+ 0x3B, 0xAD, 0x6D, 0x93},
4557+ {0xE1, 0x99, 0x21, 0x90, 0x54, 0x9F, 0x6E, 0xD5, 0x69, 0x6A, 0x2C, 0x05,
4558+ 0x6C, 0x31, 0x54, 0x10}};
4559+PR_STATIC_ASSERT(PR_ARRAY_SIZE(kNistKnown) ==
4560+ kNistKeyLengthsCount * kNistPlaintextLengthsCount);
4561+
4562+TEST_F(CmacAesTest, AesNistAligned) {
4563+ for (unsigned int key_index = 0; key_index < kNistKeyLengthsCount;
4564+ key_index++) {
4565+ ScopedCMACContext ctx(CMAC_Create(CMAC_AES, kNistKeys[key_index],
4566+ kNistKeyLengths[key_index]));
4567+ ASSERT_NE(ctx, nullptr);
4568+
4569+ for (unsigned int plaintext_index = 0;
4570+ plaintext_index < kNistPlaintextLengthsCount; plaintext_index++) {
4571+ CMAC_Begin(ctx.get());
4572+
4573+ unsigned int known_index =
4574+ (key_index * kNistPlaintextLengthsCount) + plaintext_index;
4575+ CMAC_Update(ctx.get(), kNistPlaintext,
4576+ kNistPlaintextLengths[plaintext_index]);
4577+
4578+ uint8_t output[AES_BLOCK_SIZE];
4579+ CMAC_Finish(ctx.get(), output, NULL, AES_BLOCK_SIZE);
4580+
4581+ ASSERT_TRUE(Compare(output, kNistKnown[known_index], AES_BLOCK_SIZE));
4582+ }
4583+ }
4584+}
4585+
4586+TEST_F(CmacAesTest, AesNistUnaligned) {
4587+ for (unsigned int key_index = 0; key_index < kNistKeyLengthsCount;
4588+ key_index++) {
4589+ unsigned int key_length = kNistKeyLengths[key_index];
4590+ ScopedCMACContext ctx(
4591+ CMAC_Create(CMAC_AES, kNistKeys[key_index], key_length));
4592+ ASSERT_NE(ctx, nullptr);
4593+
4594+ // Skip the zero-length test.
4595+ for (unsigned int plaintext_index = 1;
4596+ plaintext_index < kNistPlaintextLengthsCount; plaintext_index++) {
4597+ unsigned int known_index =
4598+ (key_index * kNistPlaintextLengthsCount) + plaintext_index;
4599+ unsigned int plaintext_length = kNistPlaintextLengths[plaintext_index];
4600+
4601+ // Test all possible offsets and make sure that misaligned updates
4602+ // produce the desired result. That is, do two updates:
4603+ // 0 ... offset
4604+ // offset ... len - offset
4605+ // and ensure the result is the same as doing one update.
4606+ for (unsigned int offset = 1; offset < plaintext_length; offset++) {
4607+ CMAC_Begin(ctx.get());
4608+
4609+ CMAC_Update(ctx.get(), kNistPlaintext, offset);
4610+ CMAC_Update(ctx.get(), kNistPlaintext + offset,
4611+ plaintext_length - offset);
4612+
4613+ uint8_t output[AES_BLOCK_SIZE];
4614+ CMAC_Finish(ctx.get(), output, NULL, AES_BLOCK_SIZE);
4615+
4616+ ASSERT_TRUE(Compare(output, kNistKnown[known_index], AES_BLOCK_SIZE));
4617+ }
4618+ }
4619+ }
4620+}
4621+
4622+TEST_F(CmacAesTest, AesNistTruncated) {
4623+ for (unsigned int key_index = 0; key_index < kNistKeyLengthsCount;
4624+ key_index++) {
4625+ unsigned int key_length = kNistKeyLengths[key_index];
4626+ ScopedCMACContext ctx(
4627+ CMAC_Create(CMAC_AES, kNistKeys[key_index], key_length));
4628+ ASSERT_TRUE(ctx != nullptr);
4629+
4630+ // Skip the zero-length test.
4631+ for (unsigned int plaintext_index = 1;
4632+ plaintext_index < kNistPlaintextLengthsCount; plaintext_index++) {
4633+ unsigned int known_index =
4634+ (key_index * kNistPlaintextLengthsCount) + plaintext_index;
4635+ unsigned int plaintext_length = kNistPlaintextLengths[plaintext_index];
4636+
4637+ // Test truncated outputs to ensure that we always get the desired values.
4638+ for (unsigned int out_len = 1; out_len < AES_BLOCK_SIZE; out_len++) {
4639+ CMAC_Begin(ctx.get());
4640+
4641+ CMAC_Update(ctx.get(), kNistPlaintext, plaintext_length);
4642+
4643+ unsigned int actual_out_len = 0;
4644+ uint8_t output[AES_BLOCK_SIZE];
4645+ CMAC_Finish(ctx.get(), output, &actual_out_len, out_len);
4646+
4647+ ASSERT_TRUE(actual_out_len == out_len);
4648+ ASSERT_TRUE(Compare(output, kNistKnown[known_index], out_len));
4649+ }
4650+ }
4651+ }
4652+}
4653diff --git a/nss/gtests/freebl_gtest/freebl_gtest.gyp b/nss/gtests/freebl_gtest/freebl_gtest.gyp
4654index 238f05e..c19db41 100644
4655--- a/nss/gtests/freebl_gtest/freebl_gtest.gyp
4656+++ b/nss/gtests/freebl_gtest/freebl_gtest.gyp
4657@@ -23,6 +23,7 @@
4658 '<(DEPTH)/lib/dev/dev.gyp:nssdev',
4659 '<(DEPTH)/lib/pki/pki.gyp:nsspki',
4660 '<(DEPTH)/lib/ssl/ssl.gyp:ssl',
4661+ '<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
4662 ],
4663 },
4664 {
4665@@ -34,6 +35,7 @@
4666 'ecl_unittest.cc',
4667 'ghash_unittest.cc',
4668 'rsa_unittest.cc',
4669+ 'cmac_unittests.cc',
4670 '<(DEPTH)/gtests/common/gtests.cc'
4671 ],
4672 'dependencies': [
4673diff --git a/nss/gtests/freebl_gtest/mpi_unittest.cc b/nss/gtests/freebl_gtest/mpi_unittest.cc
4674index fbc27d0..56b7454 100644
4675--- a/nss/gtests/freebl_gtest/mpi_unittest.cc
4676+++ b/nss/gtests/freebl_gtest/mpi_unittest.cc
4677@@ -290,4 +290,4 @@ TEST_F(DISABLED_MPITest, MpiCmpConstTest) {
4678 mp_clear(&c);
4679 }
4680
4681-} // nss_test
4682+} // namespace nss_test
4683diff --git a/nss/gtests/mozpkix_gtest/mozpkix_gtest.gyp b/nss/gtests/mozpkix_gtest/mozpkix_gtest.gyp
4684index 899b849..1623d76 100644
4685--- a/nss/gtests/mozpkix_gtest/mozpkix_gtest.gyp
4686+++ b/nss/gtests/mozpkix_gtest/mozpkix_gtest.gyp
4687@@ -43,6 +43,7 @@
4688 '<(DEPTH)/lib/base/base.gyp:nssb',
4689 '<(DEPTH)/lib/dev/dev.gyp:nssdev',
4690 '<(DEPTH)/lib/pki/pki.gyp:nsspki',
4691+ '<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
4692 '<(DEPTH)/lib/mozpkix/mozpkix.gyp:mozpkix',
4693 '<(DEPTH)/lib/mozpkix/mozpkix.gyp:mozpkix-testlib',
4694 ],
4695diff --git a/nss/gtests/mozpkix_gtest/pkixder_input_tests.cpp b/nss/gtests/mozpkix_gtest/pkixder_input_tests.cpp
4696index e70f795..c66f06e 100644
4697--- a/nss/gtests/mozpkix_gtest/pkixder_input_tests.cpp
4698+++ b/nss/gtests/mozpkix_gtest/pkixder_input_tests.cpp
4699@@ -191,8 +191,10 @@ TEST_F(pkixder_input_tests, ReadByteWrapAroundPointer)
4700 // a null pointer is undefined behavior according to the C++ language spec.,
4701 // but this should catch the problem on at least some compilers, if not all of
4702 // them.
4703- const uint8_t* der = nullptr;
4704- --der;
4705+ uintptr_t derint = -1;
4706+ auto der = reinterpret_cast<const uint8_t*>(derint);
4707+ ASSERT_EQ(sizeof(der), sizeof(derint))
4708+ << "underflow of pointer might not work";
4709 Input buf;
4710 ASSERT_EQ(Success, buf.Init(der, 0));
4711 Reader input(buf);
4712diff --git a/nss/gtests/mozpkix_gtest/pkixder_universal_types_tests.cpp b/nss/gtests/mozpkix_gtest/pkixder_universal_types_tests.cpp
4713index 260c735..0dc8555 100644
4714--- a/nss/gtests/mozpkix_gtest/pkixder_universal_types_tests.cpp
4715+++ b/nss/gtests/mozpkix_gtest/pkixder_universal_types_tests.cpp
4716@@ -1224,3 +1224,53 @@ TEST_F(pkixder_universal_types_tests, OID)
4717
4718 ASSERT_EQ(Success, OID(reader, expectedOID));
4719 }
4720+
4721+TEST_F(pkixder_universal_types_tests, SkipOptionalImplicitPrimitiveTag)
4722+{
4723+ const uint8_t DER_IMPLICIT_BIT_STRING_WITH_CLASS_NUMBER_1[] = {
4724+ 0x81,
4725+ 0x04,
4726+ 0x00,
4727+ 0x0A,
4728+ 0x0B,
4729+ 0x0C,
4730+ };
4731+ Input input(DER_IMPLICIT_BIT_STRING_WITH_CLASS_NUMBER_1);
4732+ Reader reader(input);
4733+
4734+ ASSERT_EQ(Success, SkipOptionalImplicitPrimitiveTag(reader, 1));
4735+ ASSERT_TRUE(reader.AtEnd());
4736+}
4737+
4738+TEST_F(pkixder_universal_types_tests, SkipOptionalImplicitPrimitiveTagMismatch)
4739+{
4740+ const uint8_t DER_IMPLICIT_BIT_STRING_WITH_CLASS_NUMBER_1[] = {
4741+ 0x81,
4742+ 0x04,
4743+ 0x00,
4744+ 0x0A,
4745+ 0x0B,
4746+ 0x0C,
4747+ };
4748+ Input input(DER_IMPLICIT_BIT_STRING_WITH_CLASS_NUMBER_1);
4749+ Reader reader(input);
4750+
4751+ ASSERT_EQ(Success, SkipOptionalImplicitPrimitiveTag(reader, 2));
4752+ ASSERT_FALSE(reader.AtEnd());
4753+}
4754+
4755+TEST_F(pkixder_universal_types_tests, NoSkipOptionalImplicitConstructedTag)
4756+{
4757+ const uint8_t DER_IMPLICIT_SEQUENCE_WITH_CLASS_NUMBER_1[] = {
4758+ 0xA1,
4759+ 0x03,
4760+ 0x05,
4761+ 0x01,
4762+ 0x00,
4763+ };
4764+ Input input(DER_IMPLICIT_SEQUENCE_WITH_CLASS_NUMBER_1);
4765+ Reader reader(input);
4766+
4767+ ASSERT_EQ(Success, SkipOptionalImplicitPrimitiveTag(reader, 1));
4768+ ASSERT_FALSE(reader.AtEnd());
4769+}
4770diff --git a/nss/gtests/pk11_gtest/manifest.mn b/nss/gtests/pk11_gtest/manifest.mn
4771index b774f1d..861f45f 100644
4772--- a/nss/gtests/pk11_gtest/manifest.mn
4773+++ b/nss/gtests/pk11_gtest/manifest.mn
4774@@ -9,20 +9,24 @@ MODULE = nss
4775 CPPSRCS = \
4776 pk11_aes_gcm_unittest.cc \
4777 pk11_aeskeywrap_unittest.cc \
4778+ pk11_aeskeywrappad_unittest.cc \
4779 pk11_cbc_unittest.cc \
4780 pk11_chacha20poly1305_unittest.cc \
4781 pk11_curve25519_unittest.cc \
4782+ pk11_der_private_key_import_unittest.cc \
4783 pk11_ecdsa_unittest.cc \
4784 pk11_encrypt_derive_unittest.cc \
4785 pk11_export_unittest.cc \
4786 pk11_find_certs_unittest.cc \
4787 pk11_import_unittest.cc \
4788+ pk11_keygen.cc \
4789+ pk11_key_unittest.cc \
4790 pk11_pbkdf2_unittest.cc \
4791 pk11_prf_unittest.cc \
4792 pk11_prng_unittest.cc \
4793 pk11_rsapkcs1_unittest.cc \
4794 pk11_rsapss_unittest.cc \
4795- pk11_der_private_key_import_unittest.cc \
4796+ pk11_seed_cbc_unittest.cc \
4797 $(NULL)
4798
4799 INCLUDES += -I$(CORE_DEPTH)/gtests/google_test/gtest/include \
4800diff --git a/nss/gtests/pk11_gtest/pk11_aes_cmac_unittest.cc b/nss/gtests/pk11_gtest/pk11_aes_cmac_unittest.cc
4801new file mode 100644
4802index 0000000..c520fff
4803--- /dev/null
4804+++ b/nss/gtests/pk11_gtest/pk11_aes_cmac_unittest.cc
4805@@ -0,0 +1,91 @@
4806+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
4807+/* vim: set ts=2 et sw=2 tw=80: */
4808+/* This Source Code Form is subject to the terms of the Mozilla Public
4809+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4810+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
4811+
4812+#include <memory>
4813+#include "nss.h"
4814+#include "pk11pub.h"
4815+#include "secerr.h"
4816+#include "sechash.h"
4817+
4818+#include "blapi.h"
4819+
4820+#include "gtest/gtest.h"
4821+#include "nss_scoped_ptrs.h"
4822+#include "util.h"
4823+
4824+namespace nss_test {
4825+
4826+class Pkcs11AesCmacTest : public ::testing::Test {
4827+ protected:
4828+ ScopedPK11SymKey ImportKey(CK_MECHANISM_TYPE mech, SECItem *key_item) {
4829+ ScopedPK11SlotInfo slot(PK11_GetInternalSlot());
4830+ if (!slot) {
4831+ ADD_FAILURE() << "Can't get slot";
4832+ return nullptr;
4833+ }
4834+
4835+ ScopedPK11SymKey result(PK11_ImportSymKey(
4836+ slot.get(), mech, PK11_OriginUnwrap, CKA_SIGN, key_item, nullptr));
4837+
4838+ return result;
4839+ }
4840+
4841+ void RunTest(uint8_t *key, unsigned int key_len, uint8_t *data,
4842+ unsigned int data_len, uint8_t *expected,
4843+ unsigned int expected_len, CK_ULONG mechanism) {
4844+ // Create SECItems for everything...
4845+ std::vector<uint8_t> output(expected_len);
4846+ SECItem key_item = {siBuffer, key, key_len};
4847+ SECItem output_item = {siBuffer, output.data(), expected_len};
4848+ SECItem data_item = {siBuffer, data, data_len};
4849+ SECItem expected_item = {siBuffer, expected, expected_len};
4850+
4851+ // Do the PKCS #11 stuff...
4852+ ScopedPK11SymKey p11_key = ImportKey(mechanism, &key_item);
4853+ ASSERT_NE(nullptr, p11_key.get());
4854+
4855+ SECStatus ret = PK11_SignWithSymKey(p11_key.get(), CKM_AES_CMAC, NULL,
4856+ &output_item, &data_item);
4857+
4858+ // Verify the result...
4859+ ASSERT_EQ(SECSuccess, ret);
4860+ ASSERT_EQ(0, SECITEM_CompareItem(&output_item, &expected_item));
4861+ }
4862+};
4863+
4864+// Sanity check of the PKCS #11 API only. Extensive tests for correctness of
4865+// underling CMAC implementation conducted in the following file:
4866+// gtests/freebl_gtest/cmac_unittests.cc
4867+
4868+TEST_F(Pkcs11AesCmacTest, Aes128NistExample1) {
4869+ uint8_t key[AES_128_KEY_LENGTH] = {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE,
4870+ 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88,
4871+ 0x09, 0xCF, 0x4F, 0x3C};
4872+ uint8_t known[AES_BLOCK_SIZE] = {0xBB, 0x1D, 0x69, 0x29, 0xE9, 0x59,
4873+ 0x37, 0x28, 0x7F, 0xA3, 0x7D, 0x12,
4874+ 0x9B, 0x75, 0x67, 0x46};
4875+
4876+ RunTest(key, AES_128_KEY_LENGTH, NULL, 0, known, AES_BLOCK_SIZE,
4877+ CKM_AES_CMAC);
4878+}
4879+
4880+TEST_F(Pkcs11AesCmacTest, General) {
4881+ uint8_t key[AES_128_KEY_LENGTH] = {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE,
4882+ 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88,
4883+ 0x09, 0xCF, 0x4F, 0x3C};
4884+ uint8_t known[4] = {0xBB, 0x1D, 0x69, 0x29};
4885+
4886+ RunTest(key, AES_128_KEY_LENGTH, NULL, 0, known, 4, CKM_AES_CMAC_GENERAL);
4887+}
4888+
4889+TEST_F(Pkcs11AesCmacTest, InvalidKeySize) {
4890+ uint8_t key[4] = {0x00, 0x00, 0x00, 0x00};
4891+ SECItem key_item = {siBuffer, key, 4};
4892+
4893+ ScopedPK11SymKey result = ImportKey(CKM_AES_CMAC, &key_item);
4894+ ASSERT_EQ(nullptr, result.get());
4895+}
4896+}
4897diff --git a/nss/gtests/pk11_gtest/pk11_aes_gcm_unittest.cc b/nss/gtests/pk11_gtest/pk11_aes_gcm_unittest.cc
4898index 9505b43..2c58063 100644
4899--- a/nss/gtests/pk11_gtest/pk11_aes_gcm_unittest.cc
4900+++ b/nss/gtests/pk11_gtest/pk11_aes_gcm_unittest.cc
4901@@ -37,47 +37,57 @@ class Pkcs11AesGcmTest : public ::testing::TestWithParam<gcm_kat_value> {
4902 }
4903
4904 // Prepare AEAD params.
4905- CK_GCM_PARAMS gcmParams;
4906- gcmParams.pIv = iv.data();
4907- gcmParams.ulIvLen = iv.size();
4908- gcmParams.pAAD = aad.data();
4909- gcmParams.ulAADLen = aad.size();
4910- gcmParams.ulTagBits = 128;
4911+ CK_GCM_PARAMS gcm_params;
4912+ gcm_params.pIv = iv.data();
4913+ gcm_params.ulIvLen = iv.size();
4914+ gcm_params.pAAD = aad.data();
4915+ gcm_params.ulAADLen = aad.size();
4916+ gcm_params.ulTagBits = 128;
4917
4918- SECItem params = {siBuffer, reinterpret_cast<unsigned char*>(&gcmParams),
4919- sizeof(gcmParams)};
4920+ SECItem params = {siBuffer, reinterpret_cast<unsigned char*>(&gcm_params),
4921+ sizeof(gcm_params)};
4922
4923 ScopedPK11SlotInfo slot(PK11_GetInternalSlot());
4924- SECItem keyItem = {siBuffer, key.data(),
4925- static_cast<unsigned int>(key.size())};
4926+ SECItem key_item = {siBuffer, key.data(),
4927+ static_cast<unsigned int>(key.size())};
4928
4929 // Import key.
4930- ScopedPK11SymKey symKey(PK11_ImportSymKey(
4931- slot.get(), mech, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr));
4932- ASSERT_TRUE(!!symKey) << msg;
4933+ ScopedPK11SymKey sym_key(PK11_ImportSymKey(
4934+ slot.get(), mech, PK11_OriginUnwrap, CKA_ENCRYPT, &key_item, nullptr));
4935+ ASSERT_TRUE(!!sym_key) << msg;
4936
4937 // Encrypt with bogus parameters.
4938- unsigned int outputLen = 0;
4939- std::vector<uint8_t> output(plaintext.size() + gcmParams.ulTagBits / 8);
4940- gcmParams.ulTagBits = 159082344;
4941+ unsigned int output_len = 0;
4942+ std::vector<uint8_t> output(plaintext.size() + gcm_params.ulTagBits / 8);
4943+ // "maxout" must be at least "inlen + tagBytes", or, in this case:
4944+ // "output.size()" must be at least "plaintext.size() + tagBytes"
4945+ gcm_params.ulTagBits = 128;
4946 SECStatus rv =
4947- PK11_Encrypt(symKey.get(), mech, &params, output.data(), &outputLen,
4948- output.size(), plaintext.data(), plaintext.size());
4949+ PK11_Encrypt(sym_key.get(), mech, &params, output.data(), &output_len,
4950+ output.size() - 10, plaintext.data(), plaintext.size());
4951 EXPECT_EQ(SECFailure, rv);
4952- EXPECT_EQ(0U, outputLen);
4953- gcmParams.ulTagBits = 128;
4954+ EXPECT_EQ(0U, output_len);
4955+
4956+ // The valid values for tag size in AES_GCM are:
4957+ // 32, 64, 96, 104, 112, 120 and 128.
4958+ gcm_params.ulTagBits = 110;
4959+ rv = PK11_Encrypt(sym_key.get(), mech, &params, output.data(), &output_len,
4960+ output.size(), plaintext.data(), plaintext.size());
4961+ EXPECT_EQ(SECFailure, rv);
4962+ EXPECT_EQ(0U, output_len);
4963
4964 // Encrypt.
4965- rv = PK11_Encrypt(symKey.get(), mech, &params, output.data(), &outputLen,
4966+ gcm_params.ulTagBits = 128;
4967+ rv = PK11_Encrypt(sym_key.get(), mech, &params, output.data(), &output_len,
4968 output.size(), plaintext.data(), plaintext.size());
4969 if (invalid_iv) {
4970- EXPECT_EQ(rv, SECFailure) << msg;
4971- EXPECT_EQ(0U, outputLen);
4972+ EXPECT_EQ(SECFailure, rv) << msg;
4973+ EXPECT_EQ(0U, output_len);
4974 return;
4975 }
4976- EXPECT_EQ(rv, SECSuccess) << msg;
4977+ EXPECT_EQ(SECSuccess, rv) << msg;
4978
4979- ASSERT_EQ(outputLen, output.size()) << msg;
4980+ ASSERT_EQ(output_len, output.size()) << msg;
4981
4982 // Check ciphertext and tag.
4983 if (invalid_ct) {
4984@@ -87,48 +97,49 @@ class Pkcs11AesGcmTest : public ::testing::TestWithParam<gcm_kat_value> {
4985 }
4986
4987 // Decrypt.
4988- unsigned int decryptedLen = 0;
4989+ unsigned int decrypted_len = 0;
4990 // The PK11 AES API is stupid, it expects an explicit IV and thus wants
4991 // a block more of available output memory.
4992 std::vector<uint8_t> decrypted(output.size());
4993- rv =
4994- PK11_Decrypt(symKey.get(), mech, &params, decrypted.data(),
4995- &decryptedLen, decrypted.size(), output.data(), outputLen);
4996- EXPECT_EQ(rv, SECSuccess) << msg;
4997- ASSERT_EQ(decryptedLen, plaintext.size()) << msg;
4998+ rv = PK11_Decrypt(sym_key.get(), mech, &params, decrypted.data(),
4999+ &decrypted_len, decrypted.size(), output.data(),
5000+ output_len);
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches