aboutsummaryrefslogtreecommitdiff
path: root/security/nss/files/patch-3.60.1
blob: 27700ad28096454df3a60beb97af94f5f6305995 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
Generated by git diff --no-prefix NSS_3_60_RTM..NSS_3_60_1_RTM
https://hg.mozilla.org/projects/nss/rev/b47465be3b6f
https://hg.mozilla.org/projects/nss/rev/83173cdd72f6

diff --git lib/dev/devslot.c lib/dev/devslot.c
index 3f4e54e061..5021408bf0 100644
--- lib/dev/devslot.c
+++ lib/dev/devslot.c
@@ -171,12 +171,11 @@ nssSlot_IsTokenPresent(
 
     nssSlot_EnterMonitor(slot);
     ckrv = CKAPI(epv)->C_GetSlotInfo(slot->slotID, &slotInfo);
+    nssSlot_ExitMonitor(slot);
     if (ckrv != CKR_OK) {
-        if (slot->token) {
-            slot->token->base.name[0] = 0; /* XXX */
-        }
+        slot->token->base.name[0] = 0; /* XXX */
         isPresent = PR_FALSE;
-        goto done; /* slot lock held */
+        goto done;
     }
     slot->ckFlags = slotInfo.flags;
     /* check for the presence of the token */
@@ -184,11 +183,10 @@ nssSlot_IsTokenPresent(
         if (!slot->token) {
             /* token was never present */
             isPresent = PR_FALSE;
-            goto done; /* slot lock held */
+            goto done;
         }
         session = nssToken_GetDefaultSession(slot->token);
         if (session) {
-            nssSlot_ExitMonitor(slot);
             nssSession_EnterMonitor(session);
             /* token is not present */
             if (session->handle != CK_INVALID_HANDLE) {
@@ -198,12 +196,6 @@ nssSlot_IsTokenPresent(
                 session->handle = CK_INVALID_HANDLE;
             }
             nssSession_ExitMonitor(session);
-            nssSlot_EnterMonitor(slot);
-            if (!slot->token) {
-                /* Check token presence after re-acquiring lock */
-                isPresent = PR_FALSE;
-                goto done; /* slot lock held */
-            }
         }
         if (slot->token->base.name[0] != 0) {
             /* notify the high-level cache that the token is removed */
@@ -214,23 +206,14 @@ nssSlot_IsTokenPresent(
         /* clear the token cache */
         nssToken_Remove(slot->token);
         isPresent = PR_FALSE;
-        goto done; /* slot lock held */
-    }
-    if (!slot->token) {
-        /* This should not occur, based on the fact that the
-         * below calls will dereference NULL otherwise. */
-        PORT_Assert(0);
-        isPresent = PR_FALSE;
-        goto done; /* slot lock held */
+        goto done;
     }
-
     /* token is present, use the session info to determine if the card
      * has been removed and reinserted.
      */
     session = nssToken_GetDefaultSession(slot->token);
     if (session) {
         PRBool tokenRemoved;
-        nssSlot_ExitMonitor(slot);
         nssSession_EnterMonitor(session);
         if (session->handle != CK_INVALID_HANDLE) {
             CK_SESSION_INFO sessionInfo;
@@ -244,16 +227,10 @@ nssSlot_IsTokenPresent(
         }
         tokenRemoved = (session->handle == CK_INVALID_HANDLE);
         nssSession_ExitMonitor(session);
-        nssSlot_EnterMonitor(slot);
         /* token not removed, finished */
         if (!tokenRemoved) {
             isPresent = PR_TRUE;
-            goto done; /* slot lock held */
-        }
-        if (!slot->token) {
-            /* Check token presence after re-acquiring lock */
-            isPresent = PR_FALSE;
-            goto done; /* slot lock held */
+            goto done;
         }
     }
     /* the token has been removed, and reinserted, or the slot contains
@@ -271,7 +248,6 @@ nssSlot_IsTokenPresent(
         isPresent = PR_FALSE;
     }
 done:
-    nssSlot_ExitMonitor(slot);
     /* Once we've set up the condition variable,
      * Before returning, it's necessary to:
      *  1) Set the lastTokenPingTime so that any other threads waiting on this
diff --git lib/nss/nss.h lib/nss/nss.h
index 4a87939bdd..0fd14629e3 100644
--- lib/nss/nss.h
+++ lib/nss/nss.h
@@ -22,10 +22,10 @@
  * The format of the version string should be
  *     "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]"
  */
-#define NSS_VERSION "3.60" _NSS_CUSTOMIZED
+#define NSS_VERSION "3.60.1" _NSS_CUSTOMIZED
 #define NSS_VMAJOR 3
 #define NSS_VMINOR 60
-#define NSS_VPATCH 0
+#define NSS_VPATCH 1
 #define NSS_VBUILD 0
 #define NSS_BETA PR_FALSE
 
diff --git lib/softoken/softkver.h lib/softoken/softkver.h
index 16e0e6b523..4b5b66d8f2 100644
--- lib/softoken/softkver.h
+++ lib/softoken/softkver.h
@@ -17,10 +17,10 @@
  * The format of the version string should be
  *     "<major version>.<minor version>[.<patch level>[.<build number>]][ <ECC>][ <Beta>]"
  */
-#define SOFTOKEN_VERSION "3.60" SOFTOKEN_ECC_STRING
+#define SOFTOKEN_VERSION "3.60.1" SOFTOKEN_ECC_STRING
 #define SOFTOKEN_VMAJOR 3
 #define SOFTOKEN_VMINOR 60
-#define SOFTOKEN_VPATCH 0
+#define SOFTOKEN_VPATCH 1
 #define SOFTOKEN_VBUILD 0
 #define SOFTOKEN_BETA PR_FALSE
 
diff --git lib/util/nssutil.h lib/util/nssutil.h
index 6db5095718..98f3aaf493 100644
--- lib/util/nssutil.h
+++ lib/util/nssutil.h
@@ -19,10 +19,10 @@
  * The format of the version string should be
  *     "<major version>.<minor version>[.<patch level>[.<build number>]][ <Beta>]"
  */
-#define NSSUTIL_VERSION "3.60"
+#define NSSUTIL_VERSION "3.60.1"
 #define NSSUTIL_VMAJOR 3
 #define NSSUTIL_VMINOR 60
-#define NSSUTIL_VPATCH 0
+#define NSSUTIL_VPATCH 1
 #define NSSUTIL_VBUILD 0
 #define NSSUTIL_BETA PR_FALSE