Add a config flag for the global RNG

The global RNG should be provided by the application depending on
the RNG used there. (I.e. TRNG)
diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h
index 1a057a4..965efff 100644
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -3683,6 +3683,14 @@
  */
 //#define MBEDTLS_PLATFORM_GMTIME_R_ALT
 
+/**
+ * Uncomment the macro to let Mbed TLS use a platform implementation of
+ * global RNG.
+ *
+ * By default the global RNG function will be a no-op.
+ */
+//#define MBEDTLS_PLATFORM_GLOBAL_RNG
+
 /* \} name SECTION: Customisation configuration options */
 
 /**
diff --git a/library/platform_util.c b/library/platform_util.c
index 73759cd..a5ece50 100644
--- a/library/platform_util.c
+++ b/library/platform_util.c
@@ -137,12 +137,13 @@
     return 1;
 }
 
-//TODO: This is a stub implementation of the global RNG function.
+#if !defined(MBEDTLS_PLATFORM_GLOBAL_RNG)
 size_t mbedtls_random_in_range( size_t num )
 {
     (void) num;
     return 0;
 }
+#endif /* !MBEDTLS_PLATFORM_GLOBAL_RNG */
 
 #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_PLATFORM_GMTIME_R_ALT)
 #include <time.h>