From c43513df2f257e75f36efa29397aa305ccaa4883 Mon Sep 17 00:00:00 2001 From: "mseaborn@chromium.org" Date: Tue, 29 May 2012 21:25:56 +0000 Subject: NaCl: Remove the plugin's internal definition of GetUrandomFD() The code in the NaCl repo no longer uses this function; it gets a /dev/urandom FD via dependency injection instead. BUG=http://code.google.com/p/nativeclient/issues/detail?id=2655 TEST=nacl_integration etc. Review URL: https://chromiumcodereview.appspot.com/10448055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139376 0039d316-1c4b-4281-b951-d872f2087c98 --- .../src/trusted/plugin/browser_utils.cc | 21 --------------------- .../src/trusted/plugin/module_ppapi.cc | 9 ++++----- .../src/trusted/plugin/nacl_entry_points.h | 3 --- ppapi/native_client/src/trusted/plugin/plugin.gyp | 1 - 4 files changed, 4 insertions(+), 30 deletions(-) delete mode 100644 ppapi/native_client/src/trusted/plugin/browser_utils.cc (limited to 'ppapi/native_client') diff --git a/ppapi/native_client/src/trusted/plugin/browser_utils.cc b/ppapi/native_client/src/trusted/plugin/browser_utils.cc deleted file mode 100644 index af0f6b2..0000000 --- a/ppapi/native_client/src/trusted/plugin/browser_utils.cc +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2011 The Chromium Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - - -// Portable interface for browser interaction - API invariant portions. -#define BASE_IMPLEMENTATION - -#include "base/rand_util_c.h" - -#include "native_client/src/trusted/plugin/nacl_entry_points.h" - - -extern "C" { - int GetUrandomFD(void) { - return get_urandom_fd(); - } -} - diff --git a/ppapi/native_client/src/trusted/plugin/module_ppapi.cc b/ppapi/native_client/src/trusted/plugin/module_ppapi.cc index f639e7a..f43c26a 100644 --- a/ppapi/native_client/src/trusted/plugin/module_ppapi.cc +++ b/ppapi/native_client/src/trusted/plugin/module_ppapi.cc @@ -13,8 +13,6 @@ #include "ppapi/c/private/ppb_nacl_private.h" #include "ppapi/cpp/module.h" -GetURandomFDFunc get_urandom_fd; - namespace plugin { class ModulePpapi : public pp::Module { @@ -48,11 +46,12 @@ class ModulePpapi : public pp::Module { launch_nacl_process = reinterpret_cast( private_interface_->LaunchSelLdr); - // TODO(mseaborn): Remove this get_urandom_fd global variable once - // the NaCl side no longer depends on it. - get_urandom_fd = private_interface_->UrandomFD; #if NACL_LINUX || NACL_OSX + // Note that currently we do not need random numbers inside the + // NaCl trusted plugin on Unix, but NaClSecureRngModuleInit() is + // strict and will raise a fatal error unless we provide it with a + // /dev/urandom FD beforehand. NaClSecureRngModuleSetUrandomFd(dup(private_interface_->UrandomFD())); #endif diff --git a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h index 8074e5f..3723394 100644 --- a/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h +++ b/ppapi/native_client/src/trusted/plugin/nacl_entry_points.h @@ -23,11 +23,8 @@ typedef bool (*LaunchNaClProcessFunc)(PP_Instance instance, typedef bool (*StartPpapiProxyFunc)(PP_Instance instance); -typedef int (*GetURandomFDFunc)(void); - extern LaunchNaClProcessFunc launch_nacl_process; extern StartPpapiProxyFunc start_ppapi_proxy; -extern GetURandomFDFunc get_urandom_fd; #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_NACL_ENTRY_POINTS_H_ diff --git a/ppapi/native_client/src/trusted/plugin/plugin.gyp b/ppapi/native_client/src/trusted/plugin/plugin.gyp index b36b644..f080c49 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.gyp +++ b/ppapi/native_client/src/trusted/plugin/plugin.gyp @@ -85,7 +85,6 @@ 'type': 'loadable_module', 'sources': [ '<@(common_sources)', - 'browser_utils.cc', ], 'xcode_settings': { 'OTHER_LDFLAGS': [ -- cgit v1.1