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

Unified Diff: ipc/handle_attachment_win.cc

Issue 1345633002: ipc: Move //crypto dependency into a Windows-only file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « ipc/brokerable_attachment_win.cc ('k') | ipc/ipc.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/handle_attachment_win.cc
diff --git a/ipc/handle_attachment_win.cc b/ipc/handle_attachment_win.cc
index 429c964ee53312bb443491e0f25b410889389df3..50e3e6dab24310c5bba54d5f44cfa42cb436630e 100644
--- a/ipc/handle_attachment_win.cc
+++ b/ipc/handle_attachment_win.cc
@@ -6,29 +6,12 @@
#include <windows.h>
-#include "crypto/random.h"
-
namespace IPC {
namespace internal {
-namespace {
-
-// In order to prevent mutually untrusted processes from stealing resources from
-// one another, the nonce must be secret. This generates a 128-bit,
-// cryptographicaly-strong random number.
-BrokerableAttachment::AttachmentId GenerateAttachementId() {
- BrokerableAttachment::AttachmentId result;
- crypto::RandBytes(result.nonce, BrokerableAttachment::kNonceSize);
- return result;
-}
-
-} // namespace
-
HandleAttachmentWin::HandleAttachmentWin(const HANDLE& handle,
HandleWin::Permissions permissions)
- : BrokerableAttachment(GenerateAttachementId(), true),
- handle_(handle),
- permissions_(permissions) {}
+ : handle_(handle), permissions_(permissions) {}
HandleAttachmentWin::HandleAttachmentWin(const WireFormat& wire_format)
: BrokerableAttachment(wire_format.attachment_id, false),
« no previous file with comments | « ipc/brokerable_attachment_win.cc ('k') | ipc/ipc.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698