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

Side by Side Diff: chrome/common/net/x509_certificate_model.cc

Issue 376753002: Fix webui cert viewer showing wrong cert chain on NSS and no chain on OpenSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/common/net/x509_certificate_model.h" 5 #include "chrome/common/net/x509_certificate_model.h"
6 6
7 #include <unicode/uidna.h> 7 #include <unicode/uidna.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 13 matching lines...) Expand all
24 base::string16 output16 = net::IDNToUnicode(input, std::string()); 24 base::string16 output16 = net::IDNToUnicode(input, std::string());
25 if (input16 == output16) 25 if (input16 == output16)
26 return input; // Input did not contain any encoded data. 26 return input; // Input did not contain any encoded data.
27 27
28 // Input contained encoded data, return formatted string showing original and 28 // Input contained encoded data, return formatted string showing original and
29 // decoded forms. 29 // decoded forms.
30 return l10n_util::GetStringFUTF8(IDS_CERT_INFO_IDN_VALUE_FORMAT, 30 return l10n_util::GetStringFUTF8(IDS_CERT_INFO_IDN_VALUE_FORMAT,
31 input16, output16); 31 input16, output16);
32 } 32 }
33 33
34 void GetCertChainFromCert(net::X509Certificate* cert,
35 net::X509Certificate::OSCertHandles* cert_handles) {
36 cert_handles->clear();
37 cert_handles->insert(cert_handles->begin(), cert->os_cert_handle());
38 const net::X509Certificate::OSCertHandles& certs =
39 cert->GetIntermediateCertificates();
40 cert_handles->insert(cert_handles->end(), certs.begin(), certs.end());
41 }
42
34 std::string ProcessRawBytesWithSeparators(const unsigned char* data, 43 std::string ProcessRawBytesWithSeparators(const unsigned char* data,
35 size_t data_length, 44 size_t data_length,
36 char hex_separator, 45 char hex_separator,
37 char line_separator) { 46 char line_separator) {
38 static const char kHexChars[] = "0123456789ABCDEF"; 47 static const char kHexChars[] = "0123456789ABCDEF";
39 48
40 // Each input byte creates two output hex characters + a space or newline, 49 // Each input byte creates two output hex characters + a space or newline,
41 // except for the last byte. 50 // except for the last byte.
42 std::string ret; 51 std::string ret;
43 size_t kMin = 0U; 52 size_t kMin = 0U;
(...skipping 22 matching lines...) Expand all
66 } 75 }
67 76
68 #if defined(USE_NSS) 77 #if defined(USE_NSS)
69 std::string ProcessRawBits(const unsigned char* data, size_t data_length) { 78 std::string ProcessRawBits(const unsigned char* data, size_t data_length) {
70 return ProcessRawBytes(data, (data_length + 7) / 8); 79 return ProcessRawBytes(data, (data_length + 7) / 8);
71 } 80 }
72 #endif // USE_NSS 81 #endif // USE_NSS
73 82
74 } // namespace x509_certificate_model 83 } // namespace x509_certificate_model
75 84
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698