| OLD | NEW |
| 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 if (stream->peer_certificate_digest_algorithm_.empty()) { | 1034 if (stream->peer_certificate_digest_algorithm_.empty()) { |
| 1035 return 0; | 1035 return 0; |
| 1036 } | 1036 } |
| 1037 X509* cert = X509_STORE_CTX_get_current_cert(store); | 1037 X509* cert = X509_STORE_CTX_get_current_cert(store); |
| 1038 int depth = X509_STORE_CTX_get_error_depth(store); | 1038 int depth = X509_STORE_CTX_get_error_depth(store); |
| 1039 | 1039 |
| 1040 // For now We ignore the parent certificates and verify the leaf against | 1040 // For now We ignore the parent certificates and verify the leaf against |
| 1041 // the digest. | 1041 // the digest. |
| 1042 // | 1042 // |
| 1043 // TODO(jiayl): Verify the chain is a proper chain and report the chain to | 1043 // TODO(jiayl): Verify the chain is a proper chain and report the chain to |
| 1044 // |stream->peer_certificate_|. | 1044 // |stream->peer_certificate_|, like what NSS does. |
| 1045 if (depth > 0) { | 1045 if (depth > 0) { |
| 1046 LOG(LS_INFO) << "Ignored chained certificate at depth " << depth; | 1046 LOG(LS_INFO) << "Ignored chained certificate at depth " << depth; |
| 1047 return 1; | 1047 return 1; |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 unsigned char digest[EVP_MAX_MD_SIZE]; | 1050 unsigned char digest[EVP_MAX_MD_SIZE]; |
| 1051 size_t digest_length; | 1051 size_t digest_length; |
| 1052 if (!OpenSSLCertificate::ComputeDigest( | 1052 if (!OpenSSLCertificate::ComputeDigest( |
| 1053 cert, | 1053 cert, |
| 1054 stream->peer_certificate_digest_algorithm_, | 1054 stream->peer_certificate_digest_algorithm_, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 #endif | 1163 #endif |
| 1164 } | 1164 } |
| 1165 } else { | 1165 } else { |
| 1166 return std::string(); | 1166 return std::string(); |
| 1167 } | 1167 } |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 } // namespace rtc | 1170 } // namespace rtc |
| 1171 | 1171 |
| 1172 #endif // HAVE_OPENSSL_SSL_H | 1172 #endif // HAVE_OPENSSL_SSL_H |
| OLD | NEW |