Deprecate RAND_pseudo_bytes
[openssl.git] / crypto / rand / md_rand.c
index 70743e116278eafe31080d3805953474d83bbc0f..27e785d311ea8e48b166020e787b3bdbdc02ca57 100644 (file)
 
 #include "e_os.h"
 
-#if !(defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYSNAME_DSPBIOS))
+#if !(defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_DSPBIOS))
 # include <sys/time.h>
 #endif
 #if defined(OPENSSL_SYS_VXWORKS)
@@ -173,7 +173,9 @@ static int ssleay_rand_seed(const void *buf, int num);
 static int ssleay_rand_add(const void *buf, int num, double add_entropy);
 static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo);
 static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num);
+#ifndef OPENSSL_NO_DEPRECATED
 static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num);
+#endif
 static int ssleay_rand_status(void);
 
 static RAND_METHOD rand_ssleay_meth = {
@@ -181,7 +183,11 @@ static RAND_METHOD rand_ssleay_meth = {
     ssleay_rand_nopseudo_bytes,
     ssleay_rand_cleanup,
     ssleay_rand_add,
+#ifndef OPENSSL_NO_DEPRECATED
     ssleay_rand_pseudo_bytes,
+#else
+    NULL,
+#endif
     ssleay_rand_status
 };
 
@@ -383,7 +389,7 @@ static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo)
 #elif defined(OPENSSL_SYS_VXWORKS)
     struct timespec tv;
     clock_gettime(CLOCK_REALTIME, &ts);
-#elif defined(OPENSSL_SYSNAME_DSPBIOS)
+#elif defined(OPENSSL_SYS_DSPBIOS)
     unsigned long long tv, OPENSSL_rdtsc();
     tv = OPENSSL_rdtsc();
 #else
@@ -601,6 +607,7 @@ static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num)
     return ssleay_rand_bytes(buf, num, 0);
 }
 
+#ifndef OPENSSL_NO_DEPRECATED
 /*
  * pseudo-random bytes that are guaranteed to be unique but not unpredictable
  */
@@ -608,6 +615,7 @@ static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num)
 {
     return ssleay_rand_bytes(buf, num, 1);
 }
+#endif
 
 static int ssleay_rand_status(void)
 {