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

Unified Diff: net/socket/ssl_client_socket_nss.cc

Issue 25107004: Change SSL_PeerCertificateChain to return a CERTCertList. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/third_party/nss/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_nss.cc
===================================================================
--- net/socket/ssl_client_socket_nss.cc (revision 225295)
+++ net/socket/ssl_client_socket_nss.cc (working copy)
@@ -380,20 +380,16 @@
if (nss_fd == NULL)
return;
- unsigned int num_certs = 0;
- SECStatus rv = SSL_PeerCertificateChain(nss_fd, NULL, &num_certs, 0);
- DCHECK_EQ(SECSuccess, rv);
-
+ CERTCertList* list = SSL_PeerCertificateChain(nss_fd);
// The handshake on |nss_fd| may not have completed.
- if (num_certs == 0)
+ if (list == NULL)
return;
- certs_.resize(num_certs);
- const unsigned int expected_num_certs = num_certs;
- rv = SSL_PeerCertificateChain(nss_fd, vector_as_array(&certs_),
- &num_certs, expected_num_certs);
- DCHECK_EQ(SECSuccess, rv);
- DCHECK_EQ(expected_num_certs, num_certs);
+ for (CERTCertListNode* node = CERT_LIST_HEAD(list);
+ !CERT_LIST_END(node, list); node = CERT_LIST_NEXT(node)) {
+ certs_.push_back(CERT_DupCertificate(node->cert));
+ }
+ CERT_DestroyCertList(list);
}
std::vector<base::StringPiece>
« no previous file with comments | « no previous file | net/third_party/nss/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698