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

Side by Side Diff: net/base/x509_certificate_nss.cc

Issue 10160007: Parse an application/x-x509-user-cert response with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add back a blank line deleted by accident 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
« net/base/cert_database_nss.cc ('K') | « net/base/cert_database_nss.cc ('k') | 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/x509_certificate.h" 5 #include "net/base/x509_certificate.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <cryptohi.h> 8 #include <cryptohi.h>
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <nss.h> 10 #include <nss.h>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // TODO(gspencer): internationalize this: it's wrong to 184 // TODO(gspencer): internationalize this: it's wrong to
185 // hard code English. 185 // hard code English.
186 186
187 std::string username, ca_name; 187 std::string username, ca_name;
188 char* temp_username = CERT_GetCommonName( 188 char* temp_username = CERT_GetCommonName(
189 &cert_handle_->subject); 189 &cert_handle_->subject);
190 char* temp_ca_name = CERT_GetCommonName(&cert_handle_->issuer); 190 char* temp_ca_name = CERT_GetCommonName(&cert_handle_->issuer);
191 if (temp_username) { 191 if (temp_username) {
192 username = temp_username; 192 username = temp_username;
193 PORT_Free(temp_username); 193 PORT_Free(temp_username);
194 } else {
195 username = CERT_GetFirstEmailAddress(cert_handle_);
194 } 196 }
195 if (temp_ca_name) { 197 if (temp_ca_name) {
196 ca_name = temp_ca_name; 198 ca_name = temp_ca_name;
197 PORT_Free(temp_ca_name); 199 PORT_Free(temp_ca_name);
198 } 200 }
199 result = username + "'s " + ca_name + " ID"; 201 result = username + "'s " + ca_name + " ID";
200 break; 202 break;
201 } 203 }
202 case SERVER_CERT: 204 case SERVER_CERT:
203 result = subject_.GetDisplayName(); 205 result = subject_.GetDisplayName();
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 *type = kPublicKeyTypeECDSA; 469 *type = kPublicKeyTypeECDSA;
468 break; 470 break;
469 default: 471 default:
470 *type = kPublicKeyTypeUnknown; 472 *type = kPublicKeyTypeUnknown;
471 *size_bits = 0; 473 *size_bits = 0;
472 break; 474 break;
473 } 475 }
474 } 476 }
475 477
476 } // namespace net 478 } // namespace net
OLDNEW
« net/base/cert_database_nss.cc ('K') | « net/base/cert_database_nss.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698