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

Unified Diff: src/trusted/nonnacl_util/sel_ldr_launcher_base.cc

Issue 10914138: Split secure command channel and untrusted application channel (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Fixed a few nits. Created 8 years, 3 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
« no previous file with comments | « src/trusted/nonnacl_util/sel_ldr_launcher.h ('k') | src/trusted/sel_universal/reverse_emulate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/nonnacl_util/sel_ldr_launcher_base.cc
diff --git a/src/trusted/nonnacl_util/sel_ldr_launcher_base.cc b/src/trusted/nonnacl_util/sel_ldr_launcher_base.cc
index e24ba46cbb860dac773b14ba3b14f8dc18ac2091..cf2e580b4178d5d6fbd1b9c7192ca64e834e3955 100644
--- a/src/trusted/nonnacl_util/sel_ldr_launcher_base.cc
+++ b/src/trusted/nonnacl_util/sel_ldr_launcher_base.cc
@@ -16,6 +16,7 @@ namespace nacl {
SelLdrLauncherBase::SelLdrLauncherBase()
: channel_(kInvalidHandle),
bootstrap_socket_(NULL),
+ secure_socket_addr_(NULL),
socket_addr_(NULL) {
}
@@ -47,11 +48,12 @@ bool SelLdrLauncherBase::RetrieveSockAddr() {
if (0 != bootstrap_socket_->RecvMsg(&header, 0, NULL)) {
return false;
}
- // Check that there was exactly one descriptor passed.
- if (1 != header.ndescv_length) {
+ // Check that there were exactly two descriptors passed.
+ if (2 != header.ndescv_length) {
return false;
}
- socket_addr_.reset(descs[0]);
+ secure_socket_addr_.reset(descs[0]);
+ socket_addr_.reset(descs[1]);
return true;
}
@@ -76,8 +78,8 @@ bool SelLdrLauncherBase::SetupCommand(NaClSrpcChannel* command) {
"getting sel_ldr socket address failed\n");
return false;
}
- // The first connection goes to the trusted command channel.
- scoped_ptr<DescWrapper> command_desc(socket_addr_->Connect());
+ // Connect to the trusted command channel.
+ scoped_ptr<DescWrapper> command_desc(secure_socket_addr_->Connect());
if (command_desc == NULL) {
NaClLog(0, "SelLdrLauncher::SetupCommand: Connect failed\n");
return false;
@@ -166,7 +168,7 @@ bool SelLdrLauncherBase::StartModule(NaClSrpcChannel* command) {
}
bool SelLdrLauncherBase::SetupAppChannel(NaClSrpcChannel* out_app_chan) {
- // The second connection goes to the untrusted service itself.
+ // Connect to the untrusted service itself.
scoped_ptr<DescWrapper> untrusted_desc(socket_addr_->Connect());
if (untrusted_desc == NULL) {
NaClLog(4, "SelLdrLauncher::StartModuleAndSetupAppChannel: "
« no previous file with comments | « src/trusted/nonnacl_util/sel_ldr_launcher.h ('k') | src/trusted/sel_universal/reverse_emulate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698