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

Side by Side Diff: extensions/browser/api/cast_channel/cast_auth_util.h

Issue 687733004: Implement crypto signature verification routines using OpenSSL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Standardized capitalization of error strings, quick fixes 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 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_ 5 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_
6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_ 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 namespace extensions { 10 namespace extensions {
11 namespace core_api { 11 namespace core_api {
12 namespace cast_channel { 12 namespace cast_channel {
13 13
14 class CastMessage; 14 class CastMessage;
15 class DeviceAuthMessage; 15 class DeviceAuthMessage;
16 16
17 struct AuthResult { 17 struct AuthResult {
18 public: 18 public:
19 enum ErrorType { 19 enum ErrorType {
20 ERROR_NONE, 20 ERROR_NONE,
21 ERROR_PEER_CERT_EMPTY, 21 ERROR_PEER_CERT_EMPTY,
22 ERROR_WRONG_PAYLOAD_TYPE, 22 ERROR_WRONG_PAYLOAD_TYPE,
23 ERROR_NO_PAYLOAD, 23 ERROR_NO_PAYLOAD,
24 ERROR_PAYLOAD_PARSING_FAILED, 24 ERROR_PAYLOAD_PARSING_FAILED,
25 ERROR_MESSAGE_ERROR, 25 ERROR_MESSAGE_ERROR,
26 ERROR_NO_RESPONSE, 26 ERROR_NO_RESPONSE,
27 ERROR_FINGERPRINT_NOT_FOUND, 27 ERROR_FINGERPRINT_NOT_FOUND,
28 ERROR_NSS_CERT_PARSING_FAILED, 28 ERROR_NSS_CERT_PARSING_FAILED,
davidben 2014/10/30 18:37:22 Nit: Maybe remove the NSS_ prefix from these since
mark a. foltz 2014/10/31 06:49:11 +1
Kevin M 2014/10/31 21:39:37 Done.
Kevin M 2014/10/31 21:39:37 Done.
29 ERROR_NSS_CERT_NOT_SIGNED_BY_TRUSTED_CA, 29 ERROR_NSS_CERT_NOT_SIGNED_BY_TRUSTED_CA,
30 ERROR_NSS_CANNOT_EXTRACT_PUBLIC_KEY, 30 ERROR_NSS_CANNOT_EXTRACT_PUBLIC_KEY,
31 ERROR_NSS_SIGNED_BLOBS_MISMATCH 31 ERROR_NSS_SIGNED_BLOBS_MISMATCH,
32 ERROR_UNEXPECTED_AUTH_LIBRARY_RESULT,
32 }; 33 };
33 34
34 // Constructs a AuthResult that corresponds to success. 35 // Constructs a AuthResult that corresponds to success.
35 AuthResult(); 36 AuthResult();
36 ~AuthResult(); 37 ~AuthResult();
37 38
38 static AuthResult Create(const std::string& error_message, 39 static AuthResult Create(const std::string& error_message,
39 ErrorType error_type); 40 ErrorType error_type);
40 static AuthResult CreateWithNSSError(const std::string& error_message, 41 static AuthResult CreateWithNSSError(const std::string& error_message,
41 ErrorType error_type, 42 ErrorType error_type,
(...skipping 21 matching lines...) Expand all
63 // Returns an empty AuthResult on success, or a populated AuthResult on 64 // Returns an empty AuthResult on success, or a populated AuthResult on
64 // failure. 65 // failure.
65 AuthResult ParseAuthMessage(const CastMessage& challenge_reply, 66 AuthResult ParseAuthMessage(const CastMessage& challenge_reply,
66 DeviceAuthMessage* auth_message); 67 DeviceAuthMessage* auth_message);
67 68
68 } // namespace cast_channel 69 } // namespace cast_channel
69 } // namespace core_api 70 } // namespace core_api
70 } // namespace extensions 71 } // namespace extensions
71 72
72 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_ 73 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698