Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: net/third_party/nss/ssl/sslgathr.c

Issue 9764001: Add DTLS support to NSS, contributed by Eric Rescorla. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update AUTHORS Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/third_party/nss/ssl/sslerr.h ('k') | net/third_party/nss/ssl/sslimpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « net/third_party/nss/ssl/sslerr.h ('k') | net/third_party/nss/ssl/sslimpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698