mp_rand_source(NULL) sets to platform random source
diff --git a/bn_mp_rand.c b/bn_mp_rand.c
index 6eae93c..f0954a0 100644
--- a/bn_mp_rand.c
+++ b/bn_mp_rand.c
@@ -165,7 +165,7 @@ static int (*s_rand_source)(void *, size_t) = s_mp_rand_source_platform;
void mp_rand_source(int (*get)(void *out, size_t size))
{
- s_rand_source = get;
+ s_rand_source = get == NULL ? s_mp_rand_source_platform : get;
}
/* makes a pseudo-random int of a given size */