projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT3544: Remove MWERKS support
[openssl.git]
/
crypto
/
rand
/
rand_nw.c
diff --git
a/crypto/rand/rand_nw.c
b/crypto/rand/rand_nw.c
index 0ff884783e103aec091f747f9c50b3459d28dfee..9239a72dae2c26a5edca3713e188feaf31b9d59d 100644
(file)
--- a/
crypto/rand/rand_nw.c
+++ b/
crypto/rand/rand_nw.c
@@
-1,4
+1,4
@@
-/* crypto/rand/rand_
win
.c */
+/* crypto/rand/rand_
nw
.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@
-116,10
+116,16
@@
#if defined (OPENSSL_SYS_NETWARE)
#if defined(NETWARE_LIBC)
#if defined (OPENSSL_SYS_NETWARE)
#if defined(NETWARE_LIBC)
-#include <nks\thread.h>
+#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
*/
@@
-136,29
+142,29
@@
int RAND_poll(void)
* ThreadSwitchWithDelay() will introduce additional variability into
* the data returned by rdtsc.
*
* ThreadSwitchWithDelay() will introduce additional variability into
* the data returned by rdtsc.
*
- * Applications can agument the seed material by adding additional
+ * Applications can a
r
gument the seed material by adding additional
* stuff with RAND_add() and should probably do so.
*/
l = GetProcessSwitchCount();
RAND_add(&l,sizeof(l),1);
* stuff with RAND_add() and should probably do so.
*/
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++)
{
- asm
- {
- rdtsc
- mov tsc, eax
- }
+#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);
l = GetSuperHighResolutionTimer();
RAND_add(&l, sizeof(l), 0);
# if defined(NETWARE_LIBC)
RAND_add(&tsc, sizeof(tsc), 1);
l = GetSuperHighResolutionTimer();
RAND_add(&l, sizeof(l), 0);
# if defined(NETWARE_LIBC)
-
NXThreadYield();
+ NXThreadYield();
# else /* NETWARE_CLIB */
ThreadSwitchWithDelay();
# endif
# else /* NETWARE_CLIB */
ThreadSwitchWithDelay();
# endif