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

Side by Side Diff: extensions/common/cast/cast_cert_validator_openssl.cc

Issue 1223983002: Move WriteInto to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « crypto/symmetric_key_openssl.cc ('k') | media/audio/win/audio_manager_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/common/cast/cast_cert_validator.h" 5 #include "extensions/common/cast/cast_cert_validator.h"
6 6
7 #include <openssl/digest.h> 7 #include <openssl/digest.h>
8 #include <openssl/evp.h> 8 #include <openssl/evp.h>
9 #include <openssl/rsa.h> 9 #include <openssl/rsa.h>
10 #include <openssl/x509.h> 10 #include <openssl/x509.h>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 std::string GetCommonName() const override { 66 std::string GetCommonName() const override {
67 int common_name_length = X509_NAME_get_text_by_NID( 67 int common_name_length = X509_NAME_get_text_by_NID(
68 x509_->cert_info->subject, NID_commonName, NULL, 0); 68 x509_->cert_info->subject, NID_commonName, NULL, 0);
69 if (common_name_length < 0) 69 if (common_name_length < 0)
70 return std::string(); 70 return std::string();
71 std::string common_name; 71 std::string common_name;
72 common_name_length = X509_NAME_get_text_by_NID( 72 common_name_length = X509_NAME_get_text_by_NID(
73 x509_->cert_info->subject, NID_commonName, 73 x509_->cert_info->subject, NID_commonName,
74 WriteInto(&common_name, static_cast<size_t>(common_name_length) + 1), 74 base::WriteInto(&common_name,
75 static_cast<size_t>(common_name_length) + 1),
75 common_name_length + 1); 76 common_name_length + 1);
76 if (common_name_length < 0) 77 if (common_name_length < 0)
77 return std::string(); 78 return std::string();
78 return common_name; 79 return common_name;
79 } 80 }
80 81
81 private: 82 private:
82 net::ScopedX509 x509_; 83 net::ScopedX509 x509_;
83 }; 84 };
84 85
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 return VerificationResult(); 149 return VerificationResult();
149 } 150 }
150 151
151 std::string VerificationResult::GetLogString() const { 152 std::string VerificationResult::GetLogString() const {
152 return error_message; 153 return error_message;
153 } 154 }
154 155
155 } // namespace cast_crypto 156 } // namespace cast_crypto
156 } // namespace core_api 157 } // namespace core_api
157 } // namespace extensions 158 } // namespace extensions
OLDNEW
« no previous file with comments | « crypto/symmetric_key_openssl.cc ('k') | media/audio/win/audio_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698