OLD | NEW |
(Empty) | |
| 1 Index: net/third_party/nss/ssl/snapstart.c |
| 2 =================================================================== |
| 3 --- net/third_party/nss/ssl/snapstart.c (revision 64952) |
| 4 +++ net/third_party/nss/ssl/snapstart.c (revision 64953) |
| 5 @@ -48,10 +48,6 @@ |
| 6 |
| 7 /* TODO(agl): Add support for snap starting with compression. */ |
| 8 |
| 9 -/* TODO(agl): Free snapStartApplicationData as soon as the handshake has |
| 10 -** completed. |
| 11 -*/ |
| 12 - |
| 13 #include "pk11pub.h" |
| 14 #include "ssl.h" |
| 15 #include "sslimpl.h" |
| 16 @@ -821,6 +817,7 @@ |
| 17 rv = ssl3_AppendSnapStartApplicationData( |
| 18 ss, ss->ssl3.snapStartApplicationData.data, |
| 19 ss->ssl3.snapStartApplicationData.len); |
| 20 + SECITEM_FreeItem(&ss->ssl3.snapStartApplicationData, PR_FALSE); |
| 21 if (rv != SECSuccess) |
| 22 goto loser; |
| 23 } |
| 24 @@ -1053,6 +1053,8 @@ |
| 25 ss->ssl3.hs.snapStartType = snap_start_resume_recovery; |
| 26 } |
| 27 |
| 28 + ss->ssl3.nextProtoState = SSL_NEXT_PROTO_NO_SUPPORT; |
| 29 + |
| 30 ssl3_DestroyCipherSpec(ss->ssl3.pwSpec, PR_TRUE/*freeSrvName*/); |
| 31 |
| 32 return SECSuccess; |
| 33 Index: net/third_party/nss/ssl/ssl3con.c |
| 34 =================================================================== |
| 35 --- net/third_party/nss/ssl/ssl3con.c (revision 65946) |
| 36 +++ net/third_party/nss/ssl/ssl3con.c (revision 65947) |
| 37 @@ -5023,21 +5023,21 @@ |
| 38 goto alert_loser; |
| 39 } |
| 40 |
| 41 - if (!ss->ssl3.serverHelloPredictionData.data) { |
| 42 - /* If this allocation fails it will only stop the application from |
| 43 - * recording the ServerHello information and performing future Snap |
| 44 - * Starts. */ |
| 45 - if (SECITEM_AllocItem(NULL, &ss->ssl3.serverHelloPredictionData, |
| 46 - length)) |
| 47 - memcpy(ss->ssl3.serverHelloPredictionData.data, b, length); |
| 48 - /* ss->ssl3.serverHelloPredictionDataValid is still false at this |
| 49 - * point. We have to record the contents of the ServerHello here |
| 50 - * because we don't have a pointer to the whole message when handling |
| 51 - * the extensions. However, we wait until the Snap Start extenion |
| 52 - * handler to recognise that the server supports Snap Start and to set |
| 53 - * serverHelloPredictionDataValid. */ |
| 54 - } |
| 55 + if (ss->ssl3.serverHelloPredictionData.data) |
| 56 + SECITEM_FreeItem(&ss->ssl3.serverHelloPredictionData, PR_FALSE); |
| 57 |
| 58 + /* If this allocation fails it will only stop the application from |
| 59 + * recording the ServerHello information and performing future Snap |
| 60 + * Starts. */ |
| 61 + if (SECITEM_AllocItem(NULL, &ss->ssl3.serverHelloPredictionData, length)) |
| 62 + memcpy(ss->ssl3.serverHelloPredictionData.data, b, length); |
| 63 + /* ss->ssl3.serverHelloPredictionDataValid is still false at this |
| 64 + * point. We have to record the contents of the ServerHello here |
| 65 + * because we don't have a pointer to the whole message when handling |
| 66 + * the extensions. However, we wait until the Snap Start extension |
| 67 + * handler to recognise that the server supports Snap Start and to set |
| 68 + * serverHelloPredictionDataValid. */ |
| 69 + |
| 70 temp = ssl3_ConsumeHandshakeNumber(ss, 2, &b, &length); |
| 71 if (temp < 0) { |
| 72 goto loser; /* alert has been sent */ |
| 73 @@ -8366,20 +8366,6 @@ |
| 74 } |
| 75 } |
| 76 |
| 77 - if ((ss->ssl3.hs.snapStartType == snap_start_recovery || |
| 78 - ss->ssl3.hs.snapStartType == snap_start_resume_recovery) && |
| 79 - ss->ssl3.snapStartApplicationData.data) { |
| 80 - /* In the event that the server ignored the application data in our |
| 81 - * snap start extension, we need to retransmit it now. */ |
| 82 - PRInt32 sent = ssl3_SendRecord(ss, content_application_data, |
| 83 - ss->ssl3.snapStartApplicationData.data, |
| 84 - ss->ssl3.snapStartApplicationData.len, |
| 85 - flags); |
| 86 - SECITEM_FreeItem(&ss->ssl3.snapStartApplicationData, PR_FALSE); |
| 87 - if (sent < 0) |
| 88 - return (SECStatus)sent; /* error code set by ssl3_SendRecord */ |
| 89 - } |
| 90 - |
| 91 return SECSuccess; |
| 92 |
| 93 fail: |
OLD | NEW |