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

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

Issue 1053903002: Update libssl to NSS 3.18 RTM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 5 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
« 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 * This Source Code Form is subject to the terms of the Mozilla Public 4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "cert.h" 7 #include "cert.h"
8 #include "ssl.h" 8 #include "ssl.h"
9 #include "sslimpl.h" 9 #include "sslimpl.h"
10 #include "sslproto.h" 10 #include "sslproto.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 * Called by ssl_GatherRecord1stHandshake in sslcon.c, 357 * Called by ssl_GatherRecord1stHandshake in sslcon.c,
358 * and by DoRecv in sslsecur.c 358 * and by DoRecv in sslsecur.c
359 * Caller must hold RecvBufLock. 359 * Caller must hold RecvBufLock.
360 */ 360 */
361 int 361 int
362 ssl2_GatherRecord(sslSocket *ss, int flags) 362 ssl2_GatherRecord(sslSocket *ss, int flags)
363 { 363 {
364 return ssl2_GatherData(ss, &ss->gs, flags); 364 return ssl2_GatherData(ss, &ss->gs, flags);
365 } 365 }
366 366
367 /*
368 * Returns +1 when it has gathered a complete SSLV2 record.
369 * Returns 0 if it hits EOF.
370 * Returns -1 (SECFailure) on any error
371 * Returns -2 (SECWouldBlock)
372 *
373 * Called from SocksStartGather in sslsocks.c
374 * Caller must hold RecvBufLock.
375 */
376 int
377 ssl2_StartGatherBytes(sslSocket *ss, sslGather *gs, unsigned int count)
378 {
379 int rv;
380
381 PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) );
382 gs->state = GS_DATA;
383 gs->remainder = count;
384 gs->count = count;
385 gs->offset = 0;
386 if (count > gs->buf.space) {
387 rv = sslBuffer_Grow(&gs->buf, count);
388 if (rv) {
389 return rv;
390 }
391 }
392 return ssl2_GatherData(ss, gs, 0);
393 }
394
395 /* Caller should hold RecvBufLock. */ 367 /* Caller should hold RecvBufLock. */
396 SECStatus 368 SECStatus
397 ssl_InitGather(sslGather *gs) 369 ssl_InitGather(sslGather *gs)
398 { 370 {
399 SECStatus status; 371 SECStatus status;
400 372
401 gs->state = GS_INIT; 373 gs->state = GS_INIT;
402 gs->writeOffset = 0; 374 gs->writeOffset = 0;
403 gs->readOffset = 0; 375 gs->readOffset = 0;
404 gs->dtlsPacketOffset = 0; 376 gs->dtlsPacketOffset = 0;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 rv = ssl3_NegotiateVersion(ss, SSL_LIBRARY_VERSION_MAX_SUPPORTED, 416 rv = ssl3_NegotiateVersion(ss, SSL_LIBRARY_VERSION_MAX_SUPPORTED,
445 PR_TRUE); 417 PR_TRUE);
446 if (rv != SECSuccess) { 418 if (rv != SECSuccess) {
447 return rv; 419 return rv;
448 } 420 }
449 421
450 ss->sec.send = ssl3_SendApplicationData; 422 ss->sec.send = ssl3_SendApplicationData;
451 423
452 return SECSuccess; 424 return SECSuccess;
453 } 425 }
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