Rebase to NSS 3.31.0
This commit is contained in:
parent
c02a92318d
commit
60379b1140
|
@ -18,3 +18,4 @@ TestUser51.cert
|
|||
/nss-3.29.1.tar.gz
|
||||
/nss-3.29.3.tar.gz
|
||||
/nss-3.30.2.tar.gz
|
||||
/nss-3.31.0.tar.gz
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
diff -up nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c.gcc7 nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c
|
||||
--- nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c.gcc7 2017-02-08 14:34:04.212655936 +0100
|
||||
+++ nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c 2017-02-08 14:37:33.326388891 +0100
|
||||
@@ -89,7 +89,7 @@ pkix_pl_OcspRequest_Hashcode(
|
||||
PKIX_HASHCODE(ocspRq->signerCert, &signerHash, plContext,
|
||||
PKIX_CERTHASHCODEFAILED);
|
||||
|
||||
- *pHashcode = (((((extensionHash << 8) || certHash) << 8) ||
|
||||
+ *pHashcode = ((PKIX_UInt32)(((PKIX_UInt32)((extensionHash << 8) || certHash) << 8) ||
|
||||
dateHash) << 8) || signerHash;
|
||||
|
||||
cleanup:
|
|
@ -0,0 +1,468 @@
|
|||
# HG changeset patch
|
||||
# User Daiki Ueno <dueno@redhat.com>
|
||||
# Date 1496306850 -7200
|
||||
# Thu Jun 01 10:47:30 2017 +0200
|
||||
# Node ID a15755b99b544dc9643f6e3e7c3b36825112c5b2
|
||||
# Parent d20ee6560caf7c8ed6640583791700451fe06921
|
||||
Bug 1280846 - tests: adjust gtests to compile under modular builds, r=franziskus
|
||||
|
||||
diff --git a/cmd/platlibs.mk b/cmd/platlibs.mk
|
||||
--- a/cmd/platlibs.mk
|
||||
+++ b/cmd/platlibs.mk
|
||||
@@ -32,6 +32,12 @@ else
|
||||
DBMLIB = $(DIST)/lib/$(LIB_PREFIX)dbm.$(LIB_SUFFIX)
|
||||
endif
|
||||
|
||||
+ifeq ($(NSS_BUILD_UTIL_ONLY),1)
|
||||
+SECTOOL_LIB = $(NULL)
|
||||
+else
|
||||
+SECTOOL_LIB = $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX)
|
||||
+endif
|
||||
+
|
||||
ifdef USE_STATIC_LIBS
|
||||
|
||||
DEFINES += -DNSS_USE_STATIC_LIBS
|
||||
@@ -70,20 +76,10 @@ endif
|
||||
endif
|
||||
|
||||
NSS_LIBS_1=
|
||||
-SECTOOL_LIB=
|
||||
NSS_LIBS_2=
|
||||
NSS_LIBS_3=
|
||||
NSS_LIBS_4=
|
||||
|
||||
-ifneq ($(NSS_BUILD_UTIL_ONLY),1)
|
||||
-SECTOOL_LIB = \
|
||||
- $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX) \
|
||||
- $(NULL)
|
||||
-else
|
||||
-SECTOOL_LIB = \
|
||||
- $(NULL)
|
||||
-endif
|
||||
-
|
||||
ifneq ($(NSS_BUILD_SOFTOKEN_ONLY),1)
|
||||
ifeq ($(OS_ARCH), WINNT)
|
||||
# breakdown for windows
|
||||
@@ -121,9 +117,6 @@ NSS_LIBS_1 = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
-SECTOOL_LIB = \
|
||||
- $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX) \
|
||||
- $(NULL)
|
||||
NSS_LIBS_2 = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)pkcs12.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)pkcs7.$(LIB_SUFFIX) \
|
||||
@@ -201,7 +194,7 @@ ifeq ($(OS_ARCH), WINNT)
|
||||
|
||||
# $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
|
||||
EXTRA_LIBS += \
|
||||
- $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX) \
|
||||
+ $(SECTOOL_LIB) \
|
||||
$(NSSUTIL_LIB_DIR)/$(IMPORT_LIB_PREFIX)nssutil3$(IMPORT_LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(IMPORT_LIB_PREFIX)smime3$(IMPORT_LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(IMPORT_LIB_PREFIX)ssl3$(IMPORT_LIB_SUFFIX) \
|
||||
@@ -220,7 +213,7 @@ else
|
||||
|
||||
# $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
|
||||
EXTRA_LIBS += \
|
||||
- $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX) \
|
||||
+ $(SECTOOL_LIB) \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH), AIX)
|
||||
@@ -238,6 +231,7 @@ EXTRA_SHARED_LIBS += \
|
||||
-lplds4 \
|
||||
-lnspr4 \
|
||||
$(NULL)
|
||||
+ifndef NSS_BUILD_UTIL_ONLY
|
||||
ifndef NSS_BUILD_SOFTOKEN_ONLY
|
||||
EXTRA_SHARED_LIBS += \
|
||||
-lssl3 \
|
||||
@@ -245,6 +239,7 @@ EXTRA_SHARED_LIBS += \
|
||||
-lnss3
|
||||
endif
|
||||
endif
|
||||
+endif
|
||||
|
||||
ifdef SOFTOKEN_LIB_DIR
|
||||
ifdef NSS_USE_SYSTEM_FREEBL
|
||||
diff --git a/cpputil/scoped_ptrs_util.h b/cpputil/scoped_ptrs_util.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cpputil/scoped_ptrs_util.h
|
||||
@@ -0,0 +1,39 @@
|
||||
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
+/* vim: set ts=2 et sw=2 tw=80: */
|
||||
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
+
|
||||
+#ifndef scoped_ptrs_util_h__
|
||||
+#define scoped_ptrs_util_h__
|
||||
+
|
||||
+#include <memory>
|
||||
+#include "pkcs11uri.h"
|
||||
+#include "secoid.h"
|
||||
+
|
||||
+struct ScopedDelete {
|
||||
+ void operator()(SECAlgorithmID* id) { SECOID_DestroyAlgorithmID(id, true); }
|
||||
+ void operator()(SECItem* item) { SECITEM_FreeItem(item, true); }
|
||||
+ void operator()(PK11URI* uri) { PK11URI_DestroyURI(uri); }
|
||||
+ void operator()(PLArenaPool* arena) { PORT_FreeArena(arena, PR_FALSE); }
|
||||
+};
|
||||
+
|
||||
+template <class T>
|
||||
+struct ScopedMaybeDelete {
|
||||
+ void operator()(T* ptr) {
|
||||
+ if (ptr) {
|
||||
+ ScopedDelete del;
|
||||
+ del(ptr);
|
||||
+ }
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+#define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x> > Scoped##x
|
||||
+
|
||||
+SCOPED(SECAlgorithmID);
|
||||
+SCOPED(SECItem);
|
||||
+SCOPED(PK11URI);
|
||||
+
|
||||
+#undef SCOPED
|
||||
+
|
||||
+#endif // scoped_ptrs_util_h__
|
||||
diff --git a/gtests/certhigh_gtest/manifest.mn b/gtests/certhigh_gtest/manifest.mn
|
||||
--- a/gtests/certhigh_gtest/manifest.mn
|
||||
+++ b/gtests/certhigh_gtest/manifest.mn
|
||||
@@ -14,9 +14,9 @@ INCLUDES += -I$(CORE_DEPTH)/gtests/googl
|
||||
-I$(CORE_DEPTH)/gtests/common \
|
||||
-I$(CORE_DEPTH)/cpputil
|
||||
|
||||
-REQUIRES = nspr nss libdbm gtest
|
||||
+REQUIRES = nspr gtest
|
||||
|
||||
PROGRAM = certhigh_gtest
|
||||
|
||||
EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) $(EXTRA_OBJS) \
|
||||
- ../common/$(OBJDIR)/gtests$(OBJ_SUFFIX)
|
||||
+ $(DIST)/lib/$(LIB_PREFIX)gtestutil.$(LIB_SUFFIX)
|
||||
diff --git a/gtests/common/gtests-util.cc b/gtests/common/gtests-util.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gtests/common/gtests-util.cc
|
||||
@@ -0,0 +1,26 @@
|
||||
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
+
|
||||
+#include "nspr.h"
|
||||
+#include "secoid.h"
|
||||
+
|
||||
+#include <cstdlib>
|
||||
+
|
||||
+#define GTEST_HAS_RTTI 0
|
||||
+#include "gtest/gtest.h"
|
||||
+
|
||||
+int main(int argc, char **argv) {
|
||||
+ ::testing::InitGoogleTest(&argc, argv);
|
||||
+
|
||||
+ if (SECOID_Init() != SECSuccess) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ int rv = RUN_ALL_TESTS();
|
||||
+
|
||||
+ if (SECOID_Shutdown() != SECSuccess) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ return rv;
|
||||
+}
|
||||
diff --git a/gtests/common/manifest.mn b/gtests/common/manifest.mn
|
||||
--- a/gtests/common/manifest.mn
|
||||
+++ b/gtests/common/manifest.mn
|
||||
@@ -6,9 +6,13 @@ CORE_DEPTH = ../..
|
||||
DEPTH = ../..
|
||||
MODULE = nss
|
||||
|
||||
-CPPSRCS = \
|
||||
- gtests.cc \
|
||||
- $(NULL)
|
||||
+LIBRARY_NAME = gtestutil
|
||||
+
|
||||
+ifeq ($(NSS_BUILD_UTIL_ONLY),1)
|
||||
+CPPSRCS = gtests-util.cc
|
||||
+else
|
||||
+CPPSRCS = gtests.cc
|
||||
+endif
|
||||
|
||||
INCLUDES += -I$(CORE_DEPTH)/gtests/google_test/gtest/include \
|
||||
-I$(CORE_DEPTH)/gtests/common \
|
||||
@@ -17,6 +21,3 @@ INCLUDES += -I$(CORE_DEPTH)/gtests/googl
|
||||
REQUIRES = gtest
|
||||
|
||||
EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX)
|
||||
-
|
||||
-# NOTE: this is not actually used but required to build gtests.o
|
||||
-PROGRAM = gtests
|
||||
diff --git a/gtests/der_gtest/der_getint_unittest.cc b/gtests/der_gtest/der_getint_unittest.cc
|
||||
--- a/gtests/der_gtest/der_getint_unittest.cc
|
||||
+++ b/gtests/der_gtest/der_getint_unittest.cc
|
||||
@@ -4,14 +4,13 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
+#include "secder.h"
|
||||
+#include "secerr.h"
|
||||
+
|
||||
#include <climits>
|
||||
#include <memory>
|
||||
-#include "nss.h"
|
||||
-#include "pk11pub.h"
|
||||
-#include "secutil.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
-#include "scoped_ptrs.h"
|
||||
|
||||
namespace nss_test {
|
||||
|
||||
diff --git a/gtests/der_gtest/der_gtest.gyp b/gtests/der_gtest/der_gtest.gyp
|
||||
--- a/gtests/der_gtest/der_gtest.gyp
|
||||
+++ b/gtests/der_gtest/der_gtest.gyp
|
||||
@@ -12,7 +12,6 @@
|
||||
'type': 'executable',
|
||||
'sources': [
|
||||
'der_getint_unittest.cc',
|
||||
- 'der_private_key_import_unittest.cc',
|
||||
'der_quickder_unittest.cc',
|
||||
'<(DEPTH)/gtests/common/gtests.cc'
|
||||
],
|
||||
diff --git a/gtests/der_gtest/der_quickder_unittest.cc b/gtests/der_gtest/der_quickder_unittest.cc
|
||||
--- a/gtests/der_gtest/der_quickder_unittest.cc
|
||||
+++ b/gtests/der_gtest/der_quickder_unittest.cc
|
||||
@@ -7,11 +7,12 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
-#include "scoped_ptrs.h"
|
||||
+#include "scoped_ptrs_util.h"
|
||||
|
||||
#include "nss.h"
|
||||
#include "prerror.h"
|
||||
#include "secasn1.h"
|
||||
+#include "secder.h"
|
||||
#include "secerr.h"
|
||||
#include "secitem.h"
|
||||
|
||||
diff --git a/gtests/der_gtest/manifest.mn b/gtests/der_gtest/manifest.mn
|
||||
--- a/gtests/der_gtest/manifest.mn
|
||||
+++ b/gtests/der_gtest/manifest.mn
|
||||
@@ -8,7 +8,6 @@ MODULE = nss
|
||||
|
||||
CPPSRCS = \
|
||||
der_getint_unittest.cc \
|
||||
- der_private_key_import_unittest.cc \
|
||||
der_quickder_unittest.cc \
|
||||
$(NULL)
|
||||
|
||||
@@ -16,9 +15,9 @@ INCLUDES += -I$(CORE_DEPTH)/gtests/googl
|
||||
-I$(CORE_DEPTH)/gtests/common \
|
||||
-I$(CORE_DEPTH)/cpputil
|
||||
|
||||
-REQUIRES = nspr nss libdbm gtest
|
||||
+REQUIRES = nspr gtest
|
||||
|
||||
PROGRAM = der_gtest
|
||||
|
||||
EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) $(EXTRA_OBJS) \
|
||||
- ../common/$(OBJDIR)/gtests$(OBJ_SUFFIX)
|
||||
+ $(DIST)/lib/$(LIB_PREFIX)gtestutil.$(LIB_SUFFIX)
|
||||
diff --git a/gtests/pk11_gtest/manifest.mn b/gtests/pk11_gtest/manifest.mn
|
||||
--- a/gtests/pk11_gtest/manifest.mn
|
||||
+++ b/gtests/pk11_gtest/manifest.mn
|
||||
@@ -16,6 +16,7 @@ CPPSRCS = \
|
||||
pk11_prf_unittest.cc \
|
||||
pk11_prng_unittest.cc \
|
||||
pk11_rsapss_unittest.cc \
|
||||
+ pk11_der_private_key_import_unittest.cc \
|
||||
$(NULL)
|
||||
|
||||
INCLUDES += -I$(CORE_DEPTH)/gtests/google_test/gtest/include \
|
||||
@@ -27,5 +28,5 @@ REQUIRES = nspr nss libdbm gtest
|
||||
PROGRAM = pk11_gtest
|
||||
|
||||
EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) $(EXTRA_OBJS) \
|
||||
- ../common/$(OBJDIR)/gtests$(OBJ_SUFFIX)
|
||||
+ $(DIST)/lib/$(LIB_PREFIX)gtestutil.$(LIB_SUFFIX)
|
||||
|
||||
diff --git a/gtests/pk11_gtest/pk11_der_private_key_import_unittest.cc b/gtests/pk11_gtest/pk11_der_private_key_import_unittest.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/gtests/pk11_gtest/pk11_der_private_key_import_unittest.cc
|
||||
@@ -0,0 +1,110 @@
|
||||
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
+/* vim: set ts=2 et sw=2 tw=80: */
|
||||
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
+
|
||||
+#include <climits>
|
||||
+#include <memory>
|
||||
+#include "nss.h"
|
||||
+#include "pk11pub.h"
|
||||
+#include "secutil.h"
|
||||
+
|
||||
+#include "gtest/gtest.h"
|
||||
+#include "scoped_ptrs.h"
|
||||
+
|
||||
+namespace nss_test {
|
||||
+
|
||||
+const std::vector<uint8_t> kValidRSAKey = {
|
||||
+ // 512-bit RSA private key (PKCS#8)
|
||||
+ 0x30, 0x82, 0x01, 0x54, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a,
|
||||
+ 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x82,
|
||||
+ 0x01, 0x3e, 0x30, 0x82, 0x01, 0x3a, 0x02, 0x01, 0x00, 0x02, 0x41, 0x00,
|
||||
+ 0xa2, 0x40, 0xce, 0xb5, 0x4e, 0x70, 0xdc, 0x14, 0x82, 0x5b, 0x58, 0x7d,
|
||||
+ 0x2f, 0x5d, 0xfd, 0x46, 0x3c, 0x4b, 0x82, 0x50, 0xb6, 0x96, 0x00, 0x4a,
|
||||
+ 0x1a, 0xca, 0xaf, 0xe4, 0x9b, 0xcf, 0x38, 0x4a, 0x46, 0xaa, 0x9f, 0xb4,
|
||||
+ 0xd9, 0xc7, 0xee, 0x88, 0xe9, 0xef, 0x0a, 0x31, 0x5f, 0x53, 0x86, 0x8f,
|
||||
+ 0x63, 0x68, 0x0b, 0x58, 0x34, 0x72, 0x49, 0xba, 0xed, 0xd9, 0x34, 0x15,
|
||||
+ 0x16, 0xc4, 0xca, 0xb7, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x40, 0x34,
|
||||
+ 0xe6, 0xdc, 0x7e, 0xd0, 0xec, 0x8b, 0x55, 0x44, 0x8b, 0x73, 0xf6, 0x9d,
|
||||
+ 0x13, 0x10, 0x19, 0x6e, 0x5f, 0x50, 0x45, 0xf0, 0xc2, 0x47, 0xa5, 0xe1,
|
||||
+ 0xc6, 0x64, 0x43, 0x2d, 0x6a, 0x0a, 0xf7, 0xe7, 0xda, 0x40, 0xb8, 0x3a,
|
||||
+ 0xf0, 0x47, 0xdd, 0x01, 0xf5, 0xe0, 0xa9, 0x0e, 0x47, 0xc2, 0x24, 0xd7,
|
||||
+ 0xb5, 0x13, 0x3a, 0x35, 0x4d, 0x11, 0xaa, 0x50, 0x03, 0xb3, 0xe8, 0x54,
|
||||
+ 0x6c, 0x99, 0x01, 0x02, 0x21, 0x00, 0xcd, 0xb2, 0xd7, 0xa7, 0x43, 0x5b,
|
||||
+ 0xcb, 0x45, 0xe5, 0x0e, 0x86, 0xf6, 0xc1, 0x4e, 0x97, 0xed, 0x78, 0x1f,
|
||||
+ 0x09, 0x56, 0xcd, 0x26, 0xe6, 0xf7, 0x5e, 0xd9, 0xfc, 0x88, 0x12, 0x5f,
|
||||
+ 0x84, 0x07, 0x02, 0x21, 0x00, 0xc9, 0xee, 0x30, 0xaf, 0x6c, 0xb9, 0x5a,
|
||||
+ 0xc9, 0xc1, 0x14, 0x9e, 0xd8, 0x4b, 0x33, 0x38, 0x48, 0x17, 0x41, 0x35,
|
||||
+ 0x94, 0x09, 0xf3, 0x69, 0xc4, 0x97, 0xbe, 0x17, 0x7d, 0x95, 0x0f, 0xb7,
|
||||
+ 0xd1, 0x02, 0x21, 0x00, 0x8b, 0x0e, 0xf9, 0x8d, 0x61, 0x13, 0x20, 0x63,
|
||||
+ 0x9b, 0x0b, 0x6c, 0x20, 0x4a, 0xe4, 0xa7, 0xfe, 0xe8, 0xf3, 0x0a, 0x6c,
|
||||
+ 0x3c, 0xfa, 0xac, 0xaf, 0xd4, 0xd6, 0xc7, 0x4a, 0xf2, 0x28, 0xd2, 0x67,
|
||||
+ 0x02, 0x20, 0x6b, 0x0e, 0x1d, 0xbf, 0x93, 0x5b, 0xbd, 0x77, 0x43, 0x27,
|
||||
+ 0x24, 0x83, 0xb5, 0x72, 0xa5, 0x3f, 0x0b, 0x1d, 0x26, 0x43, 0xa2, 0xf6,
|
||||
+ 0xea, 0xb7, 0x30, 0x5f, 0xb6, 0x62, 0x7c, 0xf9, 0x85, 0x51, 0x02, 0x20,
|
||||
+ 0x3d, 0x22, 0x63, 0x15, 0x6b, 0x32, 0x41, 0x46, 0x44, 0x78, 0xb7, 0x13,
|
||||
+ 0xeb, 0x85, 0x4c, 0x4f, 0x6b, 0x3e, 0xf0, 0x52, 0xf0, 0x46, 0x3b, 0x65,
|
||||
+ 0xd8, 0x21, 0x7d, 0xae, 0xc0, 0x09, 0x98, 0x34};
|
||||
+
|
||||
+const std::vector<uint8_t> kInvalidLengthKey = {
|
||||
+ 0x30, 0x1b, // SEQUENCE(len=27)
|
||||
+ 0x02, 0x01, 0x00, // INT(len=1) = 0
|
||||
+ 0x30, 0x13, // SEQUENCE(len=19)
|
||||
+ 0x06, 0x07, // OID(len=7)
|
||||
+ // dhPublicKey (1.2.840.10046.2.1)
|
||||
+ 0x2a, 0x86, 0x48, 0xce, 0x3e, 0x02, 0x01, 0x06, 0x08, // OID(len=8)
|
||||
+ // prime256v1 (1.2.840.10045.3.1.7) */
|
||||
+ 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x04,
|
||||
+ 0x00 // OCTET STRING(len=0)
|
||||
+};
|
||||
+
|
||||
+const std::vector<uint8_t> kInvalidZeroLengthKey = {
|
||||
+ 0x30, 0x1a, // SEQUENCE(len=26)
|
||||
+ 0x02, 0x01, 0x00, // INT(len=1) = 0
|
||||
+ 0x30, 0x13, // SEQUENCE(len=19)
|
||||
+ 0x06, 0x07, // OID(len=7)
|
||||
+ // dhPublicKey (1.2.840.10046.2.1)
|
||||
+ 0x2a, 0x86, 0x48, 0xce, 0x3e, 0x02, 0x01, 0x06, 0x08, // OID(len=8)
|
||||
+ // prime256v1 (1.2.840.10045.3.1.7) */
|
||||
+ 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x04,
|
||||
+ 0x00 // OCTET STRING(len=0)
|
||||
+};
|
||||
+
|
||||
+class DERPrivateKeyImportTest : public ::testing::Test {
|
||||
+ public:
|
||||
+ bool ParsePrivateKey(const std::vector<uint8_t>& data) {
|
||||
+ ScopedPK11SlotInfo slot(PK11_GetInternalSlot());
|
||||
+ EXPECT_TRUE(slot);
|
||||
+
|
||||
+ SECKEYPrivateKey* key = nullptr;
|
||||
+ SECItem item = {siBuffer, const_cast<unsigned char*>(data.data()),
|
||||
+ (unsigned int)data.size()};
|
||||
+
|
||||
+ SECStatus rv = PK11_ImportDERPrivateKeyInfoAndReturnKey(
|
||||
+ slot.get(), &item, nullptr, nullptr, false, false, KU_ALL, &key,
|
||||
+ nullptr);
|
||||
+
|
||||
+ EXPECT_EQ(rv == SECSuccess, key != nullptr);
|
||||
+ SECKEY_DestroyPrivateKey(key);
|
||||
+
|
||||
+ return rv == SECSuccess;
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+TEST_F(DERPrivateKeyImportTest, ImportPrivateRSAKey) {
|
||||
+ EXPECT_TRUE(ParsePrivateKey(kValidRSAKey));
|
||||
+ EXPECT_FALSE(PORT_GetError());
|
||||
+}
|
||||
+
|
||||
+TEST_F(DERPrivateKeyImportTest, ImportInvalidPrivateKey) {
|
||||
+ EXPECT_FALSE(ParsePrivateKey(kInvalidLengthKey));
|
||||
+ EXPECT_EQ(PORT_GetError(), SEC_ERROR_BAD_DER);
|
||||
+}
|
||||
+
|
||||
+TEST_F(DERPrivateKeyImportTest, ImportZeroLengthPrivateKey) {
|
||||
+ EXPECT_FALSE(ParsePrivateKey(kInvalidZeroLengthKey));
|
||||
+ EXPECT_EQ(PORT_GetError(), SEC_ERROR_BAD_KEY);
|
||||
+}
|
||||
+
|
||||
+} // namespace nss_test
|
||||
diff --git a/gtests/pk11_gtest/pk11_gtest.gyp b/gtests/pk11_gtest/pk11_gtest.gyp
|
||||
--- a/gtests/pk11_gtest/pk11_gtest.gyp
|
||||
+++ b/gtests/pk11_gtest/pk11_gtest.gyp
|
||||
@@ -20,6 +20,7 @@
|
||||
'pk11_prf_unittest.cc',
|
||||
'pk11_prng_unittest.cc',
|
||||
'pk11_rsapss_unittest.cc',
|
||||
+ 'pk11_der_private_key_import_unittest.cc',
|
||||
'<(DEPTH)/gtests/common/gtests.cc'
|
||||
],
|
||||
'dependencies': [
|
||||
diff --git a/gtests/util_gtest/manifest.mn b/gtests/util_gtest/manifest.mn
|
||||
--- a/gtests/util_gtest/manifest.mn
|
||||
+++ b/gtests/util_gtest/manifest.mn
|
||||
@@ -25,5 +25,5 @@ PROGRAM = util_gtest
|
||||
EXTRA_LIBS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)nssutil.$(LIB_SUFFIX) \
|
||||
- ../common/$(OBJDIR)/gtests$(OBJ_SUFFIX) \
|
||||
+ $(DIST)/lib/$(LIB_PREFIX)gtestutil.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
diff --git a/gtests/util_gtest/util_b64_unittest.cc b/gtests/util_gtest/util_b64_unittest.cc
|
||||
--- a/gtests/util_gtest/util_b64_unittest.cc
|
||||
+++ b/gtests/util_gtest/util_b64_unittest.cc
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "nssb64.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
-#include "scoped_ptrs.h"
|
||||
+#include "scoped_ptrs_util.h"
|
||||
|
||||
namespace nss_test {
|
||||
|
||||
diff --git a/gtests/util_gtest/util_pkcs11uri_unittest.cc b/gtests/util_gtest/util_pkcs11uri_unittest.cc
|
||||
--- a/gtests/util_gtest/util_pkcs11uri_unittest.cc
|
||||
+++ b/gtests/util_gtest/util_pkcs11uri_unittest.cc
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "pkcs11uri.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
-#include "scoped_ptrs.h"
|
||||
+#include "scoped_ptrs_util.h"
|
||||
|
||||
namespace nss_test {
|
||||
|
||||
diff --git a/tests/gtests/gtests.sh b/tests/gtests/gtests.sh
|
||||
--- a/tests/gtests/gtests.sh
|
||||
+++ b/tests/gtests/gtests.sh
|
||||
@@ -24,7 +24,7 @@ gtest_init()
|
||||
{
|
||||
cd "$(dirname "$1")"
|
||||
if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
|
||||
- cd common
|
||||
+ cd ../common
|
||||
. ./init.sh
|
||||
fi
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
diff -up ./gtests/manifest.mn.skip_util_gtest ./gtests/manifest.mn
|
||||
--- ./gtests/manifest.mn.skip_util_gtest 2016-09-29 12:05:28.858019733 +0200
|
||||
+++ ./gtests/manifest.mn 2016-09-29 12:06:17.298681765 +0200
|
||||
@@ -9,8 +9,5 @@ DIRS = \
|
||||
google_test \
|
||||
diff -up nss/gtests/manifest.mn.skip_util_gtest nss/gtests/manifest.mn
|
||||
--- nss/gtests/manifest.mn.skip_util_gtest 2017-06-21 17:40:39.997865113 +0200
|
||||
+++ nss/gtests/manifest.mn 2017-06-21 17:40:52.554579498 +0200
|
||||
@@ -10,8 +10,6 @@ DIRS = \
|
||||
common \
|
||||
der_gtest \
|
||||
certdb_gtest \
|
||||
certhigh_gtest \
|
||||
- der_gtest \
|
||||
- util_gtest \
|
||||
- pk11_gtest \
|
||||
- ssl_gtest \
|
||||
pk11_gtest \
|
||||
ssl_gtest \
|
||||
nss_bogo_shim \
|
||||
$(NULL)
|
||||
|
|
19
nss.spec
19
nss.spec
|
@ -1,6 +1,6 @@
|
|||
%global nspr_version 4.14.0
|
||||
%global nss_util_version 3.30.2
|
||||
%global nss_softokn_version 3.30.2
|
||||
%global nspr_version 4.15.0
|
||||
%global nss_util_version 3.31.0
|
||||
%global nss_softokn_version 3.31.0
|
||||
%global unsupported_tools_directory %{_libdir}/nss/unsupported-tools
|
||||
%global allTools "certutil cmsutil crlutil derdump modutil pk12util signtool signver ssltap vfychain vfyserv"
|
||||
|
||||
|
@ -18,10 +18,10 @@
|
|||
|
||||
Summary: Network Security Services
|
||||
Name: nss
|
||||
Version: 3.30.2
|
||||
Version: 3.31.0
|
||||
# for Rawhide, please always use release >= 2
|
||||
# for Fedora release branches, please use release < 2 (1.0, 1.1, ...)
|
||||
Release: 1.1%{?dist}
|
||||
Release: 1.0%{?dist}
|
||||
License: MPLv2.0
|
||||
URL: http://www.mozilla.org/projects/security/pki/nss/
|
||||
Group: System Environment/Libraries
|
||||
|
@ -110,10 +110,10 @@ Patch50: iquote.patch
|
|||
Patch58: rhbz1185708-enable-ecc-3des-ciphers-by-default.patch
|
||||
# Upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=1279520
|
||||
Patch59: nss-check-policy-file.patch
|
||||
# Upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=1280846
|
||||
Patch62: nss-skip-util-gtest.patch
|
||||
Patch63: nss-gcc7.patch
|
||||
Patch64: nss-1328318-v8-3.30.patch
|
||||
Patch66: nss-gtests-split.patch
|
||||
|
||||
%description
|
||||
Network Security Services (NSS) is a set of libraries designed to
|
||||
|
@ -199,6 +199,7 @@ pushd nss
|
|||
%patch62 -p0 -b .skip_util_gtest
|
||||
%patch63 -p1 -b .gcc7
|
||||
%patch64 -p1 -b .1328318
|
||||
%patch66 -p1 -b .gtests-split
|
||||
popd
|
||||
|
||||
#########################################################
|
||||
|
@ -227,9 +228,6 @@ popd
|
|||
%{__rm} -rf ./nss/cmd/fipstest
|
||||
%{__rm} -rf ./nss/cmd/rsaperf_low
|
||||
|
||||
######## Remove portions that need to statically link with libnssutil.a
|
||||
%{__rm} -rf ./nss/external_tests/util_gtests
|
||||
|
||||
|
||||
%build
|
||||
|
||||
|
@ -803,6 +801,9 @@ fi
|
|||
|
||||
|
||||
%changelog
|
||||
* Wed Jun 21 2017 Daiki Ueno <dueno@redhat.com> - 3.31.0-1.0
|
||||
- Rebase to NSS 3.31.0
|
||||
|
||||
* Wed May 10 2017 Daiki Ueno <dueno@redhat.com> - 3.30.2-1.1
|
||||
- Re-enable tests on armv7hl
|
||||
- Enable TLS 1.3 again
|
||||
|
|
2
sources
2
sources
|
@ -3,4 +3,4 @@ SHA512 (blank-cert9.db) = 2f8eab4c0612210ee47db8a3a80c1b58a0b43849551af78c7da403
|
|||
SHA512 (blank-key3.db) = 01f7314e9fc8a7c9aa997652624cfcde213d18a6b3bb31840c1a60bbd662e56b5bc3221d13874abb42ce78163b225a6dfce2e1326cf6dd29366ad9c28ba5a71c
|
||||
SHA512 (blank-key4.db) = 8fedae93af7163da23fe9492ea8e785a44c291604fa98e58438448efb69c85d3253fc22b926d5c3209c62e58a86038fd4d78a1c4c068bc00600a7f3e5382ebe7
|
||||
SHA512 (blank-secmod.db) = 06a2dbd861839ef6315093459328b500d3832333a34b30e6fac4a2503af337f014a4d319f0f93322409e719142904ce8bc08252ae9a4f37f30d4c3312e900310
|
||||
SHA512 (nss-3.30.2.tar.gz) = 02f14bc000cbde42268c4b6f42df80680b010d1491643ef9b11e0bac31a286a2e7fa251c40cb4ac70b64883a1b90efc64440ef9d797357f8a47cd37195fc5500
|
||||
SHA512 (nss-3.31.0.tar.gz) = 9f59c5013021c2718b7132b47610a63414e53ccc99054a405383e7d980c4e03634daea6e9cb04424ba7c1e52dc416f651059d2909c232cccefc85c54c38994ad
|
||||
|
|
Loading…
Reference in New Issue