[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 75/150: nss: use PK11_CreateManagedGenericObject()
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 75/150: nss: use PK11_CreateManagedGenericObject() if available |
Date: |
Fri, 30 Mar 2018 16:48:49 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 1605d93a7b8ac4b7f348e304e018e9d15ffaabf0
Author: Kamil Dudka <address@hidden>
AuthorDate: Thu Feb 8 11:23:49 2018 +0100
nss: use PK11_CreateManagedGenericObject() if available
... so that the memory allocated by applications using libcurl does not
grow per each TLS connection.
Bug: https://bugzilla.redhat.com/1510247
Closes #2297
---
configure.ac | 9 +++++++++
lib/vtls/nss.c | 12 +++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index d305e9693..798fa5f1e 100755
--- a/configure.ac
+++ b/configure.ac
@@ -2483,6 +2483,15 @@ if test -z "$ssl_backends" -o "x$OPT_NSS" != xno; then
if test "x$USE_NSS" = "xyes"; then
AC_MSG_NOTICE([detected NSS version $version])
+ dnl PK11_CreateManagedGenericObject() was introduced in NSS 3.34 because
+ dnl PK11_DestroyGenericObject() does not release resources allocated by
+ dnl PK11_CreateGenericObject() early enough.
+ AC_CHECK_FUNC(PK11_CreateManagedGenericObject,
+ [
+ AC_DEFINE(HAVE_PK11_CREATEMANAGEDGENERICOBJECT, 1,
+ [if you have the PK11_CreateManagedGenericObject function])
+ ])
+
dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
NSS_LIBS=$addlib
AC_SUBST([NSS_LIBS])
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index a3ef37a12..458f9d814 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -440,7 +440,17 @@ static CURLcode nss_create_object(struct ssl_connect_data
*connssl,
PK11_SETATTRS(attrs, attr_cnt, CKA_TRUST, pval, sizeof(*pval));
}
- obj = PK11_CreateGenericObject(slot, attrs, attr_cnt, PR_FALSE);
+ /* PK11_CreateManagedGenericObject() was introduced in NSS 3.34 because
+ * PK11_DestroyGenericObject() does not release resources allocated by
+ * PK11_CreateGenericObject() early enough. */
+ obj =
+#ifdef HAVE_PK11_CREATEMANAGEDGENERICOBJECT
+ PK11_CreateManagedGenericObject
+#else
+ PK11_CreateGenericObject
+#endif
+ (slot, attrs, attr_cnt, PR_FALSE);
+
PK11_FreeSlot(slot);
if(!obj)
return result;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 49/150: build-wolfssl.bat: Extend VC15 support to include Enterprise and Professional, (continued)
- [GNUnet-SVN] [gnurl] 49/150: build-wolfssl.bat: Extend VC15 support to include Enterprise and Professional, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 83/150: TODO: 1.1 Option to refuse usernames in URLs, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 57/150: content_encoding: Add "none" alias to "identity", gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 70/150: libcurl-security.3: the http://192.168.0.1/my_router_config case, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 106/150: TODO: remove "sha-256 digest", added in 2b5b37cb9109e7c2, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 85/150: CURLOPT_HEADERFUNCTION.3: fix typo from d939226813, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 73/150: BINDINGS: fix curb link (and remove ruby-curl-multi), gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 122/150: winbuild: prefer documented zlib library names, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 44/150: build: fix termios issue on android cross-compile, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 37/150: build: fix windows build methods for curl_ctype.c, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 75/150: nss: use PK11_CreateManagedGenericObject() if available,
gnunet <=
- [GNUnet-SVN] [gnurl] 58/150: schannel: fix "no previous prototype" compiler warning, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 56/150: build-openssl.bat: Follow up to 648679ab8e to suppress copy/move output, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 90/150: CURLOPT_HEADER.3: clarify problems with different data sizes, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 89/150: test1556: verify >16KB headers to the header callback, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 94/150: CURLOPT_RESOLVE: Add support for multiple IP addresses per entry, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 120/150: curl.1: mention how to add numerical IP addresses in NO_PROXY, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 35/150: http2: set DEBUG_HTTP2 to enable more HTTP/2 logging, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 65/150: tlsauthtype.d: works only if libcurl is built with TLS-SRP support, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 76/150: KNOWN_BUGS: 2.5 curl should not offer "ALPN: h2" when using https-proxy, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 96/150: hostip: fix 'potentially uninitialized variable' warning, gnunet, 2018/03/30