| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // After this call only HTTPS will be used. Only requests to the server with | 68 // After this call only HTTPS will be used. Only requests to the server with |
| 69 // matching certificate will be allowed. | 69 // matching certificate will be allowed. |
| 70 // Privet v3 devices MUST support HTTPS. Before communicating over HTTPS, | 70 // Privet v3 devices MUST support HTTPS. Before communicating over HTTPS, |
| 71 // Privet v3 pairing generates a shared secret using SPAKE2 over an | 71 // Privet v3 pairing generates a shared secret using SPAKE2 over an |
| 72 // unauthenticated channel. This shared secret is used to then authenticate | 72 // unauthenticated channel. This shared secret is used to then authenticate |
| 73 // the fingerprint of a certificate, which is self-signed. The client then | 73 // the fingerprint of a certificate, which is self-signed. The client then |
| 74 // validates that the HTTPS peer is sending a certificate matching that | 74 // validates that the HTTPS peer is sending a certificate matching that |
| 75 // fingerprint. | 75 // fingerprint. |
| 76 // For more information on this protocol: | 76 // For more information on this protocol: |
| 77 // https://developers.google.com/cloud-devices/v1/reference/local-api/pairing_
start | 77 // https://developers.google.com/cloud-devices/v1/reference/local-api/pairing_
start |
| 78 virtual void SwitchToHttps( | 78 virtual void SwitchToHttps(uint16_t port) = 0; |
| 79 uint16_t port, | |
| 80 const net::SHA256HashValue& certificate_fingerprint) = 0; | |
| 81 | 79 |
| 82 virtual bool IsInHttpsMode() const = 0; | 80 virtual bool IsInHttpsMode() const = 0; |
| 83 | 81 |
| 84 virtual std::string GetHost() const = 0; | 82 virtual std::string GetHost() const = 0; |
| 85 }; | 83 }; |
| 86 | 84 |
| 87 class PrivetDataReadOperation { | 85 class PrivetDataReadOperation { |
| 88 public: | 86 public: |
| 89 enum ResponseType { | 87 enum ResponseType { |
| 90 RESPONSE_TYPE_ERROR, | 88 RESPONSE_TYPE_ERROR, |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation( | 223 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation( |
| 226 const PrivetJSONOperation::ResultCallback& callback) = 0; | 224 const PrivetJSONOperation::ResultCallback& callback) = 0; |
| 227 | 225 |
| 228 // Creates operation to submit print job to local printer. | 226 // Creates operation to submit print job to local printer. |
| 229 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( | 227 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( |
| 230 PrivetLocalPrintOperation::Delegate* delegate) = 0; | 228 PrivetLocalPrintOperation::Delegate* delegate) = 0; |
| 231 }; | 229 }; |
| 232 | 230 |
| 233 } // namespace local_discovery | 231 } // namespace local_discovery |
| 234 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 232 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ |
| OLD | NEW |