diff options
author | dilmah@chromium.org <dilmah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 11:58:44 +0000 |
---|---|---|
committer | dilmah@chromium.org <dilmah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 11:58:44 +0000 |
commit | c6e584c20129f8745e6fc9170a220eb58e13e172 (patch) | |
tree | 6491e890f845af7443f6be07d15d9e60c89ec998 /crypto/hmac.h | |
parent | 37e7790801761dc99be00d69f102b7319f2d6a8e (diff) | |
download | chromium_src-c6e584c20129f8745e6fc9170a220eb58e13e172.zip chromium_src-c6e584c20129f8745e6fc9170a220eb58e13e172.tar.gz chromium_src-c6e584c20129f8745e6fc9170a220eb58e13e172.tar.bz2 |
Private API for extensions like ssh-client that need access to websocket-to-tcp proxy.
Access to TCP is obtained in following way:
(1) extension requests authentication token via call to private API like:
chrome.webSocketProxyPrivate.getPassportForTCP('netbsd.org', 25, callback);
if API validates this request
then extension obtains some string token (in callback).
(2) open websocket connection to local websocket-to-tcp proxy ws://127.0.0.1:10101/tcpproxy
(3) pass header containing hostname, port and token obtained at step (1)
(4) communicate (in base64 encoding at this moment).
Proxy (running in chrome process) verifies those tokens by calls to InternalAuthVerification::VerifyPassport
Passports are one-time; no passport can be reused.
Passports expire in short period of time (20 seconds).
BUG=chromium-os:9667
TEST=unit_test,apitest
Review URL: http://codereview.chromium.org/6683060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85757 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/hmac.h')
-rw-r--r-- | crypto/hmac.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/hmac.h b/crypto/hmac.h index 7852797..c0706d8 100644 --- a/crypto/hmac.h +++ b/crypto/hmac.h @@ -51,7 +51,9 @@ class HMAC { // to the constructor and the key supplied to the Init method. The HMAC is // returned in |digest|, which has |digest_length| bytes of storage available. // TODO(abarth): digest_length should be a size_t. - bool Sign(const std::string& data, unsigned char* digest, int digest_length); + bool Sign(const std::string& data, + unsigned char* digest, + int digest_length) const; // TODO(albertb): Add a Verify method. |