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

Side by Side Diff: extensions/browser/api/cast_channel/logger.cc

Issue 687733004: Implement crypto signature verification routines using OpenSSL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix const truncation warning (raised by Win builds.) Created 6 years, 1 month 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
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/browser/api/cast_channel/logger.h" 5 #include "extensions/browser/api/cast_channel/logger.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/time/tick_clock.h" 10 #include "base/time/tick_clock.h"
(...skipping 28 matching lines...) Expand all
39 case AuthResult::ERROR_NO_PAYLOAD: 39 case AuthResult::ERROR_NO_PAYLOAD:
40 return proto::CHALLENGE_REPLY_ERROR_NO_PAYLOAD; 40 return proto::CHALLENGE_REPLY_ERROR_NO_PAYLOAD;
41 case AuthResult::ERROR_PAYLOAD_PARSING_FAILED: 41 case AuthResult::ERROR_PAYLOAD_PARSING_FAILED:
42 return proto::CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED; 42 return proto::CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED;
43 case AuthResult::ERROR_MESSAGE_ERROR: 43 case AuthResult::ERROR_MESSAGE_ERROR:
44 return proto::CHALLENGE_REPLY_ERROR_MESSAGE_ERROR; 44 return proto::CHALLENGE_REPLY_ERROR_MESSAGE_ERROR;
45 case AuthResult::ERROR_NO_RESPONSE: 45 case AuthResult::ERROR_NO_RESPONSE:
46 return proto::CHALLENGE_REPLY_ERROR_NO_RESPONSE; 46 return proto::CHALLENGE_REPLY_ERROR_NO_RESPONSE;
47 case AuthResult::ERROR_FINGERPRINT_NOT_FOUND: 47 case AuthResult::ERROR_FINGERPRINT_NOT_FOUND:
48 return proto::CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND; 48 return proto::CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND;
49 case AuthResult::ERROR_NSS_CERT_PARSING_FAILED: 49 case AuthResult::ERROR_CERT_PARSING_FAILED:
50 return proto::CHALLENGE_REPLY_ERROR_NSS_CERT_PARSING_FAILED; 50 return proto::CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED;
51 case AuthResult::ERROR_NSS_CERT_NOT_SIGNED_BY_TRUSTED_CA: 51 case AuthResult::ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA:
52 return proto::CHALLENGE_REPLY_ERROR_NSS_CERT_NOT_SIGNED_BY_TRUSTED_CA; 52 return proto::CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA;
53 case AuthResult::ERROR_NSS_CANNOT_EXTRACT_PUBLIC_KEY: 53 case AuthResult::ERROR_CANNOT_EXTRACT_PUBLIC_KEY:
54 return proto::CHALLENGE_REPLY_ERROR_NSS_CANNOT_EXTRACT_PUBLIC_KEY; 54 return proto::CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY;
55 case AuthResult::ERROR_NSS_SIGNED_BLOBS_MISMATCH: 55 case AuthResult::ERROR_SIGNED_BLOBS_MISMATCH:
56 return proto::CHALLENGE_REPLY_ERROR_NSS_SIGNED_BLOBS_MISMATCH; 56 return proto::CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH;
57 default: 57 default:
58 NOTREACHED(); 58 NOTREACHED();
59 return proto::CHALLENGE_REPLY_ERROR_NONE; 59 return proto::CHALLENGE_REPLY_ERROR_NONE;
60 } 60 }
61 } 61 }
62 62
63 scoped_ptr<char[]> Compress(const std::string& input, size_t* length) { 63 scoped_ptr<char[]> Compress(const std::string& input, size_t* length) {
64 *length = 0; 64 *length = 0;
65 z_stream stream = {0}; 65 z_stream stream = {0};
66 int result = deflateInit2(&stream, 66 int result = deflateInit2(&stream,
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 if (it != aggregated_socket_events_.end()) { 362 if (it != aggregated_socket_events_.end()) {
363 return it->second->last_errors; 363 return it->second->last_errors;
364 } else { 364 } else {
365 return LastErrors(); 365 return LastErrors();
366 } 366 }
367 } 367 }
368 368
369 } // namespace cast_channel 369 } // namespace cast_channel
370 } // namespace core_api 370 } // namespace core_api
371 } // namespace extensions 371 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/cast_channel/cast_socket.cc ('k') | extensions/browser/api/cast_channel/logger_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698