projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PR: 2632
[oweals/openssl.git]
/
crypto
/
rand
/
rand_nw.c
diff --git
a/crypto/rand/rand_nw.c
b/crypto/rand/rand_nw.c
index ba57812788757228121d80a7286fa1f38911f41b..8d5b8d2e3217f438a4030308528112c872a7403c 100644
(file)
--- a/
crypto/rand/rand_nw.c
+++ b/
crypto/rand/rand_nw.c
@@
-117,9
+117,15
@@
#if defined(NETWARE_LIBC)
#include <nks/thread.h>
#if defined(NETWARE_LIBC)
#include <nks/thread.h>
+#else
+#include <nwthread.h>
#endif
#endif
-extern long RunningProcess;
+extern int GetProcessSwitchCount(void);
+#if !defined(NETWARE_LIBC) || (CURRENT_NDK_THRESHOLD < 509220000)
+extern void *RunningProcess; /* declare here same as found in newer NDKs */
+extern unsigned long GetSuperHighResolutionTimer(void);
+#endif
/* the FAQ indicates we need to provide at least 20 bytes (160 bits) of seed
*/
/* the FAQ indicates we need to provide at least 20 bytes (160 bits) of seed
*/
@@
-142,7
+148,8
@@
int RAND_poll(void)
l = GetProcessSwitchCount();
RAND_add(&l,sizeof(l),1);
l = GetProcessSwitchCount();
RAND_add(&l,sizeof(l),1);
- l=RunningProcess;
+ /* need to cast the void* to unsigned long here */
+ l = (unsigned long)RunningProcess;
RAND_add(&l,sizeof(l),1);
for( i=2; i<ENTROPY_NEEDED; i++)
RAND_add(&l,sizeof(l),1);
for( i=2; i<ENTROPY_NEEDED; i++)
@@
-153,8
+160,8
@@
int RAND_poll(void)
rdtsc
mov tsc, eax
}
rdtsc
mov tsc, eax
}
-#el
se
- asm volatile("rdtsc":"=
A" (tsc)
);
+#el
if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+ asm volatile("rdtsc":"=
a"(tsc)::"edx"
);
#endif
RAND_add(&tsc, sizeof(tsc), 1);
#endif
RAND_add(&tsc, sizeof(tsc), 1);