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

Unified Diff: src/shared/platform/nacl_global_secure_random.c

Issue 537543003: Add a get_random_bytes() syscall to replace the SRPC-based implementation (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Fix glibc tests Created 6 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/shared/platform/nacl_global_secure_random.h ('k') | src/trusted/service_runtime/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/platform/nacl_global_secure_random.c
diff --git a/src/shared/platform/nacl_global_secure_random.c b/src/shared/platform/nacl_global_secure_random.c
index d09ccac2db1ebfcda5ce9974dcce1825493f4b76..7892416b2ef91ef319a7a3195080280f12bb954c 100644
--- a/src/shared/platform/nacl_global_secure_random.c
+++ b/src/shared/platform/nacl_global_secure_random.c
@@ -55,6 +55,12 @@ uint32_t NaClGlobalSecureRngUint32(void) {
return rv;
}
+void NaClGlobalSecureRngGenerateBytes(uint8_t *buf, size_t buf_size) {
+ NaClXMutexLock(&nacl_global_rng_mu);
+ (*nacl_grngp->base.vtbl->GenBytes)(&nacl_grngp->base, buf, buf_size);
+ NaClXMutexUnlock(&nacl_global_rng_mu);
+}
+
void NaClGenerateRandomPath(char *path, int length) {
/*
* This function is used for generating random paths and names,
« no previous file with comments | « src/shared/platform/nacl_global_secure_random.h ('k') | src/trusted/service_runtime/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698