Chromium Code Reviews| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 | 56 |
| 57 // Creates a URL fetcher for PrivetV1. | 57 // Creates a URL fetcher for PrivetV1. |
| 58 virtual scoped_ptr<PrivetURLFetcher> CreateURLFetcher( | 58 virtual scoped_ptr<PrivetURLFetcher> CreateURLFetcher( |
| 59 const GURL& url, | 59 const GURL& url, |
| 60 net::URLFetcher::RequestType request_type, | 60 net::URLFetcher::RequestType request_type, |
| 61 PrivetURLFetcher::Delegate* delegate) = 0; | 61 PrivetURLFetcher::Delegate* delegate) = 0; |
| 62 | 62 |
| 63 virtual void RefreshPrivetToken( | 63 virtual void RefreshPrivetToken( |
| 64 const PrivetURLFetcher::TokenCallback& token_callback) = 0; | 64 const PrivetURLFetcher::TokenCallback& token_callback) = 0; |
| 65 | 65 |
| 66 // After this call HTTPS will be used. Only requests to the server with | 66 // After this call only HTTPS will be used. Only requests to the server with |
| 67 // matching certificate will be allowed. | 67 // matching certificate will be allowed. |
| 68 // Privet v3 devices must supports HTTPS. However the device has self-signed | |
|
Aleksey Shlyapnikov
2015/10/30 21:40:00
support
Vitaly Buka (NO REVIEWS)
2015/10/30 21:49:32
Done.
| |
| 69 // certificate so normal validation is not useful. The only know information | |
|
Aleksey Shlyapnikov
2015/10/30 21:40:00
known
Vitaly Buka (NO REVIEWS)
2015/10/30 21:49:32
Done.
| |
| 70 // about device is fingerprint of the certificate. | |
| 71 // Before using HTTPS, Privet v3 pairing generates a shared secret using | |
| 72 // SPAKE2 over an insecure channel. Then the device sends the fingerprint | |
| 73 // to the client, over the insecure channel, but signed using the shared | |
| 74 // secret. | |
| 75 // More info on pairing: | |
| 76 // https://developers.google.com/cloud-devices/v1/reference/local-api/pairing_ start | |
| 68 virtual void SwitchToHttps( | 77 virtual void SwitchToHttps( |
| 69 uint16_t port, | 78 uint16_t port, |
| 70 const net::SHA256HashValue& certificate_fingerprint) = 0; | 79 const net::SHA256HashValue& certificate_fingerprint) = 0; |
| 71 | 80 |
| 72 virtual bool IsInHttpsMode() const = 0; | 81 virtual bool IsInHttpsMode() const = 0; |
| 73 }; | 82 }; |
| 74 | 83 |
| 75 class PrivetDataReadOperation { | 84 class PrivetDataReadOperation { |
| 76 public: | 85 public: |
| 77 enum ResponseType { | 86 enum ResponseType { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation( | 222 virtual scoped_ptr<PrivetJSONOperation> CreateCapabilitiesOperation( |
| 214 const PrivetJSONOperation::ResultCallback& callback) = 0; | 223 const PrivetJSONOperation::ResultCallback& callback) = 0; |
| 215 | 224 |
| 216 // Creates operation to submit print job to local printer. | 225 // Creates operation to submit print job to local printer. |
| 217 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( | 226 virtual scoped_ptr<PrivetLocalPrintOperation> CreateLocalPrintOperation( |
| 218 PrivetLocalPrintOperation::Delegate* delegate) = 0; | 227 PrivetLocalPrintOperation::Delegate* delegate) = 0; |
| 219 }; | 228 }; |
| 220 | 229 |
| 221 } // namespace local_discovery | 230 } // namespace local_discovery |
| 222 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ | 231 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_HTTP_H_ |
| OLD | NEW |