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

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

Issue 10542176: SSL_GetChannelInfo and SSL_GetNegotiatedHostInfo should use (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* ***** BEGIN LICENSE BLOCK ***** 1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 * 3 *
4 * The contents of this file are subject to the Mozilla Public License Version 4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with 5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at 6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/ 7 * http://www.mozilla.org/MPL/
8 * 8 *
9 * Software distributed under the License is distributed on an "AS IS" basis, 9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 inf.protocolVersion = ss->version; 90 inf.protocolVersion = ss->version;
91 inf.authKeyBits = ss->sec.authKeyBits; 91 inf.authKeyBits = ss->sec.authKeyBits;
92 inf.keaKeyBits = ss->sec.keaKeyBits; 92 inf.keaKeyBits = ss->sec.keaKeyBits;
93 if (ss->version < SSL_LIBRARY_VERSION_3_0) { /* SSL2 */ 93 if (ss->version < SSL_LIBRARY_VERSION_3_0) { /* SSL2 */
94 inf.cipherSuite = ss->sec.cipherType | 0xff00; 94 inf.cipherSuite = ss->sec.cipherType | 0xff00;
95 inf.compressionMethod = ssl_compression_null; 95 inf.compressionMethod = ssl_compression_null;
96 inf.compressionMethodName = "N/A"; 96 inf.compressionMethodName = "N/A";
97 } else if (ss->ssl3.initialized) { /* SSL3 and TLS */ 97 } else if (ss->ssl3.initialized) { /* SSL3 and TLS */
98 ssl_GetSpecReadLock(ss); 98 ssl_GetSpecReadLock(ss);
99 /* XXX The cipher suite should be in the specs and this 99 /* XXX The cipher suite should be in the specs and this
100 » * function should get it from crSpec rather than from the "hs". 100 » * function should get it from cwSpec rather than from the "hs".
101 * See bug 275744 comment 69. 101 * See bug 275744 comment 69.
102 */ 102 */
103 inf.cipherSuite = ss->ssl3.hs.cipher_suite; 103 inf.cipherSuite = ss->ssl3.hs.cipher_suite;
104 » inf.compressionMethod = ss->ssl3.crSpec->compression_method; 104 » inf.compressionMethod = ss->ssl3.cwSpec->compression_method;
105 ssl_ReleaseSpecReadLock(ss); 105 ssl_ReleaseSpecReadLock(ss);
106 inf.compressionMethodName = 106 inf.compressionMethodName =
107 ssl_GetCompressionMethodName(inf.compressionMethod); 107 ssl_GetCompressionMethodName(inf.compressionMethod);
108 } 108 }
109 if (sid) { 109 if (sid) {
110 inf.creationTime = sid->creationTime; 110 inf.creationTime = sid->creationTime;
111 inf.lastAccessTime = sid->lastAccessTime; 111 inf.lastAccessTime = sid->lastAccessTime;
112 inf.expirationTime = sid->expirationTime; 112 inf.expirationTime = sid->expirationTime;
113 if (ss->version < SSL_LIBRARY_VERSION_3_0) { /* SSL2 */ 113 if (ss->version < SSL_LIBRARY_VERSION_3_0) { /* SSL2 */
114 inf.sessionIDLength = SSL2_SESSIONID_BYTES; 114 inf.sessionIDLength = SSL2_SESSIONID_BYTES;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 SSL_DBG(("%d: SSL[%d]: bad socket in SSL_GetNegotiatedHostInfo", 329 SSL_DBG(("%d: SSL[%d]: bad socket in SSL_GetNegotiatedHostInfo",
330 SSL_GETPID(), fd)); 330 SSL_GETPID(), fd));
331 return NULL; 331 return NULL;
332 } 332 }
333 333
334 if (ss->sec.isServer) { 334 if (ss->sec.isServer) {
335 if (ss->version > SSL_LIBRARY_VERSION_3_0 && 335 if (ss->version > SSL_LIBRARY_VERSION_3_0 &&
336 ss->ssl3.initialized) { /* TLS */ 336 ss->ssl3.initialized) { /* TLS */
337 SECItem *crsName; 337 SECItem *crsName;
338 ssl_GetSpecReadLock(ss); /*********************************/ 338 ssl_GetSpecReadLock(ss); /*********************************/
339 crsName = &ss->ssl3.crSpec->srvVirtName; 339 crsName = &ss->ssl3.cwSpec->srvVirtName;
340 if (crsName->data) { 340 if (crsName->data) {
341 sniName = SECITEM_DupItem(crsName); 341 sniName = SECITEM_DupItem(crsName);
342 } 342 }
343 ssl_ReleaseSpecReadLock(ss); /*----------------------------*/ 343 ssl_ReleaseSpecReadLock(ss); /*----------------------------*/
344 } 344 }
345 return sniName; 345 return sniName;
346 } 346 }
347 name = SSL_RevealURL(fd); 347 name = SSL_RevealURL(fd);
348 if (name) { 348 if (name) {
349 sniName = PORT_ZNew(SECItem); 349 sniName = PORT_ZNew(SECItem);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 val[i++] = contextLen; 409 val[i++] = contextLen;
410 PORT_Memcpy(val + i, context, contextLen); 410 PORT_Memcpy(val + i, context, contextLen);
411 i += contextLen; 411 i += contextLen;
412 } 412 }
413 PORT_Assert(i == valLen); 413 PORT_Assert(i == valLen);
414 414
415 /* Allow TLS keying material to be exported sooner, when the master 415 /* Allow TLS keying material to be exported sooner, when the master
416 * secret is available and we have sent ChangeCipherSpec. 416 * secret is available and we have sent ChangeCipherSpec.
417 */ 417 */
418 ssl_GetSpecReadLock(ss); 418 ssl_GetSpecReadLock(ss);
419 if (!ss->ssl3.cwSpec->master_secret && !ss->ssl3.cwSpec->msItem.len) { 419 if (!ss->ssl3.cwSpec->master_secret && !ss->ssl3.cwSpec->msItem.len) {
wtc 2012/06/15 06:03:30 SSL_ExportKeyingMaterial is using cwSpec for the s
420 PORT_SetError(SSL_ERROR_HANDSHAKE_NOT_COMPLETED); 420 PORT_SetError(SSL_ERROR_HANDSHAKE_NOT_COMPLETED);
421 rv = SECFailure; 421 rv = SECFailure;
422 } else { 422 } else {
423 rv = ssl3_TLSPRFWithMasterSecret(ss->ssl3.cwSpec, label, labelLen, val, 423 rv = ssl3_TLSPRFWithMasterSecret(ss->ssl3.cwSpec, label, labelLen, val,
424 valLen, out, outLen); 424 valLen, out, outLen);
425 } 425 }
426 ssl_ReleaseSpecReadLock(ss); 426 ssl_ReleaseSpecReadLock(ss);
427 ssl_ReleaseSSL3HandshakeLock(ss); 427 ssl_ReleaseSSL3HandshakeLock(ss);
428 ssl_ReleaseRecvBufLock(ss); 428 ssl_ReleaseRecvBufLock(ss);
429 429
430 PORT_ZFree(val, valLen); 430 PORT_ZFree(val, valLen);
431 return rv; 431 return rv;
432 } 432 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698