OLD | NEW |
---|---|
1 /* | 1 /* |
2 * vtables (and methods that call through them) for the 4 types of | 2 * vtables (and methods that call through them) for the 4 types of |
3 * SSLSockets supported. Only one type is still supported. | 3 * SSLSockets supported. Only one type is still supported. |
4 * Various other functions. | 4 * Various other functions. |
5 * | 5 * |
6 * This Source Code Form is subject to the terms of the Mozilla Public | 6 * This Source Code Form is subject to the terms of the Mozilla Public |
7 * License, v. 2.0. If a copy of the MPL was not distributed with this | 7 * License, v. 2.0. If a copy of the MPL was not distributed with this |
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
9 #include "seccomon.h" | 9 #include "seccomon.h" |
10 #include "cert.h" | 10 #include "cert.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 #ifdef NSS_PLATFORM_CLIENT_AUTH | 359 #ifdef NSS_PLATFORM_CLIENT_AUTH |
360 ss->getPlatformClientAuthData = os->getPlatformClientAuthData; | 360 ss->getPlatformClientAuthData = os->getPlatformClientAuthData; |
361 ss->getPlatformClientAuthDataArg = os->getPlatformClientAuthDataArg; | 361 ss->getPlatformClientAuthDataArg = os->getPlatformClientAuthDataArg; |
362 #endif | 362 #endif |
363 ss->sniSocketConfig = os->sniSocketConfig; | 363 ss->sniSocketConfig = os->sniSocketConfig; |
364 ss->sniSocketConfigArg = os->sniSocketConfigArg; | 364 ss->sniSocketConfigArg = os->sniSocketConfigArg; |
365 ss->handleBadCert = os->handleBadCert; | 365 ss->handleBadCert = os->handleBadCert; |
366 ss->badCertArg = os->badCertArg; | 366 ss->badCertArg = os->badCertArg; |
367 ss->handshakeCallback = os->handshakeCallback; | 367 ss->handshakeCallback = os->handshakeCallback; |
368 ss->handshakeCallbackData = os->handshakeCallbackData; | 368 ss->handshakeCallbackData = os->handshakeCallbackData; |
369 ss->canFalseStartCallback = os->canFalseStartCallback; | |
370 ss->canFalseStartCallbackData = os->canFalseStartCallbackData; | |
369 ss->pkcs11PinArg = os->pkcs11PinArg; | 371 ss->pkcs11PinArg = os->pkcs11PinArg; |
370 ss->getChannelID = os->getChannelID; | 372 ss->getChannelID = os->getChannelID; |
371 ss->getChannelIDArg = os->getChannelIDArg; | 373 ss->getChannelIDArg = os->getChannelIDArg; |
372 | 374 |
373 /* Create security data */ | 375 /* Create security data */ |
374 rv = ssl_CopySecurityInfo(ss, os); | 376 rv = ssl_CopySecurityInfo(ss, os); |
375 if (rv != SECSuccess) { | 377 if (rv != SECSuccess) { |
376 goto loser; | 378 goto loser; |
377 } | 379 } |
378 } | 380 } |
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2450 ** but the initial handshake is blocked on write, or the | 2452 ** but the initial handshake is blocked on write, or the |
2451 ** client's first handshake record has not been written. | 2453 ** client's first handshake record has not been written. |
2452 ** The code should select on write, not read. | 2454 ** The code should select on write, not read. |
2453 */ | 2455 */ |
2454 new_flags ^= PR_POLL_READ; /* don't select on read. */ | 2456 new_flags ^= PR_POLL_READ; /* don't select on read. */ |
2455 new_flags |= PR_POLL_WRITE; /* do select on write. */ | 2457 new_flags |= PR_POLL_WRITE; /* do select on write. */ |
2456 } | 2458 } |
2457 } else if (new_flags & PR_POLL_WRITE) { | 2459 } else if (new_flags & PR_POLL_WRITE) { |
2458 /* The caller is trying to write, but the handshake is | 2460 /* The caller is trying to write, but the handshake is |
2459 ** blocked waiting for data to read, and the first | 2461 ** blocked waiting for data to read, and the first |
2460 » » ** handshake has been sent. so do NOT to poll on write. | 2462 » » ** handshake has been sent. So do NOT to poll on write |
2463 » » ** unless we did false start. | |
2461 */ | 2464 */ |
2462 » » new_flags ^= PR_POLL_WRITE; /* don't select on write. */ | 2465 » » if (!(ss->version >= SSL_LIBRARY_VERSION_3_0 && |
2463 » » new_flags |= PR_POLL_READ;» /* do select on read. */ | 2466 » » » ss->ssl3.hs.canFalseStart)) { |
wtc
2013/10/17 00:10:53
I think we can remove the ss->version >= SSL_LIBRA
briansmith
2013/10/17 01:42:40
I don't know if we can rely on ss->ssl3.hs being i
wtc
2013/10/17 15:28:14
I see. I missed that.
| |
2467 » » » new_flags ^= PR_POLL_WRITE; /* don't select on write. */ | |
2468 » » } | |
2469 » » new_flags |= PR_POLL_READ; /* do select on read. */ | |
2464 } | 2470 } |
2465 } | 2471 } |
2466 } else if ((new_flags & PR_POLL_READ) && (SSL_DataPending(fd) > 0)) { | 2472 } else if ((new_flags & PR_POLL_READ) && (SSL_DataPending(fd) > 0)) { |
2467 *p_out_flags = PR_POLL_READ; /* it's ready already. */ | 2473 *p_out_flags = PR_POLL_READ; /* it's ready already. */ |
2468 return new_flags; | 2474 return new_flags; |
2469 } else if ((ss->lastWriteBlocked) && (how_flags & PR_POLL_READ) && | 2475 } else if ((ss->lastWriteBlocked) && (how_flags & PR_POLL_READ) && |
2470 (ss->pendingBuf.len != 0)) { /* write data waiting to be sent */ | 2476 (ss->pendingBuf.len != 0)) { /* write data waiting to be sent */ |
2471 new_flags |= PR_POLL_WRITE; /* also select on write. */ | 2477 new_flags |= PR_POLL_WRITE; /* also select on write. */ |
2472 } | 2478 } |
2473 | 2479 |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3121 loser: | 3127 loser: |
3122 ssl_DestroySocketContents(ss); | 3128 ssl_DestroySocketContents(ss); |
3123 ssl_DestroyLocks(ss); | 3129 ssl_DestroyLocks(ss); |
3124 PORT_Free(ss); | 3130 PORT_Free(ss); |
3125 ss = NULL; | 3131 ss = NULL; |
3126 } | 3132 } |
3127 } | 3133 } |
3128 return ss; | 3134 return ss; |
3129 } | 3135 } |
3130 | 3136 |
OLD | NEW |