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

Side by Side Diff: webrtc/base/opensslstreamadapter.cc

Issue 2742893002: Return correct type from OpenSSLStreamAdapter::VerifyPeerCertificate. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 if (!OpenSSLCertificate::ComputeDigest( 1083 if (!OpenSSLCertificate::ComputeDigest(
1084 peer_certificate_->x509(), peer_certificate_digest_algorithm_, digest, 1084 peer_certificate_->x509(), peer_certificate_digest_algorithm_, digest,
1085 sizeof(digest), &digest_length)) { 1085 sizeof(digest), &digest_length)) {
1086 LOG(LS_WARNING) << "Failed to compute peer cert digest."; 1086 LOG(LS_WARNING) << "Failed to compute peer cert digest.";
1087 return false; 1087 return false;
1088 } 1088 }
1089 1089
1090 Buffer computed_digest(digest, digest_length); 1090 Buffer computed_digest(digest, digest_length);
1091 if (computed_digest != peer_certificate_digest_value_) { 1091 if (computed_digest != peer_certificate_digest_value_) {
1092 LOG(LS_WARNING) << "Rejected peer certificate due to mismatched digest."; 1092 LOG(LS_WARNING) << "Rejected peer certificate due to mismatched digest.";
1093 return 0; 1093 return false;
1094 } 1094 }
1095 // Ignore any verification error if the digest matches, since there is no 1095 // Ignore any verification error if the digest matches, since there is no
1096 // value in checking the validity of a self-signed cert issued by untrusted 1096 // value in checking the validity of a self-signed cert issued by untrusted
1097 // sources. 1097 // sources.
1098 LOG(LS_INFO) << "Accepted peer certificate."; 1098 LOG(LS_INFO) << "Accepted peer certificate.";
1099 peer_certificate_verified_ = true; 1099 peer_certificate_verified_ = true;
1100 return true; 1100 return true;
1101 } 1101 }
1102 1102
1103 int OpenSSLStreamAdapter::SSLVerifyCallback(int ok, X509_STORE_CTX* store) { 1103 int OpenSSLStreamAdapter::SSLVerifyCallback(int ok, X509_STORE_CTX* store) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 } 1210 }
1211 1211
1212 return false; 1212 return false;
1213 } 1213 }
1214 1214
1215 void OpenSSLStreamAdapter::enable_time_callback_for_testing() { 1215 void OpenSSLStreamAdapter::enable_time_callback_for_testing() {
1216 g_use_time_callback_for_testing = true; 1216 g_use_time_callback_for_testing = true;
1217 } 1217 }
1218 1218
1219 } // namespace rtc 1219 } // namespace rtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698