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

Unified Diff: extensions/browser/api/cast_channel/cast_channel_api.cc

Issue 2709523008: [Cast Channel] Add support for nonce challenge to Cast channel authentication. (Closed)
Patch Set: Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/cast_channel/cast_channel_api.cc
diff --git a/extensions/browser/api/cast_channel/cast_channel_api.cc b/extensions/browser/api/cast_channel/cast_channel_api.cc
index b8fd3b2b64e75a17da811befc06427924d633d79..910788af0757bb9617291926d64566fad888654f 100644
--- a/extensions/browser/api/cast_channel/cast_channel_api.cc
+++ b/extensions/browser/api/cast_channel/cast_channel_api.cc
@@ -12,6 +12,7 @@
#include <string>
#include <utility>
+#include "base/guid.h"
#include "base/json/json_writer.h"
#include "base/lazy_instance.h"
#include "base/memory/ptr_util.h"
@@ -242,8 +243,7 @@ void CastChannelAsyncApiFunction::SetResultFromChannelInfo(
}
CastChannelOpenFunction::CastChannelOpenFunction()
- : new_channel_id_(0) {
-}
+ : new_channel_id_(0), nonce_(base::GenerateGUID()) {}
CastChannelOpenFunction::~CastChannelOpenFunction() { }
@@ -317,7 +317,8 @@ void CastChannelOpenFunction::AsyncWorkStart() {
: kDefaultConnectTimeoutMillis),
liveness_timeout_ > base::TimeDelta(), api_->GetLogger(),
connect_info.capabilities.get() ? *connect_info.capabilities
- : CastDeviceCapability::NONE);
+ : CastDeviceCapability::NONE,
+ nonce_);
}
new_channel_id_ = AddSocket(socket);
api_->GetLogger()->LogNewSocketEvent(*socket);

Powered by Google App Engine
This is Rietveld 408576698