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

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

Issue 9764001: Add DTLS support to NSS, contributed by Eric Rescorla. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Made changes based on comments from EKR Created 8 years, 9 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
OLDNEW
1 /* 1 /*
2 * Various SSL functions. 2 * Various SSL functions.
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 /* Reset handshake state */ 239 /* Reset handshake state */
240 ssl_Get1stHandshakeLock(ss); 240 ssl_Get1stHandshakeLock(ss);
241 241
242 ss->firstHsDone = PR_FALSE; 242 ss->firstHsDone = PR_FALSE;
243 if ( asServer ) { 243 if ( asServer ) {
244 ss->handshake = ssl2_BeginServerHandshake; 244 ss->handshake = ssl2_BeginServerHandshake;
245 ss->handshaking = sslHandshakingAsServer; 245 ss->handshaking = sslHandshakingAsServer;
246 } else { 246 } else {
247 ss->handshake = ssl2_BeginClientHandshake; 247 ss->handshake = ssl2_BeginClientHandshake;
248 ss->handshaking = sslHandshakingAsClient; 248 ss->handshaking = sslHandshakingAsClient;
Ryan Sleevi 2012/03/22 22:26:37 Does this not need to be updated for IS_DTLS(ss) ?
wtc 2012/03/23 00:21:18 I don't know. This may be why EKR needs to add th
249 } 249 }
250 ss->nextHandshake = 0; 250 ss->nextHandshake = 0;
251 ss->securityHandshake = 0; 251 ss->securityHandshake = 0;
252 252
253 ssl_GetRecvBufLock(ss); 253 ssl_GetRecvBufLock(ss);
254 status = ssl_InitGather(&ss->gs); 254 status = ssl_InitGather(&ss->gs);
255 ssl_ReleaseRecvBufLock(ss); 255 ssl_ReleaseRecvBufLock(ss);
256 256
257 ssl_GetSSL3HandshakeLock(ss); 257 ssl_GetSSL3HandshakeLock(ss);
258 258
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 SSL_TRC(30, ("%d: SSL[%d]: partial data ready, available=%d", 608 SSL_TRC(30, ("%d: SSL[%d]: partial data ready, available=%d",
609 SSL_GETPID(), ss->fd, available)); 609 SSL_GETPID(), ss->fd, available));
610 } 610 }
611 611
612 /* Dole out clear data to reader */ 612 /* Dole out clear data to reader */
613 amount = PR_MIN(len, available); 613 amount = PR_MIN(len, available);
614 PORT_Memcpy(out, ss->gs.buf.buf + ss->gs.readOffset, amount); 614 PORT_Memcpy(out, ss->gs.buf.buf + ss->gs.readOffset, amount);
615 if (!(flags & PR_MSG_PEEK)) { 615 if (!(flags & PR_MSG_PEEK)) {
616 ss->gs.readOffset += amount; 616 ss->gs.readOffset += amount;
617 } 617 }
618 PORT_Assert(ss->gs.readOffset <= ss->gs.writeOffset);
618 rv = amount; 619 rv = amount;
619 620
620 SSL_TRC(30, ("%d: SSL[%d]: amount=%d available=%d", 621 SSL_TRC(30, ("%d: SSL[%d]: amount=%d available=%d",
621 SSL_GETPID(), ss->fd, amount, available)); 622 SSL_GETPID(), ss->fd, amount, available));
622 PRINT_BUF(4, (ss, "DoRecv receiving plaintext:", out, amount)); 623 PRINT_BUF(4, (ss, "DoRecv receiving plaintext:", out, amount));
623 624
624 done: 625 done:
625 ssl_ReleaseRecvBufLock(ss); 626 ssl_ReleaseRecvBufLock(ss);
626 return rv; 627 return rv;
627 } 628 }
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 if (!ss) { 1586 if (!ss) {
1586 SSL_DBG(("%d: SSL[%d]: bad socket in SNISocketConfigHook", 1587 SSL_DBG(("%d: SSL[%d]: bad socket in SNISocketConfigHook",
1587 SSL_GETPID(), fd)); 1588 SSL_GETPID(), fd));
1588 return SECFailure; 1589 return SECFailure;
1589 } 1590 }
1590 1591
1591 ss->sniSocketConfig = func; 1592 ss->sniSocketConfig = func;
1592 ss->sniSocketConfigArg = arg; 1593 ss->sniSocketConfigArg = arg;
1593 return SECSuccess; 1594 return SECSuccess;
1594 } 1595 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698