| OLD | NEW |
| 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/browser/api/cast_channel/logger.h" | 5 #include "extensions/browser/api/cast_channel/logger.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 case AuthResult::ERROR_FINGERPRINT_NOT_FOUND: | 51 case AuthResult::ERROR_FINGERPRINT_NOT_FOUND: |
| 52 return proto::CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND; | 52 return proto::CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND; |
| 53 case AuthResult::ERROR_CERT_PARSING_FAILED: | 53 case AuthResult::ERROR_CERT_PARSING_FAILED: |
| 54 return proto::CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED; | 54 return proto::CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED; |
| 55 case AuthResult::ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA: | 55 case AuthResult::ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA: |
| 56 return proto::CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA; | 56 return proto::CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA; |
| 57 case AuthResult::ERROR_CANNOT_EXTRACT_PUBLIC_KEY: | 57 case AuthResult::ERROR_CANNOT_EXTRACT_PUBLIC_KEY: |
| 58 return proto::CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY; | 58 return proto::CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY; |
| 59 case AuthResult::ERROR_SIGNED_BLOBS_MISMATCH: | 59 case AuthResult::ERROR_SIGNED_BLOBS_MISMATCH: |
| 60 return proto::CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH; | 60 return proto::CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH; |
| 61 case AuthResult::ERROR_TLS_CERT_VALIDITY_PERIOD_TOO_LONG: |
| 62 return proto::CHALLENGE_REPLY_ERROR_TLS_CERT_VALIDITY_PERIOD_TOO_LONG; |
| 63 case AuthResult::ERROR_TLS_CERT_VALID_START_DATE_IN_FUTURE: |
| 64 return proto::CHALLENGE_REPLY_ERROR_TLS_CERT_VALID_START_DATE_IN_FUTURE; |
| 65 case AuthResult::ERROR_TLS_CERT_EXPIRED: |
| 66 return proto::CHALLENGE_REPLY_ERROR_TLS_CERT_EXPIRED; |
| 67 case AuthResult::ERROR_CRL_INVALID: |
| 68 return proto::CHALLENGE_REPLY_ERROR_CRL_INVALID; |
| 69 case AuthResult::ERROR_CERT_REVOKED: |
| 70 return proto::CHALLENGE_REPLY_ERROR_CERT_REVOKED; |
| 61 default: | 71 default: |
| 62 NOTREACHED(); | 72 NOTREACHED(); |
| 63 return proto::CHALLENGE_REPLY_ERROR_NONE; | 73 return proto::CHALLENGE_REPLY_ERROR_NONE; |
| 64 } | 74 } |
| 65 } | 75 } |
| 66 | 76 |
| 67 std::unique_ptr<char[]> Compress(const std::string& input, size_t* length) { | 77 std::unique_ptr<char[]> Compress(const std::string& input, size_t* length) { |
| 68 *length = 0; | 78 *length = 0; |
| 69 z_stream stream = {0}; | 79 z_stream stream = {0}; |
| 70 int result = deflateInit2(&stream, | 80 int result = deflateInit2(&stream, |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 if (it != aggregated_socket_events_.end()) { | 368 if (it != aggregated_socket_events_.end()) { |
| 359 return it->second->last_errors; | 369 return it->second->last_errors; |
| 360 } else { | 370 } else { |
| 361 return LastErrors(); | 371 return LastErrors(); |
| 362 } | 372 } |
| 363 } | 373 } |
| 364 | 374 |
| 365 } // namespace cast_channel | 375 } // namespace cast_channel |
| 366 } // namespace api | 376 } // namespace api |
| 367 } // namespace extensions | 377 } // namespace extensions |
| OLD | NEW |