gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 24/254: nss: do not leak PKCS #11 slot while loadin


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 24/254: nss: do not leak PKCS #11 slot while loading a key
Date: Sat, 17 Jun 2017 16:50:56 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.

commit c8ea86f377a2f341db635ec96f99314023b5a8f3
Author: Kamil Dudka <address@hidden>
AuthorDate: Mon Apr 24 15:01:04 2017 +0200

    nss: do not leak PKCS #11 slot while loading a key
    
    It could prevent nss-pem from being unloaded later on.
    
    Bug: https://bugzilla.redhat.com/1444860
---
 lib/vtls/nss.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index e1a122947..0e57ab45d 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -603,7 +603,7 @@ fail:
 static CURLcode nss_load_key(struct connectdata *conn, int sockindex,
                              char *key_file)
 {
-  PK11SlotInfo *slot;
+  PK11SlotInfo *slot, *tmp;
   SECStatus status;
   CURLcode result;
   struct ssl_connect_data *ssl = conn->ssl;
@@ -622,7 +622,9 @@ static CURLcode nss_load_key(struct connectdata *conn, int 
sockindex,
     return CURLE_SSL_CERTPROBLEM;
 
   /* This will force the token to be seen as re-inserted */
-  SECMOD_WaitForAnyTokenEvent(mod, 0, 0);
+  tmp = SECMOD_WaitForAnyTokenEvent(mod, 0, 0);
+  if(tmp)
+    PK11_FreeSlot(tmp);
   PK11_IsPresent(slot);
 
   status = PK11_Authenticate(slot, PR_TRUE, SSL_SET_OPTION(key_passwd));

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]