| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Gather (Read) entire SSL2 records from socket into buffer. | 2 * Gather (Read) entire SSL2 records from socket into buffer. |
| 3 * | 3 * |
| 4 * ***** BEGIN LICENSE BLOCK ***** | 4 * ***** BEGIN LICENSE BLOCK ***** |
| 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 6 * | 6 * |
| 7 * The contents of this file are subject to the Mozilla Public License Version | 7 * The contents of this file are subject to the Mozilla Public License Version |
| 8 * 1.1 (the "License"); you may not use this file except in compliance with | 8 * 1.1 (the "License"); you may not use this file except in compliance with |
| 9 * the License. You may obtain a copy of the License at | 9 * the License. You may obtain a copy of the License at |
| 10 * http://www.mozilla.org/MPL/ | 10 * http://www.mozilla.org/MPL/ |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 427 |
| 428 /* Caller should hold RecvBufLock. */ | 428 /* Caller should hold RecvBufLock. */ |
| 429 SECStatus | 429 SECStatus |
| 430 ssl_InitGather(sslGather *gs) | 430 ssl_InitGather(sslGather *gs) |
| 431 { | 431 { |
| 432 SECStatus status; | 432 SECStatus status; |
| 433 | 433 |
| 434 gs->state = GS_INIT; | 434 gs->state = GS_INIT; |
| 435 gs->writeOffset = 0; | 435 gs->writeOffset = 0; |
| 436 gs->readOffset = 0; | 436 gs->readOffset = 0; |
| 437 gs->dtlsPacketOffset = 0; |
| 438 gs->dtlsPacket.len = 0; |
| 437 status = sslBuffer_Grow(&gs->buf, 4096); | 439 status = sslBuffer_Grow(&gs->buf, 4096); |
| 438 return status; | 440 return status; |
| 439 } | 441 } |
| 440 | 442 |
| 441 /* Caller must hold RecvBufLock. */ | 443 /* Caller must hold RecvBufLock. */ |
| 442 void | 444 void |
| 443 ssl_DestroyGather(sslGather *gs) | 445 ssl_DestroyGather(sslGather *gs) |
| 444 { | 446 { |
| 445 if (gs) { /* the PORT_*Free functions check for NULL pointers. */ | 447 if (gs) { /* the PORT_*Free functions check for NULL pointers. */ |
| 446 PORT_ZFree(gs->buf.buf, gs->buf.space); | 448 PORT_ZFree(gs->buf.buf, gs->buf.space); |
| 447 PORT_Free(gs->inbuf.buf); | 449 PORT_Free(gs->inbuf.buf); |
| 450 PORT_Free(gs->dtlsPacket.buf); |
| 448 } | 451 } |
| 449 } | 452 } |
| 450 | 453 |
| 451 /* Caller must hold RecvBufLock. */ | 454 /* Caller must hold RecvBufLock. */ |
| 452 static SECStatus | 455 static SECStatus |
| 453 ssl2_HandleV3HandshakeRecord(sslSocket *ss) | 456 ssl2_HandleV3HandshakeRecord(sslSocket *ss) |
| 454 { | 457 { |
| 455 SECStatus rv; | 458 SECStatus rv; |
| 456 | 459 |
| 457 PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) ); | 460 PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) ); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 474 rv = ssl3_NegotiateVersion(ss, SSL_LIBRARY_VERSION_MAX_SUPPORTED, | 477 rv = ssl3_NegotiateVersion(ss, SSL_LIBRARY_VERSION_MAX_SUPPORTED, |
| 475 PR_TRUE); | 478 PR_TRUE); |
| 476 if (rv != SECSuccess) { | 479 if (rv != SECSuccess) { |
| 477 return rv; | 480 return rv; |
| 478 } | 481 } |
| 479 | 482 |
| 480 ss->sec.send = ssl3_SendApplicationData; | 483 ss->sec.send = ssl3_SendApplicationData; |
| 481 | 484 |
| 482 return SECSuccess; | 485 return SECSuccess; |
| 483 } | 486 } |
| OLD | NEW |