| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |