OLD | NEW |
1 diff -pu a/nss/lib/ssl/ssl3con.c b/nss/lib/ssl/ssl3con.c | 1 diff --git a/ssl/ssl.h b/ssl/ssl.h |
2 --- a/nss/lib/ssl/ssl3con.c» 2014-01-17 19:00:52.843413560 -0800 | 2 index be6d88e..57771cd 100644 |
3 +++ b/nss/lib/ssl/ssl3con.c» 2014-01-17 19:01:36.374129696 -0800 | 3 --- a/ssl/ssl.h |
4 @@ -11318,7 +11318,7 @@ ssl3_FinishHandshake(sslSocket * ss) | 4 +++ b/ssl/ssl.h |
5 ss->ssl3.hs.receivedNewSessionTicket = PR_FALSE; | 5 @@ -900,6 +900,18 @@ SSL_IMPORT int SSL_DataPending(PRFileDesc *fd); |
6 } | |
7 | |
8 - if (ss->ssl3.hs.cacheSID) { | |
9 + if (ss->ssl3.hs.cacheSID && ss->sec.isServer) { | |
10 » PORT_Assert(ss->sec.ci.sid->cached == never_cached); | |
11 » (*ss->sec.cache)(ss->sec.ci.sid); | |
12 » ss->ssl3.hs.cacheSID = PR_FALSE; | |
13 diff -pu a/nss/lib/ssl/ssl.h b/nss/lib/ssl/ssl.h | |
14 --- a/nss/lib/ssl/ssl.h»2014-01-17 19:00:52.843413560 -0800 | |
15 +++ b/nss/lib/ssl/ssl.h»2014-01-17 19:01:36.374129696 -0800 | |
16 @@ -892,6 +892,18 @@ SSL_IMPORT int SSL_DataPending(PRFileDes | |
17 SSL_IMPORT SECStatus SSL_InvalidateSession(PRFileDesc *fd); | 6 SSL_IMPORT SECStatus SSL_InvalidateSession(PRFileDesc *fd); |
18 | 7 |
19 /* | 8 /* |
20 +** Cache the SSL session associated with fd, if it has not already been cached. | 9 +** Cache the SSL session associated with fd, if it has not already been cached. |
21 +*/ | 10 +*/ |
22 +SSL_IMPORT SECStatus SSL_CacheSession(PRFileDesc *fd); | 11 +SSL_IMPORT SECStatus SSL_CacheSession(PRFileDesc *fd); |
23 + | 12 + |
24 +/* | 13 +/* |
25 +** Cache the SSL session associated with fd, if it has not already been cached. | 14 +** Cache the SSL session associated with fd, if it has not already been cached. |
26 +** This function may only be called when processing within a callback assigned | 15 +** This function may only be called when processing within a callback assigned |
27 +** via SSL_HandshakeCallback | 16 +** via SSL_HandshakeCallback |
28 +*/ | 17 +*/ |
29 +SSL_IMPORT SECStatus SSL_CacheSessionUnlocked(PRFileDesc *fd); | 18 +SSL_IMPORT SECStatus SSL_CacheSessionUnlocked(PRFileDesc *fd); |
30 + | 19 + |
31 +/* | 20 +/* |
32 ** Return a SECItem containing the SSL session ID associated with the fd. | 21 ** Return a SECItem containing the SSL session ID associated with the fd. |
33 */ | 22 */ |
34 SSL_IMPORT SECItem *SSL_GetSessionID(PRFileDesc *fd); | 23 SSL_IMPORT SECItem *SSL_GetSessionID(PRFileDesc *fd); |
35 diff -pu a/nss/lib/ssl/sslsecur.c b/nss/lib/ssl/sslsecur.c | 24 diff --git a/ssl/ssl3con.c b/ssl/ssl3con.c |
36 --- a/nss/lib/ssl/sslsecur.c» 2014-01-17 17:59:03.242109996 -0800 | 25 index 9d77d35..67d3da6 100644 |
37 +++ b/nss/lib/ssl/sslsecur.c» 2014-01-17 19:01:36.374129696 -0800 | 26 --- a/ssl/ssl3con.c |
38 @@ -1469,6 +1469,49 @@ SSL_InvalidateSession(PRFileDesc *fd) | 27 +++ b/ssl/ssl3con.c |
| 28 @@ -11367,7 +11367,7 @@ ssl3_FinishHandshake(sslSocket * ss) |
| 29 ss->ssl3.hs.receivedNewSessionTicket = PR_FALSE; |
| 30 } |
| 31 |
| 32 - if (ss->ssl3.hs.cacheSID) { |
| 33 + if (ss->ssl3.hs.cacheSID && ss->sec.isServer) { |
| 34 » PORT_Assert(ss->sec.ci.sid->cached == never_cached); |
| 35 » (*ss->sec.cache)(ss->sec.ci.sid); |
| 36 » ss->ssl3.hs.cacheSID = PR_FALSE; |
| 37 diff --git a/ssl/sslsecur.c b/ssl/sslsecur.c |
| 38 index 5c6751a..00ab455 100644 |
| 39 --- a/ssl/sslsecur.c |
| 40 +++ b/ssl/sslsecur.c |
| 41 @@ -1467,6 +1467,49 @@ SSL_InvalidateSession(PRFileDesc *fd) |
39 return rv; | 42 return rv; |
40 } | 43 } |
41 | 44 |
42 +static void | 45 +static void |
43 +ssl3_CacheSessionUnlocked(sslSocket *ss) | 46 +ssl3_CacheSessionUnlocked(sslSocket *ss) |
44 +{ | 47 +{ |
45 + PORT_Assert(!ss->sec.isServer); | 48 + PORT_Assert(!ss->sec.isServer); |
46 + | 49 + |
47 + if (ss->ssl3.hs.cacheSID) { | 50 + if (ss->ssl3.hs.cacheSID) { |
48 + ss->sec.cache(ss->sec.ci.sid); | 51 + ss->sec.cache(ss->sec.ci.sid); |
(...skipping 29 matching lines...) Expand all Loading... |
78 + if (ss) { | 81 + if (ss) { |
79 + ssl3_CacheSessionUnlocked(ss); | 82 + ssl3_CacheSessionUnlocked(ss); |
80 + rv = SECSuccess; | 83 + rv = SECSuccess; |
81 + } | 84 + } |
82 + return rv; | 85 + return rv; |
83 +} | 86 +} |
84 + | 87 + |
85 SECItem * | 88 SECItem * |
86 SSL_GetSessionID(PRFileDesc *fd) | 89 SSL_GetSessionID(PRFileDesc *fd) |
87 { | 90 { |
OLD | NEW |